Files
govoplan-campaign/webui/tests/operator-queue-ui-structure.test.mjs

19 lines
881 B
JavaScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const here = dirname(fileURLToPath(import.meta.url));
const source = readFileSync(resolve(here, "../src/features/operator/OperatorQueuePage.tsx"), "utf8");
assert.match(source, /<DataGrid/);
assert.match(source, /<TableActionGroup actions=/);
for (const action of ["details", "pause", "resume", "retry", "queue-unsent", "reconcile", "cancel"]) {
assert.match(source, new RegExp(`id: "${action}"`));
}
assert.match(source, /useDeltaWatermarks/);
assert.match(source, /window\.setInterval[\s\S]*10_000/);
assert.match(source, /<ConfirmDialog[\s\S]*cancelTarget/);
assert.doesNotMatch(source, /claim_token|eml_local_path|storage_key|smtp_transport_revision/);
assert.doesNotMatch(source, /window\.alert\s*\(/);