-
Notifications
You must be signed in to change notification settings - Fork 412
feat: toBeVisible custom matcher #13
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 7 8 +1
Lines 67 76 +9
Branches 15 17 +2
=====================================
+ Hits 67 76 +9
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.
Looks awesome. I'm fine with whatever you decide about opacity 👍
README.md
Outdated
* it does not have its css property `display` set to `none` | ||
* it does not have its css property `visibility` set to either `hidden` or | ||
`collapse` | ||
* its parent element is also visible (and so on up to the top of the DOM tree) |
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.
What about opacity: 0
? That's a pretty common way to make things invisible as well. Hmmm...
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.
Hmmmmm, yes. Good point 🤔
🎉 This PR is included in version 1.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
I think the feature I like the most about semantic-release is that it leaves this message above in PRs once they get released after being merged. So many times I find an issue in a library that I'm having trouble with, I find that it has been merged, but there's no way to know if it's just on master, or beta or rc release, or the latest stable release. It's frustrating. |
Yeah! I love that feature too! |
What:
A new
.toBeVisible
custom matcher, as discussed in #7Closes #7
Why:
Because checking for this manually is not trivial.
How:
Using
getComputedStyle
on an element to check if it's not visible either viadisplay: none
orvisibility: hidden|collapse
. Also checks parent nodes all the way to the top, if any of them is not visible, the element is not visible as well.Checklist: