Having trouble getting my options with fireEvent
See original GitHub issueI have a very specific use case where I am needing an event to reach my code. When I do the following
fireEvent.pointerDown(domElement, {
button: MouseButton.Primary,
clientX: 5,
clientY: 5,
});
I receive the event but event.button, clientX and clientY are all undefined. Am I making a stupid mistake?
------------ 👆 Click “Preview”!
Issues on GitHub are intended to be related to problems with the library itself and feature requests so we recommend not using this medium to ask them here 😁.
❓ Support Forums
- Discord https://discord.gg/testing-library
- Stack Overflow https://stackoverflow.com/questions/tagged/react-testing-library
ISSUES WHICH ARE QUESTIONS WILL BE CLOSED
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Considerations for fireEvent | Testing Library
Based on the Guiding Principles, your test should resemble how users interact with your code (component, page, etc.) as much as possible. With ......
Read more >react-testing-library - fireEvent.select() not working
The component I am testing has a dropdown menu that is only exposed when the input is focused on, but it seems like...
Read more >How to use the @testing-library/dom.findByText function in ...
To help you get started, we've selected a few @testing-library/dom. ... focus(input); type(input, option); fireEvent.change(input, { target: { value: option } ...
Read more >Having trouble getting my options with fireEvent - Bountysource
I have a very specific use case where I am needing an event to reach my code. When I do the following fireEvent.pointerDown(domElement ......
Read more >React Testing Library and the “not wrapped in act” Errors
Why do I get this error? In test, the code to render and update React components need to be included in React's call...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems like a missing jsdom implementation https://github.com/testing-library/dom-testing-library/issues/558 https://github.com/testing-library/react-testing-library/issues/317 https://github.com/jsdom/jsdom/pull/2666
Here is an example that faces the same issue I have in my project: https://codesandbox.io/s/fireevent-pointerevent-problem-6de1d?file=/tst/HandlesPointerEvents.spec.ts