fix: complete executive narrative exports and deduplicate company questionnaire in QA

This commit is contained in:
2026-11-21 20:45:25 +02:00
parent f5dbd55dfb
commit c144425e77
26 changed files with 875 additions and 36 deletions
@@ -333,3 +333,47 @@ await test('successful save recovers the saved dossier edition and history links
assert.match(html, /dossier-a\/forma-juridica\?revision=event-a/);
assert.match(html, /dossier-a\/forma-juridica\?history_before=100/);
});
await test('C07 keeps one eight-theme questionnaire and one introductory phrase without repeating the pending questions', () => {
const h = harness();
const intro =
'Compare alternativas para discutir a constitui\u00e7\u00e3o; n\u00e3o existe uma forma universalmente prefer\u00edvel.';
const keys = [
'purpose',
'participants',
'participation',
'capital',
'management',
'responsibility',
'listing',
'regulated',
];
const full = Object.fromEntries(
keys.map((key) => [
key,
{
label: 'SYNTHETIC question ' + key,
options: { unknown: 'Por esclarecer' },
},
]),
);
const html = renderToStaticMarkup(
h.render({
definition: { version: 'v1', questions: full },
answers: Object.fromEntries(keys.map((key) => [key, 'unknown'])),
result: {
...props.result,
questions: full,
pending: keys,
route: intro,
},
}),
);
assert.equal(html.split(intro).length - 1, 1);
assert.equal((html.match(/<form\b/g) || []).length, 1);
for (const key of keys)
assert.equal(html.split('name="answers[' + key + ']"').length - 1, 1);
assert.ok(
html.replace(/<[^>]*>/g, '').includes('H\u00e1 8 temas por esclarecer'),
);
assert.doesNotMatch(html, /Por esclarecer:/);
});