33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import { readFileSync } from "node:fs";
|
|
|
|
const source = [
|
|
"../src/features/campaigns/RecipientDataPage.tsx",
|
|
"../src/features/campaigns/recipients/RecipientAddressEditor.tsx",
|
|
"../src/features/campaigns/recipients/recipientProfileColumns.tsx"
|
|
]
|
|
.map((path) => readFileSync(new URL(path, import.meta.url), "utf8"))
|
|
.join("\n")
|
|
.replace(/\s+/g, " ");
|
|
|
|
function assertIncludes(fragment, message) {
|
|
if (!source.includes(fragment.replace(/\s+/g, " "))) throw new Error(message);
|
|
}
|
|
|
|
for (const field of ["from", "reply_to", "to", "cc", "bcc"]) {
|
|
assertIncludes(`key: "${field}"`, `recipient search must retain the ${field} address category`);
|
|
}
|
|
assertIncludes(
|
|
"recipientAddressOverlayColumns. flatMap((column) => getEntryAddresses(entry, column.key))",
|
|
"recipient filtering must search every configured address category"
|
|
);
|
|
assertIncludes(
|
|
"onQueryChange={setRecipientProfilesQuery}",
|
|
"the recipient page must observe the shared DataGrid filter"
|
|
);
|
|
assertIncludes(
|
|
"Matched in {hiddenMatch.label}: {hiddenMatch.address}",
|
|
"a row must explain when its match came from a hidden address"
|
|
);
|
|
|
|
console.log("Campaign recipient search covers and explains hidden address matches.");
|