feat: build audit outreach review workspace
This commit is contained in:
30
tests/dashboard-prefetch.test.ts
Normal file
30
tests/dashboard-prefetch.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import test from "node:test";
|
||||
|
||||
test("dashboard sidebar links do not prefetch protected routes", async () => {
|
||||
const source = await readFile(
|
||||
join(process.cwd(), "components", "dashboard-sidebar.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const linkMatch = source.match(/<Link[\s\S]*?href=\{item\.href\}[\s\S]*?>/);
|
||||
|
||||
assert.ok(linkMatch, "Dashboard sidebar should render dashboard nav Links.");
|
||||
assert.match(linkMatch[0], /prefetch=\{false\}/);
|
||||
});
|
||||
|
||||
test("lead funnel card action links do not fan out prefetches", async () => {
|
||||
const source = await readFile(
|
||||
join(process.cwd(), "components", "lead-funnel-board.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const actionLinkMatch = source.match(
|
||||
/<Link[\s\S]*?href=\{stageActionHref\[card\.stageId\]\}[\s\S]*?>/,
|
||||
);
|
||||
|
||||
assert.ok(actionLinkMatch, "Lead funnel cards should link to stage actions.");
|
||||
assert.match(actionLinkMatch[0], /prefetch=\{false\}/);
|
||||
});
|
||||
Reference in New Issue
Block a user