import { describe, expect, it } from "vitest"; import { readFileSync } from "node:fs"; import { resolve } from "node:path"; const readView = (relativePath: string) => readFileSync(resolve(__dirname, relativePath), "utf8"); const normalizeWhitespace = (source: string) => source.replace(/\s+/g, " ").trim(); describe("route view overlays are mounted only when visible", () => { it("gates high-risk admin and subject overlays behind visible flags", () => { const checks = [ { file: "./admin/ProjectMembers.vue", snippets: [' ({', ':style="getRollbackAxisLeftStyle(lane.x)"', ':style="getRollbackAxisLeftStyle(row.axisX)"', ], }, ]; for (const check of checks) { const source = normalizeWhitespace(readView(check.file)); for (const snippet of check.snippets) { expect(source, `${check.file} should include ${snippet}`).toContain(normalizeWhitespace(snippet)); } } }); });