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>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
import fc from 'fast-check';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { anyEmail, validEmail } from '../test/arbitraries';
|
||||
import { emailAddress } from './emailAddress';
|
||||
|
||||
describe('emailAddress', () => {
|
||||
it('voegt geldige delen samen', () => {
|
||||
expect(emailAddress({ user: 'info', domain: 'andreaslop.nl' })).toBe(
|
||||
'info@andreaslop.nl',
|
||||
);
|
||||
});
|
||||
|
||||
it('geeft null bij ongeldige delen', () => {
|
||||
for (const parts of [
|
||||
{ user: '', domain: 'andreaslop.nl' },
|
||||
{ user: 'info', domain: '' },
|
||||
{ user: 'in fo', domain: 'andreaslop.nl' },
|
||||
{ user: 'info@x', domain: 'andreaslop.nl' },
|
||||
{ user: 'info', domain: 'andreaslop' },
|
||||
{ user: 'info', domain: 'andrea@slop.nl' },
|
||||
]) {
|
||||
expect(emailAddress(parts)).toBeNull();
|
||||
}
|
||||
});
|
||||
|
||||
it('splitsen bij @ geeft de delen terug (round-trip)', () => {
|
||||
fc.assert(
|
||||
fc.property(validEmail, (parts) => {
|
||||
const address = emailAddress(parts);
|
||||
expect(address).not.toBeNull();
|
||||
const [user, domain] = address!.split('@');
|
||||
expect({ user, domain }).toEqual(parts);
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('is null of bevat precies één @ en geen witruimte (invariant)', () => {
|
||||
fc.assert(
|
||||
fc.property(anyEmail, (parts) => {
|
||||
const address = emailAddress(parts);
|
||||
return (
|
||||
address === null ||
|
||||
(address.split('@').length === 2 && !/\s/.test(address))
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user