Entrega dashboard e correccoes transversais preservando Ofertas instalado
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user