import { render, screen } from '@testing-library/react'; import { describe, expect, it } from 'vitest'; import { ApiProblemError } from '../../src/apiClient'; import { RouteErrorBoundary } from '../../src/RouteErrorBoundary'; function BrokenRoute(): never { throw new ApiProblemError(500, { title: 'Fout' }, 'corr-route-7'); } describe('RouteErrorBoundary', () => { it('keeps the shell alive and exposes correlation context', () => { render(<>); expect(screen.getByRole('navigation', { name: 'Applicatieshell' })).toBeInTheDocument(); expect(screen.getByRole('heading', { name: 'Deze pagina kon niet worden weergegeven' })).toBeInTheDocument(); expect(screen.getByText(/corr-route-7/)).toBeInTheDocument(); }); });