You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is an issue for here or an issue for Enzyme but I've only ever encountered it while using svg-inline-react.
If I am shallow rendering a component to test, such as
import InlineSVG from 'svg-inline-react'
import mapMarker from '../../assets/icons/map-marker.svg'
const LocationDetails = ({ words }) => (
<div>
<InlineSVG src={mapMarker}/>
<div>{words}</div>
</div>
)
during the test I can output the shallow(<LocationDetails />).debug() and I see the <InlineSVG> with its attributes but doing a shallow(<LocationDetails />).contains(<InlineSVG />) fails. However doing shallow(<LocationDetails />).find('InlineSVG').length returns 1.
I did not try that. In the interim (I know it was short) we have swapped out for SVGInline for the classNames support. I feel confident that your suggestion would work though. Thanks for the look 👍
I'm not sure if this is an issue for here or an issue for Enzyme but I've only ever encountered it while using
svg-inline-react
.If I am
shallow
rendering a component to test, such asduring the test I can output the
shallow(<LocationDetails />).debug()
and I see the<InlineSVG>
with its attributes but doing ashallow(<LocationDetails />).contains(<InlineSVG />)
fails. However doingshallow(<LocationDetails />).find('InlineSVG').length
returns 1.:(
References
http://airbnb.io/enzyme/docs/api/shallow.html
The text was updated successfully, but these errors were encountered: