diff --git a/src/__tests__/to-have-style.js b/src/__tests__/to-have-style.js index bce75f56..0771bd48 100644 --- a/src/__tests__/to-have-style.js +++ b/src/__tests__/to-have-style.js @@ -17,6 +17,7 @@ describe('.toHaveStyle', () => { color: white; float: left; transition: opacity 0.2s ease-out, top 0.3s cubic-bezier(1.175, 0.885, 0.32, 1.275); + transform: translateX(0px); } ` document.body.appendChild(style) @@ -49,6 +50,10 @@ describe('.toHaveStyle', () => { expect(container.querySelector('.label')).toHaveStyle(` Align-items: center; `) + + expect(container.querySelector('.label')).toHaveStyle(` + transform: translateX(0px); + `) }) test('handles negative test cases', () => { diff --git a/src/to-have-style.js b/src/to-have-style.js index f78272ef..e81303ea 100644 --- a/src/to-have-style.js +++ b/src/to-have-style.js @@ -19,8 +19,7 @@ function getStyleDeclaration(document, css) { function isSubset(styles, computedStyle) { return Object.entries(styles).every( ([prop, value]) => - computedStyle.getPropertyValue(prop.toLowerCase()) === - value.toLowerCase(), + computedStyle.getPropertyValue(prop.toLowerCase()) === value, ) }