44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
import { join } from "node:path";
|
|
import test from "node:test";
|
|
|
|
const auditsBoardPath = join(
|
|
process.cwd(),
|
|
"components",
|
|
"audits",
|
|
"audits-board.tsx",
|
|
);
|
|
|
|
test("AuditsBoard renders dashboard rows as responsive cards", async () => {
|
|
const source = await readFile(auditsBoardPath, "utf8");
|
|
|
|
assert.doesNotMatch(source, /min-w-\[/i);
|
|
assert.doesNotMatch(source, /overflow-x-auto/i);
|
|
assert.doesNotMatch(source, /grid-cols-\[minmax/i);
|
|
|
|
assert.match(source, /Card/);
|
|
assert.match(source, /CardHeader/);
|
|
assert.match(source, /CardTitle/);
|
|
assert.match(source, /CardContent/);
|
|
assert.match(source, /className="grid gap-3 sm:grid-cols-2 xl:grid-cols-3"/);
|
|
assert.match(source, /aria-labelledby=\{rowTitleId\}/);
|
|
assert.match(source, /id=\{rowTitleId\}/);
|
|
});
|
|
|
|
test("AuditsBoard keeps audit detail links and non-clickable pipeline cards", async () => {
|
|
const source = await readFile(auditsBoardPath, "utf8");
|
|
|
|
assert.match(source, /row\.kind === "audit"/);
|
|
assert.match(source, /href=\{row\.detailHref\}/);
|
|
assert.match(source, /Öffnen/);
|
|
assert.match(source, /row\.progress/);
|
|
assert.match(source, /progressbar/);
|
|
assert.match(source, /row\.retry/);
|
|
assert.match(source, /Versuch/);
|
|
assert.match(source, /Erneut starten/);
|
|
assert.match(source, /retryAuditRun/);
|
|
assert.match(source, /getGenerationStatusLabel\(row\)/);
|
|
assert.match(source, /row\.errorSummary/);
|
|
});
|