Skip to content

Commit

Permalink
fix regression with nested components
Browse files Browse the repository at this point in the history
fix #170
  • Loading branch information
MicheleBertoli committed Aug 22, 2018
1 parent e2386c6 commit cbd755f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/toHaveStyleRule.js
Expand Up @@ -110,8 +110,8 @@ const normalizeOptions = ({ modifier, ...options }) =>
: options

function toHaveStyleRule(component, property, expected, options = {}) {
const ast = getCSS()
const classNames = getClassNames(component)
const ast = getCSS()
const normalizedOptions = normalizeOptions(options)
const rules = getRules(ast, classNames, normalizedOptions)

Expand Down
4 changes: 3 additions & 1 deletion test/__snapshots__/styleSheetSerializer.spec.js.snap
Expand Up @@ -34,7 +34,9 @@ exports[`any component: react-test-renderer 1`] = `
}
<div>
<a>
<a
className={undefined}
>
Unstyled, boring Link
</a>
<br />
Expand Down
2 changes: 2 additions & 0 deletions test/preact/__snapshots__/styleSheetSerializer.spec.js.snap
Expand Up @@ -14,9 +14,11 @@ exports[`basic 1`] = `
<section
class="c0"
ref={undefined}
>
<h1
class="c1"
ref={undefined}
>
Hello World, this is my first styled component!
</h1>
Expand Down

0 comments on commit cbd755f

Please sign in to comment.