You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await act(async () => {
// assert option not selected yet
expect(screen.queryByLabelText("Remove Dr Jimmy Carter")).toBe(null)
// open the dropdown
const selectDropdown = screen.getAllByRole("combobox")[0]
await userEvent.click(selectDropdown)
await screen.findByText("Pear")
// all of the below fail (I don't run at the same time, but individually they all seem to close the dropdown)
await userEvent.type(selectDropdown, "{enter}")
await userEvent.selectOptions(selectDropdown, ["Pear"])
await userEvent.keyboard("{enter}")
await screen.findByLabelText("Remove Pear")
screen.debug()
})
Expected behavior
I would expect the dropdown to not close
Actual behavior
The dropdown is closing after selecting an option, despite this not happening in the browser
User-event version
14.5.2
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response
The text was updated successfully, but these errors were encountered:
In testing environment this doesn't throw error (depends on the device though) document.createEvent("TouchEvent");
but in browser it does
Not sure if there is a way to disable the TouchEvents in testing environment
Reproduction example
https://codesandbox.io/p/devbox/6fqmnl?file=%2Fpackage.json%3A25%2C18
Prerequisites
React Select. This is fine in the browser btw
My test
Expected behavior
I would expect the dropdown to not close
Actual behavior
The dropdown is closing after selecting an option, despite this not happening in the browser
User-event version
14.5.2
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response
The text was updated successfully, but these errors were encountered: