diff --git a/frontend/tests/app/page.test.tsx b/frontend/tests/app/page.test.tsx index d79dffa..fec9b67 100644 --- a/frontend/tests/app/page.test.tsx +++ b/frontend/tests/app/page.test.tsx @@ -149,8 +149,9 @@ describe('HomePage', () => { it('renders demo cards', () => { render(); - expect(screen.getAllByText('Component Showcase')[0]).toBeInTheDocument(); + expect(screen.getAllByText('Design System Hub')[0]).toBeInTheDocument(); expect(screen.getAllByText('Authentication Flow')[0]).toBeInTheDocument(); + expect(screen.getAllByText('User Dashboard')[0]).toBeInTheDocument(); // Admin Dashboard appears in both Feature Grid and Demo Section, so use getAllByText const adminDashboards = screen.getAllByText('Admin Dashboard'); expect(adminDashboards.length).toBeGreaterThanOrEqual(1); @@ -230,9 +231,9 @@ describe('HomePage', () => { expect(loginLinks.some((link) => link.getAttribute('href') === '/login')).toBe(true); }); - it('has component showcase link', () => { + it('has design system link', () => { render(); - const devLinks = screen.getAllByRole('link', { name: /Component/i }); + const devLinks = screen.getAllByRole('link', { name: /Design System/i }); expect(devLinks.some((link) => link.getAttribute('href') === '/dev')).toBe(true); }); diff --git a/frontend/tests/components/home/DemoCredentialsModal.test.tsx b/frontend/tests/components/home/DemoCredentialsModal.test.tsx index 3522dfe..e13c9a8 100644 --- a/frontend/tests/components/home/DemoCredentialsModal.test.tsx +++ b/frontend/tests/components/home/DemoCredentialsModal.test.tsx @@ -49,7 +49,7 @@ describe('DemoCredentialsModal', () => { expect(screen.getByText('Regular User')).toBeInTheDocument(); expect(screen.getByText('demo@example.com')).toBeInTheDocument(); expect(screen.getByText('Demo123!')).toBeInTheDocument(); - expect(screen.getByText(/Access settings, organizations/i)).toBeInTheDocument(); + expect(screen.getByText(/User settings & profile/i)).toBeInTheDocument(); }); it('displays admin user credentials', () => { @@ -58,7 +58,7 @@ describe('DemoCredentialsModal', () => { expect(screen.getByText('Admin User (Superuser)')).toBeInTheDocument(); expect(screen.getByText('admin@example.com')).toBeInTheDocument(); expect(screen.getByText('Admin123!')).toBeInTheDocument(); - expect(screen.getByText(/Full admin panel access/i)).toBeInTheDocument(); + expect(screen.getByText(/Full admin dashboard/i)).toBeInTheDocument(); }); it('copies regular user credentials to clipboard', async () => { @@ -152,17 +152,20 @@ describe('DemoCredentialsModal', () => { expect(mockOnClose).toHaveBeenCalled(); }); - it('has a link to login page', () => { + it('has links to login page', () => { render(); - const loginLink = screen.getByRole('link', { name: /go to login/i }); - expect(loginLink).toHaveAttribute('href', '/login'); + const loginAsUserLink = screen.getByRole('link', { name: /login as user/i }); + expect(loginAsUserLink).toHaveAttribute('href', '/login'); + + const loginAsAdminLink = screen.getByRole('link', { name: /login as admin/i }); + expect(loginAsAdminLink).toHaveAttribute('href', '/login'); }); it('calls onClose when login link is clicked', () => { render(); - const loginLink = screen.getByRole('link', { name: /go to login/i }); + const loginLink = screen.getByRole('link', { name: /login as user/i }); fireEvent.click(loginLink); expect(mockOnClose).toHaveBeenCalled(); diff --git a/frontend/tests/components/home/Header.test.tsx b/frontend/tests/components/home/Header.test.tsx index 3e87a03..15ad0cb 100644 --- a/frontend/tests/components/home/Header.test.tsx +++ b/frontend/tests/components/home/Header.test.tsx @@ -64,7 +64,8 @@ describe('Header', () => { /> ); - expect(screen.getByRole('link', { name: 'Components' })).toHaveAttribute('href', '/dev'); + expect(screen.getByRole('link', { name: 'Home' })).toHaveAttribute('href', '/'); + expect(screen.getByRole('link', { name: 'Design System' })).toHaveAttribute('href', '/dev'); expect(screen.getByRole('link', { name: 'Admin Demo' })).toHaveAttribute('href', '/admin'); }); @@ -154,8 +155,8 @@ describe('Header', () => { // Note: SheetContent is hidden by default in tests, but we can verify the links exist // The actual mobile menu behavior is tested in E2E tests - const componentsLinks = screen.getAllByRole('link', { name: /components/i }); - expect(componentsLinks.length).toBeGreaterThan(0); + const designSystemLinks = screen.getAllByRole('link', { name: /Design System/i }); + expect(designSystemLinks.length).toBeGreaterThan(0); }); it('mobile menu contains GitHub link', () => {