-
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
feat: add flag to skip pointer-events check #731
feat: add flag to skip pointer-events check #731
Conversation
Add a flag to skip the check for pointer-events set to none. The check is costly to check and this flag makes it possible to skip it.
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. Latest deployment of this branch, based on commit f733425:
|
Codecov Report
@@ Coverage Diff @@
## main #731 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 50 50
Lines 946 958 +12
Branches 371 385 +14
=========================================
+ Hits 946 958 +12
Continue to review full report at Codecov.
|
@jesperorb Would you be so kind to file a PR documenting this flag in https://github.com/testing-library/testing-library-docs/blob/main/docs/ecosystem-user-event.mdx ? |
@ph-fritsche Yes, will do 👍🏽 |
🎉 This PR is included in version 13.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@all-contributors add @jesperorb code |
I've put up a pull request to add @jesperorb! 🎉 |
What:
This PR adds a new flag called
skipPointerEventsCheck
which makes it possible to skip checking forpointer-events: "none"
when using different user events likeclick
ordblclick
.This PR does not add a global config flag as per discussion in: #729
Why:
As per discussion in: #729
Adding the check for
hasPointerEvents
increase the time to execute each click and hover or anything that relies onpointer-events
. The increased time for each click can be quite drastic depending on how large of a DOM-tree you are rendering in your tests as it checks if any parent has the property set.Making it optional can speed up tests. If you for example know that the property is not set in the code your are testing. Or if you want to disable it momentarily when developing and the run it later on in the CI.
How:
Adding a common interface for pointer events that has the property
skipPointerEventsCheck
and using this flag anywhere the checkhasPointerEvents
is being used.Checklist:
Feedback and questions