select icon indicating copy to clipboard operation
select copied to clipboard

Cannot open select panel from jest and react testing library

Open DawnMD opened this issue 3 years ago • 2 comments

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

DawnMD avatar Dec 07 '22 11:12 DawnMD

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 avatar Oct 24 '23 09:10 raDiesle

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

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

raDiesle avatar Oct 24 '23 10:10 raDiesle