feat: scaffold operator-first 3proxy panel ui

This commit is contained in:
2026-04-01 22:52:38 +03:00
commit 0d035f3278
26 changed files with 3674 additions and 0 deletions

30
src/App.test.tsx Normal file
View File

@@ -0,0 +1,30 @@
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { describe, expect, it } from 'vitest';
import App from './App';
describe('App login gate', () => {
it('rejects wrong hardcoded credentials and keeps the panel locked', async () => {
const user = userEvent.setup();
render(<App />);
await user.type(screen.getByLabelText(/login/i), 'admin');
await user.type(screen.getByLabelText(/password/i), 'wrong-pass');
await user.click(screen.getByRole('button', { name: /open panel/i }));
expect(screen.getByText(/wrong panel credentials/i)).toBeInTheDocument();
expect(screen.queryByRole('navigation', { name: /primary/i })).not.toBeInTheDocument();
});
it('unlocks the panel with the configured credentials', async () => {
const user = userEvent.setup();
render(<App />);
await user.type(screen.getByLabelText(/login/i), 'admin');
await user.type(screen.getByLabelText(/password/i), 'proxy-ui-demo');
await user.click(screen.getByRole('button', { name: /open panel/i }));
expect(screen.getByRole('navigation', { name: /primary/i })).toBeInTheDocument();
expect(screen.getByText(/operator panel/i)).toBeInTheDocument();
});
});