jest-dom
jest-dom copied to clipboard
False positives from `toHaveStyle`
@testing-library/jest-domversion: 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.