diff --git a/src/openforms/js/components/admin/form_design/variables/VariablesEditor.stories.js b/src/openforms/js/components/admin/form_design/variables/VariablesEditor.stories.js index eee6b85c2a..c0145c0aa4 100644 --- a/src/openforms/js/components/admin/form_design/variables/VariablesEditor.stories.js +++ b/src/openforms/js/components/admin/form_design/variables/VariablesEditor.stories.js @@ -695,22 +695,24 @@ export const ConfigurePrefillObjectsAPIWithCopyButton = { expect(copyButton).toBeVisible(); await userEvent.click(copyButton); - // Wait until the API call to retrieve the prefillAttributes is done + const modalForm = await screen.findByTestId('modal-form'); + expect(modalForm).toBeVisible(); await waitFor(async () => { - const apiGroup = await modal.findByLabelText('API-groep'); - expect(apiGroup).toHaveValue(1); - - const objecttype = modal.getByRole('input', {name: 'prefillOptions.objecttypeUuid'}); - expect(objecttype).toHaveValue('2c77babf-a967-4057-9969-0200320d23f1'); - - const version = await modal.findByLabelText('Versie'); - expect(version).toHaveValue('2'); + expect(modalForm).toHaveFormValues({ + 'prefillOptions.objectsApiGroup': '1', + 'prefillOptions.objecttypeUuid': '2c77babf-a967-4057-9969-0200320d23f1', + 'prefillOptions.objecttypeVersion': '2', + }); + }); + // Wait until the API call to retrieve the prefillAttributes is done + await waitFor(async () => { const prefillPropertySelect = await screen.findByLabelText( 'Selecteer een attribuut uit het objecttype' ); expect(prefillPropertySelect).toBeVisible(); - expect(prefillPropertySelect).toHaveValue(serializeValue(['height'])); + expect(prefillPropertySelect.options[1]).toHaveValue(serializeValue(['height'])); + expect(prefillPropertySelect.options[2]).toHaveValue(serializeValue(['species'])); }); }); },