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 guidance = readFileSync(resolve(here, "../src/features/campaigns/review/ReviewWorkflowGuidance.tsx"), "utf8"); const page = readFileSync(resolve(here, "../src/features/campaigns/ReviewSendPage.tsx"), "utf8"); const attachmentsPage = readFileSync(resolve(here, "../src/features/campaigns/AttachmentsDataPage.tsx"), "utf8"); const mailPage = readFileSync(resolve(here, "../src/features/campaigns/MailSettingsPage.tsx"), "utf8"); const migrationNotice = readFileSync(resolve(here, "../src/features/campaigns/components/LegacyMailMigrationNotice.tsx"), "utf8"); const draftEditor = readFileSync(resolve(here, "../src/features/campaigns/hooks/useCampaignDraftEditor.ts"), "utf8"); assert.match(guidance, /]+label="i18n:govoplan-campaign\.remaining\.cc632b5e"/); assert.match(page, /showBuiltDetails\(\{ messageState: 'list:\["needs_review"\]' \}\)/); assert.doesNotMatch(page, /showAllReviewJobs|visibleValidationIssues|attachmentReuseFindings\.slice\(0, 10\)/); assert.match(page, /`)); } for (const allowance of ["none", "same_recipient", "same_message"]) { assert.match(attachmentsPage, new RegExp(`