react-component / select

React Select
https://select.react-component.now.sh/
MIT License
894 stars 453 forks source link

Cannot open select panel from jest and react testing library #886

Open DawnMD opened 1 year ago

DawnMD commented 1 year ago

I'm trying to render a selection input where initially nothing will be selected and on the click of the input it will show all the available values. image Select is the Select from the package whereas SelectOption is Option. When rendered via react testing library and clicked on the input, the selection list is not generated but works flawlessly in the UI image

Form library: Formik

raDiesle commented 8 months ago

same problem.

Actual problem is that all the time the popup container is not there at all in html, before and after open click. getPopupContainer={(node): HTMLElement => { return node.parentNode; }}

e.g. <div id="mypopup" /> without any classes attached

raDiesle commented 8 months ago

This helped me from https://github.com/react-component/select/issues/563:

await act(async () => { await fireEvent.mouseDown(screen.getByRole('combobox')); });