Integration test a React component that consumes a Render Prop

Share this video with your friends

Send Tweet

In this lesson, I use Enzyme and Jest's Snapshot functionality to write an integration test for a component called CounterConsumer that consumes the Render Prop component Counter. This integration test is great because it doesn't necessarily care that CounterConsumer uses Counter behind the scenes, just that it works when integrated.

Other resources: Testing ⚛️ components using render props