Adds the footer, back-to-top button, skip link, placeholder routes, 404 and error pages inside the shell, plus per-page SEO from a single page registry (canonical URLs, Open Graph image, JSON-LD, generated sitemap.xml and robots.txt). Theme tokens and recipes replace repeated styling, the hero loads only the active and neighbouring slides, and the e-mail address is joined in the browser to keep it out of the HTML and bundle. Adds Vitest with property-based (fast-check) and axe tests, ESLint, security headers for dev and preview, Lighthouse CI and a `pnpm check` script that runs all quality gates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { screen } from '@testing-library/react';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { axeResults } from '@/test/axe';
|
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
|
import AppShell from './AppShell';
|
|
|
|
describe('AppShell', () => {
|
|
it('heeft de landmarks van de shell', async () => {
|
|
const { container } = await renderWithProviders(<AppShell />);
|
|
expect(screen.getByRole('banner')).toBeInTheDocument();
|
|
expect(screen.getByRole('main')).toHaveAttribute('id', 'main');
|
|
expect(screen.getByRole('contentinfo')).toBeInTheDocument();
|
|
expect(
|
|
screen.getByRole('navigation', { name: 'Hoofdmenu' }),
|
|
).toBeInTheDocument();
|
|
expect(
|
|
screen.getByRole('navigation', { name: 'Footermenu' }),
|
|
).toBeInTheDocument();
|
|
expect(await axeResults(container)).toHaveNoViolations();
|
|
});
|
|
|
|
it('begint met een skip link naar de inhoud', async () => {
|
|
const { container } = await renderWithProviders(<AppShell />);
|
|
const skip = screen.getByRole('link', {
|
|
name: 'Direct naar de inhoud',
|
|
});
|
|
expect(skip).toHaveAttribute('href', '#main');
|
|
// Eerste focusbare element van de pagina
|
|
expect(container.querySelector('a, button')).toBe(skip);
|
|
expect(screen.getByRole('main')).toHaveAttribute('tabindex', '-1');
|
|
});
|
|
});
|