Reproduction example
https://codesandbox.io/s/pedantic-robinson-cchucu?file=/src/App.js
Prerequisites
- Render a form with submit button using the
Form component from "@open-tech-world/react-form".
- Render a select element using the
SelectField from "@open-tech-world/react-form".
- Add some
options to the select and add multiple attribute.
- Select options using
userEvent.selectOptions.
- Fire click event to the
submit button.
- Check the form values returned from the
Form onSubmit handler.
Expected behavior
The userEvent.selectOptions should select multiple options using the provided string array of the values parameter.
Actual behavior
The userEvent.selectOptions selects only the last option from the given string array of the values parameter, even if the multiple attribute is set.
User-event version
14.1.1
Environment
Testing Library framework: @testing-library/[email protected]
JS framework: [email protected]
Test environment: [email protected]
DOM implementation: @testing-library/[email protected]
Additional context
No response
Reproduction example
https://codesandbox.io/s/pedantic-robinson-cchucu?file=/src/App.js
Prerequisites
Formcomponent from "@open-tech-world/react-form".SelectFieldfrom "@open-tech-world/react-form".optionsto the select and addmultipleattribute.userEvent.selectOptions.submitbutton.FormonSubmithandler.Expected behavior
The
userEvent.selectOptionsshould select multiple options using the provided string array of the values parameter.Actual behavior
The
userEvent.selectOptionsselects only the last option from the given string array of the values parameter, even if themultipleattribute is set.User-event version
14.1.1
Environment
Testing Library framework:
@testing-library/[email protected]JS framework:
[email protected]Test environment:
[email protected]DOM implementation:
@testing-library/[email protected]Additional context
No response