Files
AndreaSlopFotografie/web/src/lib/copyrightLine.test.ts
T
SluijsensandClaude Opus 5.5 4d6408b607 Completes the front-end shell with footer, status pages and SEO
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>
2026-10-18 17:05:02 +02:00

31 lines
997 B
TypeScript

import fc from 'fast-check';
import { describe, expect, it } from 'vitest';
import { copyrightLine } from './copyrightLine';
describe('copyrightLine', () => {
it('heeft de vaste vorm', () => {
expect(copyrightLine(2026)).toBe('© 2026 Andrea Slop Fotografie');
});
it('het jaartal is er weer uit te halen (round-trip)', () => {
fc.assert(
fc.property(fc.integer({ min: 0, max: 9999 }), (year) => {
const match = copyrightLine(year).match(/^© (\d+) /);
return match !== null && Number(match[1]) === year;
}),
);
});
it('begint met © en eindigt met de bedrijfsnaam (invariant)', () => {
fc.assert(
fc.property(fc.integer(), (year) => {
const line = copyrightLine(year);
return (
line.startsWith('©') &&
line.endsWith('Andrea Slop Fotografie')
);
}),
);
});
});