Skip to content

Commit

Permalink
fix: support uppercase custom props in toHaveStyle
Browse files Browse the repository at this point in the history
CSS custom properties are case sensitive

fixes #551

---


this commit adds a failing test, the following one makes it pass

please squash them together
  • Loading branch information
depoulo authored Nov 28, 2023
1 parent 4ae0231 commit b12b4f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/to-have-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ describe('.toHaveStyle', () => {

test('handles inline custom properties', () => {
const {queryByTestId} = render(`
<span data-testid="color-example" style="--color: blue">Hello World</span>
<span data-testid="color-example" style="--accentColor: blue">Hello World</span>
`)
expect(queryByTestId('color-example')).toHaveStyle('--color: blue')
expect(queryByTestId('color-example')).toHaveStyle('--accentColor: blue')
})

test('handles global custom properties', () => {
Expand Down

0 comments on commit b12b4f4

Please sign in to comment.