dom-testing-library
dom-testing-library copied to clipboard
createEvent: Only run dataTransfer workarounds in jsdom environments
What:
Fixes for browser based environments, not present when used with jest/jsdom.
Why:
createEvent has a workaround for missing event.dataTransfer objects as they don't exist in jsdom environments like jest #585 . Browser-based environments will have native DataTransfer objects and that should be used as the tests may rely on them being the real thing.
How:
A simple check to see if the workaround is needed.
Checklist:
- N/A[ ] Documentation added to the docs site
- I wish I could write a test case but this requires a test environment other than node.js/jest/jsdom [ ] Tests
- N/A [ ] TypeScript definitions updated
- [x] Ready to be merged
build failure is dealt with in #1346