Entrega dashboard e correccoes transversais preservando Ofertas instalado
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-15 18:56:39 +02:00
parent 1349789226
commit fb076c174f
117 changed files with 10380 additions and 1905 deletions
@@ -212,6 +212,15 @@ export function harness(initial = props()) {
mocks['@/lib/investment-profile-editor'] = load(
'resources/js/lib/investment-profile-editor.ts',
);
mocks['@/lib/catalogue-choice'] = load(
'resources/js/lib/catalogue-choice.ts',
);
mocks['./territory-search-select'] = load(
'resources/js/components/territory-search-select.tsx',
);
mocks['./catalogue-choice-select'] = load(
'resources/js/components/catalogue-choice-select.tsx',
);
mocks['./country-select'] = load(
'resources/js/components/country-select.tsx',
);
@@ -324,17 +333,36 @@ export function harness(initial = props()) {
return nodes(formLabel ? this.form(formLabel) : tree).find(
(n) =>
['input', 'textarea', 'select'].includes(n.type) &&
n.props['aria-label'] === label,
(n.props['aria-label'] === label ||
(n.props.role === 'combobox' &&
n.props['aria-label'] === 'Pesquisar ' + label)),
);
},
value(label, formLabel) {
return this.field(label, formLabel)?.props.value;
const field = this.field(label, formLabel);
// The public control shows the readable label; domain assertions use its ISO code.
return field?.props.role === 'combobox'
? (field.props.value.match(/— ([A-Z]{2})$/)?.[1] ??
field.props.value)
: field?.props.value;
},
change(label, value, formLabel) {
const field = this.field(label, formLabel);
if (!field) throw Error('Missing field ' + label);
field.props.onChange({ target: { value } });
render();
if (field.props.role === 'combobox') {
const option = nodes(
formLabel ? this.form(formLabel) : tree,
).find(
(node) =>
node.props?.role === 'option' &&
text(node).endsWith('— ' + value),
);
if (!option) throw Error('Missing selectable country ' + value);
option.props.onClick();
render();
}
},
button(label, formLabel) {
return nodes(formLabel ? this.form(formLabel) : tree).find(