Skip to content
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

False positives from toHaveStyle #657

Open
jmpainter opened this issue Dec 12, 2024 · 0 comments
Open

False positives from toHaveStyle #657

jmpainter opened this issue Dec 12, 2024 · 0 comments

Comments

@jmpainter
Copy link

jmpainter commented Dec 12, 2024

  • @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant