JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.63k stars 4.13k forks source link

Test react-select cannot trigger selection event #4181

Closed gsstar9028 closed 2 years ago

gsstar9028 commented 4 years ago

Created a wrapper component (MultiSelect) that essentially returns a ReactSelect from react-select. Using React Testing Library to test it, I could trigger a focus event on the option I am selecting but couldn't trigger a selection.

codesandbox: https://codesandbox.io/s/react-select-test-ni125?file=/src/__tests__/WrappedSelect.test.js:137-141

ebonow commented 4 years ago

Greetings,

I'd be happy to help and work through it. Would you be so kind as to set up a codesandbox with the test cases so that it would be easier to work through?

gsstar9028 commented 4 years ago

added codesandbox link trying to make options show up

sabinasiddiqi commented 4 years ago

+1

singleseeker commented 3 years ago

+1

singleseeker commented 3 years ago

@ebonow show time~!

GeniaT commented 3 years ago

That issue is also happening on <Select /> if I am not mistaken. I can assert the dropdown is opened on ArrowDown but can't select an option from it.

ebonow commented 3 years ago

Just wanted to follow up.

I have had an opportunity since first replying to this to view and add more tests to the react-select library, but seem to be running into some issues with this implementation for some reason.

There are plenty of examples here: https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/__tests__/Select.test.js which may help. I'll continue to keep looking at this and trying to figure out why this particular implementation isn't compiling or working with the provided example.

dcousens commented 2 years ago

Marking this as stale for now, please open a pull request if you have a resolution and the problem is on behalf of react-select