jest-styled-components
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -7,2 +7,7 @@ # Changelog | ||
## [6.1.1](https://github.com/styled-components/jest-styled-components/compare/v6.1.0...v6.1.1) - 2018-08-22 | ||
### Fixed | ||
- [toHaveStyleRule] Fix regression with nested components. | ||
- [toHaveStyleRule] Avoid throwing on non existing Enzyme components. | ||
## [6.1.0](https://github.com/styled-components/jest-styled-components/compare/v6.0.1...v6.1.0) - 2018-08-19 | ||
@@ -9,0 +14,0 @@ ### Added |
{ | ||
"name": "jest-styled-components", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Jest utilities for Styled Components", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -15,3 +15,3 @@ const { getCSS, matcherTest, buildReturnMessage } = require('./utils') | ||
className = received.props.className || received.props.class | ||
} else if (typeof received.findWhere === 'function') { | ||
} else if (typeof received.exists === 'function' && received.exists()) { | ||
const tree = shouldDive(received) ? received.dive() : received | ||
@@ -114,4 +114,4 @@ const components = tree.findWhere(isTagWithClassName) | ||
function toHaveStyleRule(component, property, expected, options = {}) { | ||
const classNames = getClassNames(component) | ||
const ast = getCSS() | ||
const classNames = getClassNames(component) | ||
const normalizedOptions = normalizeOptions(options) | ||
@@ -118,0 +118,0 @@ const rules = getRules(ast, classNames, normalizedOptions) |
33594