fix(qa): verify private investor continuity across dossiers

This commit is contained in:
2026-11-20 19:20:03 +02:00
parent e299afdae4
commit 15e15d0bfd
13 changed files with 563 additions and 16 deletions
@@ -237,6 +237,7 @@ void test('contradictory record criteria remain explicit until the user chooses
sector: '8',
state: 'closed',
certainty: 'documented',
need: 'investment',
},
{ kind: ['Combinação incompatível.'] },
);
@@ -269,6 +270,51 @@ void test('contradictory record criteria remain explicit until the user chooses
);
});
void test('search needs both location and purpose; Enter and missing criteria cannot submit', () => {
for (const filters of [
{},
{ need: 'investment' },
{ province_id: 'province-qa' },
]) {
const h = harness(filters);
const submit = nodes(h.tree()).find(
(n) => n.type === 'button' && text(n) === 'Pesquisar',
);
assert.equal(submit.props.disabled, true);
nodes(h.tree())
.find((n) => n.type === 'form')
.props.onSubmit({ preventDefault() {} });
assert.equal(h.submitted(), undefined);
assert.match(
text(h.tree()),
/Escolha a localização a pesquisar e a necessidade/,
);
}
for (const location of [
{ province_id: 'province-qa' },
{ territory: 'district-qa' },
]) {
const h = harness({
...location,
need: 'investment',
context: 'dossier-qa',
opportunity: 'opportunity-qa',
});
assert.equal(
nodes(h.tree()).find(
(n) => n.type === 'button' && text(n) === 'Pesquisar',
).props.disabled,
false,
);
nodes(h.tree())
.find((n) => n.type === 'form')
.props.onSubmit({ preventDefault() {} });
assert.equal(h.submitted().data.need, 'investment');
assert.equal(h.submitted().data.context, 'dossier-qa');
assert.equal(h.submitted().data.opportunity, 'opportunity-qa');
}
});
void test('local search defaults to documented presence and keeps the explicit unknown option and chosen territory', () => {
const h = harness({ territory: 'district-qa', sector: '7' });
h.select('Localização a pesquisar').props.onChange({