feat: convert campaign and lead views to cards
This commit is contained in:
30
tests/campaigns-board-layout.test.ts
Normal file
30
tests/campaigns-board-layout.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";
|
||||
|
||||
const campaignsBoardPath = join(
|
||||
process.cwd(),
|
||||
"components",
|
||||
"campaigns",
|
||||
"campaigns-board.tsx",
|
||||
);
|
||||
|
||||
test("campaign board renders campaigns as responsive cards", async () => {
|
||||
const source = await readFile(campaignsBoardPath, "utf8");
|
||||
|
||||
assert.doesNotMatch(source, /<table\b/i);
|
||||
assert.doesNotMatch(source, /<thead\b/i);
|
||||
assert.doesNotMatch(source, /<tbody\b/i);
|
||||
assert.doesNotMatch(source, /<tr\b/i);
|
||||
assert.doesNotMatch(source, /<td\b/i);
|
||||
assert.doesNotMatch(source, /<th\b/i);
|
||||
|
||||
assert.doesNotMatch(source, /md:hidden/i);
|
||||
assert.doesNotMatch(source, /md:block/i);
|
||||
|
||||
assert.match(source, /className="grid gap-3"/);
|
||||
assert.match(source, /openEditDialog\(campaign\)/);
|
||||
assert.match(source, /toggleCampaign\(campaign\)/);
|
||||
assert.match(source, /runCampaign\(campaign\)/);
|
||||
});
|
||||
Reference in New Issue
Block a user