You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Custom property names are case sensitive — --my-color will be treated as a separate custom property to --My-color.
Current workarounds are changing the code under test, including the stylesheets, to use all-lowercase custom property names, or to not use .toHaveStyle().
The text was updated successfully, but these errors were encountered:
CSS custom properties are case sensitive
fixestesting-library#551
---
this commit adds a failing test, the following one makes it pass
please squash them together
The error will be the dreaded Compared values have no visual difference.
Relevant code or config:
It's easy to reproduce by changing the existing test:
jest-dom/src/__tests__/to-have-style.js
Lines 122 to 128 in 4ae0231
The culprit is the
.toLowerCase()
here:jest-dom/src/to-have-style.js
Line 23 in 4ae0231
According to MDN:
Current workarounds are changing the code under test, including the stylesheets, to use all-lowercase custom property names, or to not use
.toHaveStyle()
.The text was updated successfully, but these errors were encountered: