forked from cardosofelipe/fast-next-template
- Introduced smoke tests for Login, Register, Password Reset, Password Reset Confirm, and Settings pages. - Enhanced test coverage for all dynamic imports using mocks and added Jest exclusions for non-testable Next.js files. - Added component-specific test files for better structure and maintainability. - Improved test isolation by mocking navigation, providers, and rendering contexts.
27 lines
922 B
TypeScript
27 lines
922 B
TypeScript
/**
|
|
* Tests for Password Reset Confirm Page
|
|
* Verifies Suspense wrapper and fallback
|
|
*/
|
|
|
|
import { render, screen } from '@testing-library/react';
|
|
import PasswordResetConfirmPage from '@/app/(auth)/password-reset/confirm/page';
|
|
|
|
// Mock the content component
|
|
jest.mock('@/app/(auth)/password-reset/confirm/PasswordResetConfirmContent', () => ({
|
|
__esModule: true,
|
|
default: () => <div data-testid="password-reset-confirm-content">Content</div>,
|
|
}));
|
|
|
|
describe('PasswordResetConfirmPage', () => {
|
|
it('renders without crashing', () => {
|
|
render(<PasswordResetConfirmPage />);
|
|
expect(screen.getByTestId('password-reset-confirm-content')).toBeInTheDocument();
|
|
});
|
|
|
|
it('wraps content in Suspense boundary', () => {
|
|
render(<PasswordResetConfirmPage />);
|
|
// Content should render successfully (not fallback)
|
|
expect(screen.getByTestId('password-reset-confirm-content')).toBeInTheDocument();
|
|
});
|
|
});
|