question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

doesNotHaveStyle assertion

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
buschtoenscommented, Nov 27, 2019

Implemented in #531. Can be closed. ^__^

0reactions
timiyaycommented, Nov 10, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >
qunit-dom | Yarn - Package Manager
Fast, reliable, and secure dependency management.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found