- Replaced static paths with dynamic locale subpaths (`/[locale]/*`) in imports, URLs, and assertions across tests. - Updated `next-intl` mocks for improved compatibility with `locale`-aware components. - Standardized `page.goto` and navigation tests with `/en` as the base locale for consistency.
27 lines
940 B
TypeScript
27 lines
940 B
TypeScript
/**
|
|
* Tests for Password Reset Confirm Page
|
|
* Verifies Suspense wrapper and fallback
|
|
*/
|
|
|
|
import { render, screen } from '@testing-library/react';
|
|
import PasswordResetConfirmPage from '@/app/[locale]/(auth)/password-reset/confirm/page';
|
|
|
|
// Mock the content component
|
|
jest.mock('@/app/[locale]/(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();
|
|
});
|
|
});
|