block — warm paper, a serif headline, 3px * corners, its own scale of greys — written before the tokens existed. A * visitor who clicked "Anmelden" left one company and arrived at another. * * These tests are about drift, not about looks. Nothing stops someone pasting a * hex value into a marketing page at four in the afternoon; what stops it * becoming a second design system is noticing on the first one. */ /** Public pages that must draw from the shared stylesheet. */ function sitePages(): array { return [ 'landing.blade.php', 'legal.blade.php', 'status.blade.php', 'components/layouts/site.blade.php', ]; } it('builds the public site from the shared tokens, not from its own palette', function (string $page) { $source = File::get(resource_path('views/'.$page)); // Hex literals are the tell. One is a paste; a dozen is a second design // system growing quietly beside the first. preg_match_all('/#[0-9a-fA-F]{3,8}\b/', $source, $found); expect($found[0])->toBeEmpty() // The old page set its own type stack. The token file owns that now, // and a serif headline is precisely the impression the redesign // removed — every page read as a document. ->and($source)->not->toContain('font-family') ->and($source)->not->toContain('Georgia') ->and($source)->not->toContain('font-serif'); })->with(sitePages()); it('serves the website from the same stylesheet as the portal', function () { // Not "a stylesheet exists" — the SAME one. Two builds would drift the // moment a token changed in one of them. $layout = File::get(resource_path('views/components/layouts/site.blade.php')); expect($layout)->toContain('toContain("@vite(['resources/css/app.css'"); }); it('keeps the deliberately self-contained page self-contained', function () { // The exception, named rather than forgotten. coming-soon is shown when the // application may not be able to serve a built stylesheet at all — mid // deploy, or freshly installed — and @vite would throw where the whole // point is to render something reassuring. // // The status page used to be on this list on the same theory and does not // belong: if the stylesheet cannot be served, the application serving the // status page is already failing, and mid-deployment every route answers // with the maintenance page. What the exemption actually bought was a third // design nobody maintained. $source = File::get(resource_path('views/coming-soon.blade.php')); // The CALL, not the word: the file explains in a comment why it does not // use @vite, and a plain substring match reads that explanation as the // offence it warns about. expect($source)->not->toMatch('/@vite\s*\(/') ->and($source)->toContain('