-
Notifications
You must be signed in to change notification settings - Fork 252
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
test: identify browser/jsdom differences #1091
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov Report
@@ Coverage Diff @@
## main #1091 +/- ##
=======================================
Coverage 99.46% 99.47%
=======================================
Files 92 92
Lines 2070 2085 +15
Branches 714 706 -8
=======================================
+ Hits 2059 2074 +15
Misses 11 11
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
5217161
to
100aa83
Compare
🎉 This PR is included in version 14.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
Identify the differences between Chrome and Jsdom environment.
Why:
Determine if failing tests in Chrome are the result of wrong assumptions in our tests or wrong implementations in our source.
Checklist:
Findings:
Some of our tests rely on Jsdom-specific behavior and in at least one case the browser implementation has changed.
I've added TODOs (either in test or source) where i could identify the cause of different results in the test environments.
Any new discoveries of differences between Jsdom and Chrome should be added to
tests/environment
so that we can easily keep track of the quirks.prepareElement
is triggered byfocus
. Therefore we fail to track any UI value/selection in browsers.user-event/src/event/focus.ts
Lines 5 to 6 in 57c9b65
Selection
when<input/>
inside contenteditable is focused #1248user-event/src/event/selection/updateSelectionOnFocus.ts
Lines 3 to 6 in a76db96
DataTransferItem.getAsString()
breaks Clipboard methods #1249user-event/src/utils/dataTransfer/DataTransfer.ts
Line 160 in 5d0dcaf
createDataTransfer
fails to override realDataTransfer.types
.With
files
parameter the method has only been used internally in our tests.user-event/tests/utils/dataTransfer/DataTransfer.ts
Lines 49 to 52 in 98bc5e0
user-event/tests/utils/edit/setFiles.ts
Lines 44 to 48 in 5057e39