fix: complete executive narrative exports and deduplicate company questionnaire in QA
This commit is contained in:
@@ -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:/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user