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
[#610] waitForElementToBeRemoved: fix return type #631
[#610] waitForElementToBeRemoved: fix return type #631
Conversation
There's a couple options here, as issue testing-library#610 enumerates nicely. 1) Resolve to the type param T Keeping references to removed elements is a probable source of bugs and confusing tests. A reference should be easy enough to obtain with other test utilities; I submit that there's no added value in providing it here. 2) Resolve to boolean (or literal `true`) Not a bad choice by any means, but not particularly meaningful (the fulfillment of the promise is signal enough IMO) 3) Resolve to something empty This is what I've gone with. We are _literally_ waiting for removal, after all :) Fixes testing-library#610
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 6f3ea3d:
|
Codecov Report
@@ Coverage Diff @@
## master #631 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 565 565
Branches 141 141
=========================================
Hits 565 565
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.
Cool, thanks 👍
@all-contributors please add @tjefferson08 for code and tests |
I've put up a pull request to add @tjefferson08! 🎉 |
🎉 This PR is included in version 7.14.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
waitForElementToBeRemoved had the wrong return type, and it got fixed in testing-library/dom-testing-library#631 This PR updates @testing-library/vue, which depends on @testing-library/dom.
waitForElementToBeRemoved had the wrong return type, and it got fixed in testing-library/dom-testing-library#631 This PR updates @testing-library/vue, which depends on @testing-library/dom.
waitForElementToBeRemoved had the wrong return type, and it got fixed in testing-library/dom-testing-library#631 This PR updates @testing-library/vue, which depends on @testing-library/dom.
waitForElementToBeRemoved had the wrong return type, and it got fixed in testing-library/dom-testing-library#631 This PR updates @testing-library/vue, which depends on @testing-library/dom.
What:
A possible fix for issue #610 -> a refinement to the return value (and TS type) for
waitForElementToBeRemoved
Why:
There's a mismatch between implementation and type signature (and docs)
How:
I've updated the return type to
Promise<void>
(and implemented by returning undefined)For more details, please refer to the commit message(s)!
Checklist:
docs site