doesNotHaveStyle assertion
See original GitHub issueI recently needed a doesNotHaveStyle
assertion, as a counterpart to test that uses the existing hasStyle
assertion: https://github.com/simplabs/qunit-dom/blob/master/API.md#hasstyle
Would this feature be considered, if I opened a PR?
Here’s what I’m doing right now, within an EmberJS component rendering test:
const element = this.element.querySelector('[data-test-my-component]')
const zIndex = window.getComputedStyle(element).zIndex
assert.notEqual(zIndex, '-1', 'should have non-negative z-index')
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
`hasStyle` / `doesNotHaveStyle`: empty `expected` should throw
I would suggest to throw an error or fail the assertion, when an empty object is passed to hasStyle , as this can...
Read more >AbstractTableViewAssert (testfx-core 4.0.17-alpha ...
Verifies that the actual TableView contains the given table cell expectedValue . Methods inherited from class org.testfx.assertions.api.AbstractNodeAssert.
Read more >Assertion Styles - Chai
This section of the guide introduces you to the three different assertion styles that you may use in your testing environment.
Read more >Using LiveViewTest to assert element with Alpine.js
What I am finding is that in my test, even when isShowable is evaluated to false , the button does not have style=display:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Implemented in #531. Can be closed. ^__^
Nice one @scalvert, thanks! 🎁
I hadn’t done anything meaningful on it yet - I wasn’t sure how useful others would find this particular assertion. Glad to hear it’s handy for others too.