Rendering methods used in Enzyme
There are three different types of rendering methods that Enzyme can perform – ‘shallow’, ‘full’ and ‘static’. The case under test will determine which method to use.
‘Shallow’ rendering is the most common and will limit the rendering to just the component under test rather than any of its children. This means any errors caused when rendering those children will not fail the test.
‘Full’ rendering will render everything from the parent downwards. This can be particularly useful for testing those wrapped in higher order components. These tests can take longer to run, but any component doing any direct manipulation of the DOM will need to do a full render.
‘Static’ rendering will only render the component once as static HTML. It can be faster but will not provide any interaction.