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",
);
const globalsPath = join(process.cwd(), "app", "globals.css");
test("campaign board renders campaigns as a desktop ledger with mobile records", async () => {
const source = await readFile(campaignsBoardPath, "utf8");
assert.doesNotMatch(source, /
{
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, /campaign-status-rail/);
assert.match(source, /Versand nur nach Freigabe/);
assert.match(source, /getRunStatusClassName/);
assert.match(source, /getRunStepClassName/);
assert.match(source, /run\.errorSummary/);
assert.match(source, /campaign_cron_skipped/);
});
test("campaign ledger avoids clipping actions at desktop breakpoints", async () => {
const styles = await readFile(globalsPath, "utf8");
assert.match(styles, /\.campaign-ledger\s*{[\s\S]*overflow-x:\s*auto;/);
assert.doesNotMatch(styles, /\.campaign-ledger\s*{[\s\S]*overflow:\s*hidden;/);
assert.match(styles, /\.campaign-ledger-row\s*{[\s\S]*min-width:\s*58rem;/);
});