Use Enzyme's `wrappingComponent` option in `mount`
Also works with shallow
:
This pattern is particularly meaningful when you want to call setProps
or other methods that are only valid on the root of the component tree, because dive
can't help you there. If you want to change the props on both, you can use target.getWrappingComponent()
to get at the wrapping component in the same way!
https://enzymejs.github.io/enzyme/docs/api/ReactWrapper/getWrappingComponent.html
Tweet