Skip to content
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

createEvent: Only run dataTransfer workarounds in jsdom environments #1347

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nifgraup
Copy link

@nifgraup nifgraup commented Jan 15, 2025

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
  • Ready to be merged

@nifgraup
Copy link
Author

build failure is dealt with in #1346

@nifgraup nifgraup changed the title createEvent: Only run dataTransfer workarounds in json environments createEvent: Only run dataTransfer workarounds in jsdom environments Jan 15, 2025
@nifgraup nifgraup force-pushed the use-real-datatransfer branch from 6f8117e to 71fbd54 Compare January 15, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant