Files
syndarix/frontend/tests/app/(auth)/login/page.test.tsx
Felipe Cardoso b2f3ec8f25 Refactor ESLint configuration and update test rules for clarity and consistency
- Consolidated and modularized `eslint.config.mjs` with defined rules for source, test, E2E, and scripts.
- Improved test and E2E rules with relaxed settings for flexibility and enhanced mocking.
- Standardized variable naming and removed redundant imports in unit and E2E tests.
- Updated error handling and comments to align with modern TypeScript best practices (e.g., `@ts-expect-error`).
2025-11-10 10:57:43 +01:00

38 lines
1.1 KiB
TypeScript

/**
* Tests for Login Page
* Smoke tests to verify page structure and component rendering
*/
import { render, screen } from '@testing-library/react';
import LoginPage from '@/app/(auth)/login/page';
// Mock dynamic import
jest.mock('next/dynamic', () => ({
__esModule: true,
default: (_importFn: () => Promise<any>, _options?: any) => {
const Component = () => <div data-testid="login-form">Mocked LoginForm</div>;
Component.displayName = 'LoginForm';
return Component;
},
}));
describe('LoginPage', () => {
it('renders without crashing', () => {
render(<LoginPage />);
expect(screen.getByText('Sign in to your account')).toBeInTheDocument();
});
it('renders heading and description', () => {
render(<LoginPage />);
expect(screen.getByRole('heading', { name: /sign in to your account/i })).toBeInTheDocument();
expect(screen.getByText(/access your dashboard and manage your account/i)).toBeInTheDocument();
});
it('renders LoginForm component', () => {
render(<LoginPage />);
expect(screen.getByTestId('login-form')).toBeInTheDocument();
});
});