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, /]+aria-labelledby=\{campaignTitleId\}/); assert.match(source, /id=\{campaignTitleId\}/); assert.match(source, /openEditDialog\(campaign\)/); assert.match(source, /toggleCampaign\(campaign\)/); assert.match(source, /runCampaign\(campaign\)/); }); test("campaign board surfaces recent run logs", async () => { const source = await readFile(campaignsBoardPath, "utf8"); assert.match(source, /api\.runs\.list/); assert.match(source, /type:\s*"campaign"/); assert.match(source, /Aktuelle Run-Logs/); assert.match(source, /run\.errorSummary/); assert.match(source, /campaign_cron_skipped/); });