testing-library/jest-dom
在 GitHub 查看toHaveStyle for property `font-size` behaves incorrectly for number values
Open
#564 创建于 2023年12月27日
buggood first issue
仓库指标
- Star
- (4,594 star)
- PR 合并指标
- (PR 指标待抓取)
描述
@testing-library/jest-domversion: 6.1.5nodeversion: 20.3.1jest(orvitest) version: 0.34.1npm(oryarn) version: 9.6.7
Relevant code or config:
render(<div data-testid="element" style={{ fontSize: 8 }} />)
expect(screen.getByTestId('element')).toHaveStyle({ fontSize: 1 })
What you did:
I expected the above assertion to fail
What happened:
The test passes instead!✅
Reproduction:
Problem description:
the assertion is clearly incorrect and can easily cause bugs
Suggested solution:
I have not thought of a solution yet but would like to investigate this issue during my off hours.