jest-dom icon indicating copy to clipboard operation
jest-dom copied to clipboard

False positives from `toHaveStyle`

Open jmpainter opened this issue 11 months ago • 0 comments

  • @testing-library/jest-dom version: latest

Relevant code or config:

The following assertions will always pass if the element doesn't have that CSS property set in style:

expect(element).toHaveStyle("border: fakefake");
expect(element).toHaveStyle("background: fakefake");

Suggested solution:

Fix needs to be made in to-have-style.js getStyleDeclaration. expected will be '' (empty string) in toHaveStyle.

jmpainter avatar Dec 12 '24 01:12 jmpainter