import { render, screen } from '@testing-library/react' import { describe, expect, it } from 'vitest' import ErrorPage from './ErrorPage' describe('ErrorPage', () => { it('renders default 404 content', () => { render() expect(screen.getByText('404')).toBeInTheDocument() expect(screen.getByRole('heading', { name: 'Page introuvable' })).toBeInTheDocument() }) it('renders a link back to the home page', () => { render() const link = screen.getByRole('link', { name: "Retour à l'accueil" }) expect(link).toHaveAttribute('href', '/') }) it('uses custom code, title and message when provided', () => { render() expect(screen.getByText('500')).toBeInTheDocument() expect(screen.getByRole('heading', { name: 'Erreur serveur' })).toBeInTheDocument() expect(screen.getByText('Une erreur est survenue.')).toBeInTheDocument() }) })