I'm trying to shallow render a component to perform some basic unit tests.
The component I am doing this on has two child components which are rendered several times each depending on the parents props.
When querying the shallow rendered component, the child elements are being rendered -fully- also, meaning that the children's HTML elements are also accessible.
I am using Karma, Browserify, Jasmine and Enzyme, and can post the configs for each if needed. Has anybody seen similar behaviour before?
This is the correct behaviour. The different to the other render methods from enzyme is, that it does not call any lifecycle methods and that it does not convert to real html, but it will render all its childs and childs of the childs and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With