Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with lowercasing toHaveStyle values. #164

Merged
merged 1 commit into from Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/__tests__/to-have-style.js
Expand Up @@ -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)
Expand Down Expand Up @@ -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', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/to-have-style.js
Expand Up @@ -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,
)
}

Expand Down