forked from testing-library/jest-dom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: toHaveStyle assertion with invalid style (testing-library#564)
Given an invalid declaration such as `fontSize: 8`, due to the missing unit, the `toHaveStyle` matcher should not pass the following test: ``` render(<div data-testid="element" style={{ fontSize: 8 }} />) expect(screen.getByTestId('element')).toHaveStyle({ fontSize: 1 }) ``` This PR fixes testing-library#564 by adding a more restrictive guard in the matcher's logic.
- Loading branch information
1 parent
a93c0c4
commit fd3089f
Showing
2 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters