Files
Jyotisha/frontend/tests/icon-motion-audit.test.ts
T

20 lines
1.0 KiB
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
const starterHome = readFileSync(new URL("../src/components/starter-home.tsx", import.meta.url), "utf8");
const css = readFileSync(new URL("../src/app/globals.css", import.meta.url), "utf8");
test("the 2026-09-22 icon audit keeps the existing entry icons and adds no loop", () => {
assert.match(starterHome, /import \{ Clock3, Sparkles \} from "lucide-react"/);
assert.match(starterHome, /<Sparkles aria-hidden="true" \/>/);
assert.match(starterHome, /<Clock3 aria-hidden="true" \/>/);
assert.doesNotMatch(starterHome, /Moon|MoonStar|thinking-orbs/);
const blockStart = css.indexOf(".starter-entry {");
const blockEnd = css.indexOf(".starter-entry > svg");
const block = css.slice(blockStart, blockEnd);
assert.doesNotMatch(block, /animation:/);
assert.doesNotMatch(css, /thinking-orbs/);
assert.match(css, /@media \(prefers-reduced-motion:\s*reduce\)[\s\S]*transition-duration:\s*\.01ms !important/);
});