-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to fire user-events with @testing-library/react library inside of resizable panel #367
Comments
Open to reviewing a PR if you'd like to suggest a fix! |
I faced similar issue. After initial investigation looks like the root cause is user-event library bug |
I ran into this issue as well. After some investigating I found that a certain event.preventDefault() is most likely the culprit. After commenting the culprit the tests that use Not sure how to go about fixing this, as I'm not sure what side-effects removing this line would have. Any feedback is welcome. |
I don’t know what scenario you saw this issue with but in the situation I looked at above, the tests seemed to be the problem. I don’t remember why I added that call to preventDefault. (It’s been a while.) I assume I had a good reason. |
I'll try to get a reproduction when I have time later on but when running my tests I don't see a failure with I have multiple cases where the |
Did you read my comment above? #367 (comment) I start off by mentioning an idea related to styles for why that might be happening |
Fair enough, sorry about that 😞 i swear I read it 🙈 but my brain must have forgotten about it. I'll try and work out if that could be the case! Thanks for the feedback/reply! |
No problem. I do that sometimes too. Let me know what you find |
Hey, thanks for putting all this work into this library. It is really great!
What issue have I encountered
When using @testing-library/react inside of a component that lives inside of
<ResizablePanelGroup />
, I'm unable to dispatch events with the@testing-library/user-event
library. This does not seem to be an issue with testing library nor any other dependency.I suspect that somewhere dom nodes are remounted in an unforeseen way. By the time we want to dispatch an event the reference to the dom node is invalid. Strangely, events dispatched with
fireEvent
work.How to reproduce?
I've created a repo for reproduction. The important part is the test file
resizable-layout.test.tsx
.Steps for reproduction
pnpm i
pnpm run test
What is the impact?
React testing library is a popular way of testing react applications and
user-event
is the recommended way working with events. Currently any component inside of a resizable area cannot dispatch user events.The text was updated successfully, but these errors were encountered: