56 lines
3.7 KiB
JavaScript
56 lines
3.7 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
const workspace = readFileSync("src/features/campaigns/CampaignWorkspace.tsx", "utf8");
|
|
const overview = readFileSync("src/features/campaigns/CampaignOverviewPage.tsx", "utf8");
|
|
const campaignList = readFileSync("src/features/campaigns/CampaignListPage.tsx", "utf8");
|
|
const recipients = readFileSync("src/features/campaigns/RecipientDataPage.tsx", "utf8");
|
|
const fieldValueInput = readFileSync("src/features/campaigns/components/FieldValueInput.tsx", "utf8");
|
|
const mailSettings = readFileSync("src/features/campaigns/MailSettingsPage.tsx", "utf8");
|
|
const api = readFileSync("src/api/campaigns.ts", "utf8");
|
|
|
|
assert.match(workspace, /<CampaignOverviewPage settings=\{settings\} auth=\{auth\}/);
|
|
assert.match(overview, /hasScope\(auth, "campaigns:campaign:archive"\)/);
|
|
assert.match(overview, /getCampaignLifecyclePolicy/);
|
|
assert.match(overview, /pendingLifecycleAction/);
|
|
assert.match(overview, /archive_campaign_confirmation/);
|
|
assert.match(overview, /await archiveCampaign\(settings, campaign\.id, pending\.policy\.state_token\)/);
|
|
assert.match(overview, /await deleteCampaign\(settings, campaign\.id, pending\.policy\.state_token\)/);
|
|
assert.match(overview, /await copyCampaign\(settings, campaign\.id, pending\.version\.id, pending\.policy\.state_token, copyOptions\)/);
|
|
assert.match(overview, /include_recipients/);
|
|
assert.match(overview, /include_files/);
|
|
assert.match(overview, /include_shares/);
|
|
assert.match(overview, /include_policies/);
|
|
assert.match(overview, /include_mail_profile/);
|
|
assert.match(overview, /delivery_mode: "manual"/);
|
|
assert.match(overview, /Autonomous approved delivery/);
|
|
assert.match(overview, /campaigns:campaign:send/);
|
|
assert.match(overview, /mail:profile:use/);
|
|
assert.match(overview, /schedule\.last_outcome/);
|
|
assert.match(overview, /schedule\.last_recovery_state/);
|
|
assert.match(overview, /Unknown outcomes pause the schedule and are never retried automatically/);
|
|
assert.match(overview, /Delivery jobs, outcomes, locks, reports, and audit evidence are never copied/);
|
|
assert.match(overview, /defaultExportScopes: CampaignTransferScope\[\] = \["metadata", "template_config"\]/);
|
|
assert.match(overview, /hasScope\(auth, "campaigns:campaign:export"\)/);
|
|
assert.match(overview, /await exportCampaignPackage/);
|
|
assert.match(overview, /credentials, or transport secrets/);
|
|
assert.match(overview, /await archiveCampaignVersion\(settings, campaign\.id, pending\.version\.id, pending\.policy\.state_token\)/);
|
|
assert.match(api, /\/api\/v1\/campaigns\/\$\{campaignId\}\/archive/);
|
|
assert.match(api, /\/api\/v1\/campaigns\/\$\{campaignId\}\/copies/);
|
|
assert.match(api, /\/api\/v1\/campaigns\/\$\{campaignId\}\/lifecycle-policy/);
|
|
assert.match(api, /\/api\/v1\/campaign-transfers\/imports\/preview/);
|
|
assert.match(api, /expected_package_sha256/);
|
|
assert.match(campaignList, /hasScope\(auth, "campaigns:campaign:import"\)/);
|
|
assert.match(campaignList, /setImportPreviewStale\(true\)/);
|
|
assert.match(campaignList, /Historical review, approval, and delivery evidence is shown in the preview but never replayed as live state/);
|
|
assert.match(campaignList, /expected_package_sha256: importPreview\.package_sha256/);
|
|
assert.match(recipients, /requestBulkActivation\(true\)/);
|
|
assert.match(recipients, /requestBulkActivation\(false\)/);
|
|
assert.match(recipients, /const count = inlineEntries\.filter/);
|
|
assert.match(recipients, /<ConfirmDialog[\s\S]*bulkActivation/);
|
|
assert.match(recipients, /replaceInlineEntries\(inlineEntries\.map/);
|
|
assert.match(fieldValueInput, /<PasswordField[\s\S]*generator[\s\S]*autoComplete="new-password"/);
|
|
assert.match(mailSettings, /disabled=\{credentialSaving\} generator autoComplete="new-password"/);
|
|
|
|
console.log("Campaign lifecycle UI structural contract passed.");
|