6 files, none of them ceremony. Four pin rules that actually broke while this was built — the list below names each bug — and two hold the page to its central claim: the app on it is real, and the journey list is the registry it navigates by. This is where design intent stops being a preference and starts being enforced.
it("no text colour drops below AA", () => {
for (const { fg, bg, role } of CONTRAST) {
const r = ratio(token(fg), token(bg));
expect(r, role).toBeGreaterThanOrEqual(4.5);
}
});In plain language
This walks every colour the product puts text in, works out how much it stands out from the surface behind it, and fails the build if any pair is below the accessibility threshold of 4.5.
It reads the colours from the stylesheet rather than a copy. If someone lightens a grey next year to make it feel quieter, this test goes red before the change reaches anyone who has trouble reading it.
contrast.test.jsRecomputes every colour pair from the live token values in alba.css, then sweeps the whole stylesheet for any rule setting text on its own background — written after all three status pills shipped under AA on a wash of their own hue.
spacing.test.jsThe spacing scale stays on the 4px grid, and the tokens SPACING.md documents are the tokens that exist — its first run caught the doc naming a token that was never declared.
screens.test.jsEvery deep link resolves, and the journey list on this page is exactly the registry the app navigates by — the same object, so they cannot drift.
stats.test.jsEvery number printed on this page, checked against the file it describes. It has already corrected this page's own test count more than once.
case-study.test.jsxThe page renders, mounts the real app inline — no iframe, no screenshot — and is never sitting on a splash screen on a cold load.
collisions.test.jsNo class name on this page collides with one in the product's stylesheet — written after a shared name flung ten swatches into the corner of the page.