refactor(forms): enable approved Form A placements by default

This commit is contained in:
DeCentN2Madness committed 2026-10-30 15:08:02 -07:00
1 parent 55adb79705
commit 95c5f229f5
41 files changed
+862 -523

No files matched your search

+10 -5
View File
@@ -58,9 +58,9 @@ test('four service configurations are bilingual without adding an Academy route'
for (const variants of Object.values(serviceInquiryCopy)) for (const copy of Object.values(variants)) {
assert.ok(copy.heading && copy.introduction); assert.ok(!copy.introduction.includes('—'));
}
const { formAConsultationTestPlacements } = await import('../src/utils/form-integration.ts');
assert.equal(formAConsultationTestPlacements.length, 9);
assert.ok(!formAConsultationTestPlacements.some((p) => p.route.includes('preparatory')));
const { formAIframePlacements } = await import('../src/utils/form-integration.ts');
assert.equal(formAIframePlacements.filter(p => p.context === 'consultation').length, 9);
assert.ok(!formAIframePlacements.some((p) => p.route.includes('preparatory')));
});
test('legacy independent crypto fixture and two-view separation round-trip', async () => {
const pass = randomBytes(32).toString('base64'), other = randomBytes(32).toString('base64');
@@ -108,9 +108,14 @@ test('portal input requires every local gate and rejects missing or malformed ci
const pass = randomBytes(24).toString('base64');
const streams = await Promise.all(['one','two'].map((id) => encryptPortalStream(id, '<p>Synthetic</p>', pass)));
const file = path.join(dir, 'fixture.json'); await fs.writeFile(file, JSON.stringify({ alg: portalAlgorithm, streams }), { mode: 0o600 });
const options = { approved: 'true', indexing: 'false', environment: 'isolated-test', file };
const options = { approved: 'true', indexing: 'false', file };
assert.ok(readPortalInput(options));
for (const changed of [{ approved: undefined }, { approved: 'false' }, { indexing: 'true' }, { indexing: undefined }, { environment: 'production' }, { file: '/missing-fixture' }]) assert.equal(readPortalInput({ ...options, ...changed }), undefined);
// Form modes cannot substitute for the independent private-input approval.
for (const mode of ['live', 'off', 'mock']) {
assert.ok(readPortalInput({ ...options, mode }));
assert.equal(readPortalInput({ indexing: 'false', file, mode }), undefined);
}
for (const changed of [{ approved: undefined }, { approved: 'false' }, { indexing: 'true' }, { indexing: undefined }, { file: '/missing-fixture' }]) assert.equal(readPortalInput({ ...options, ...changed }), undefined);
await fs.writeFile(file, '<h1>Not encrypted</h1>'); assert.equal(readPortalInput(options), undefined);
} finally { await fs.rm(dir, { recursive: true }); }
});