-
Notifications
You must be signed in to change notification settings - Fork 470
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
fix: prevent crashing on elements without parentElement #871
fix: prevent crashing on elements without parentElement #871
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. Latest deployment of this branch, based on commit 36c6d63:
|
Codecov Report
@@ Coverage Diff @@
## master #871 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 945 946 +1
Branches 290 291 +1
=========================================
+ Hits 945 946 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Don't tell the TypeScript police we had this bug
@all-contributors add @AriPerkkio for bug, code |
I've put up a pull request to add @AriPerkkio! 🎉 |
🎉 This PR is included in version 7.29.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
Fixes #870.
Why:
Utility method
waitForElementToBeRemoved
should not crash when given element is already removed from its parent element. It should handle these cases and clearly report element is already removed.How:
Check whether element has
.parentElement
before accessing it. Prevents unexpected null pointer.Checklist:
docs site
I was unable to use the pre-commit hook. The
kcd-scripts test --findRelatedTests
keeps running forever. After 10-15mins I cancelled it and commited with--no-verify
. Same thing has happened to me before with@testing-library/eslint-plugin-jest-dom
repository.Here's output of the test case without the fix applied just to indicate the error is same as in #870.
Test case error