Remove deprecated middleware and update component tests for branding and auth enhancements

- Deleted `middleware.disabled.ts` as it is no longer needed.
- Refactored `HeroSection` and `HomePage` tests to align with updated branding and messaging.
- Modified `DemoCredentialsModal` to support auto-filled demo credentials in login links.
- Mocked `ThemeToggle`, `LocaleSwitcher`, and `DemoCredentialsModal` in relevant tests.
- Updated admin tests to use `QueryClientProvider` and refactored API mocks for `AdminPage`.
- Replaced test assertions for stats section and badges with new branding content.
This commit is contained in:
Felipe Cardoso
2025-11-24 15:04:49 +01:00
parent acfe59c8b3
commit 13abd159fa
8 changed files with 131 additions and 112 deletions

View File

@@ -156,10 +156,16 @@ describe('DemoCredentialsModal', () => {
render(<DemoCredentialsModal open={true} onClose={mockOnClose} />);
const loginAsUserLink = screen.getByRole('link', { name: /login as user/i });
expect(loginAsUserLink).toHaveAttribute('href', '/login');
expect(loginAsUserLink).toHaveAttribute(
'href',
'/login?email=demo@example.com&password=Demo123!'
);
const loginAsAdminLink = screen.getByRole('link', { name: /login as admin/i });
expect(loginAsAdminLink).toHaveAttribute('href', '/login');
expect(loginAsAdminLink).toHaveAttribute(
'href',
'/login?email=admin@example.com&password=Admin123!'
);
});
it('calls onClose when login link is clicked', () => {