|
| 1 | +import { render, screen } from '../utils'; |
| 2 | +import ResetPasswordForm from '@/app/components/ResetPasswordForm'; |
| 3 | + |
| 4 | +describe('ResetPasswordForm Component', () => { |
| 5 | + it('renders the heading', () => { |
| 6 | + render(<ResetPasswordForm />); |
| 7 | + expect(screen.getByText('Forgot your Password?', { selector: 'h1' })).toBeInTheDocument(); |
| 8 | + }); |
| 9 | + |
| 10 | + it('renders the subheading', () => { |
| 11 | + render(<ResetPasswordForm />); |
| 12 | + expect(screen.getByText(/please enter the email address/i, { selector: 'h5' })).toBeInTheDocument(); |
| 13 | + }); |
| 14 | + |
| 15 | + it('renders the email input field', () => { |
| 16 | + render(<ResetPasswordForm />); |
| 17 | + expect(screen.getByPlaceholderText('Placeholder')).toBeInTheDocument(); |
| 18 | + }); |
| 19 | + |
| 20 | + it('renders the request reset link button', () => { |
| 21 | + render(<ResetPasswordForm />); |
| 22 | + expect(screen.getByRole('button', { name: 'Request reset link' })).toBeInTheDocument(); |
| 23 | + }); |
| 24 | + |
| 25 | + it('renders the back to login link', () => { |
| 26 | + render(<ResetPasswordForm />); |
| 27 | + const link = screen.getByRole('link', { name: 'Back to login' }); |
| 28 | + expect(link).toBeInTheDocument(); |
| 29 | + expect(link).toHaveAttribute('href', '#'); |
| 30 | + }); |
| 31 | +}); |
0 commit comments