-
Notifications
You must be signed in to change notification settings - Fork 406
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: check for any Node in toHaveTextContent #358
Conversation
16ad0fb
to
9ca0cef
Compare
Codecov Report
@@ Coverage Diff @@
## main #358 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 545 554 +9
Branches 198 199 +1
=========================================
+ Hits 545 554 +9
Continue to review full report at Codecov.
|
} | ||
} | ||
|
||
function checkHasWindow(htmlElement, ErrorClass, ...args) { |
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.
I think you could've kept the signature of this one intact as we only call it internally in this module, only once, and always to check for the HTML element check, and not the Node check.
Not a big deal or a blocking change request. Can stay as is. Maybe I'm missing something.
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.
See line 63, I actually call it for the node check ;-)
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.
yes, I know.
My point was that that was the only call to it. But never mind, it's ok as is. It was a bit of a nit-pick, and maybe a wrong one at that anyway.
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.
ah yeah I see what you mean :-) yeah, maybe it's a bit over-designed :-)
This will need to be handled separately in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__jest-dom Not meaning to say you should handle it. Maybe someone does it first, if they feel the pain of wanting this new feature and needed TypeScript support. Personally I find it a hassle to not have the types co-located. |
I see, looking at this I believe there's no change needed. But I'm not using TS (we're using Flow in our project) so I may miss something. For Flow, what we put in |
Thanks for the quick review and merge! |
Thank you too for your contribution! |
@all-contributors add @julienw for code, test |
I've put up a pull request to add @julienw! 🎉 |
🎉 This PR is included in version 5.12.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The type declarations live in |
@RandinAk what's the purpose of your last comment? It seems to be mostly a quote of this PR's description, with no extra info added. |
@all-contributors add @julienw for code, test |
I've put up a pull request to add @julienw! 🎉 |
Fixes #306
I based it off #307 but changed a lot of things, that's why I didn't keep the initial author information.
What, Why: Please have a look at #306
How: I added a
checkNode
function inutils
so that it can be reused elsewhere. I followed the style of the other functions and also the comment in #307 about checking that we have a window before using it.Checklist: