This is designed as a simple React
component mock to be used with Jest
, that still presents enough information to be useful in a Snapshot test. It's handy when you either don't want to shallow render, or are unable to.
To use this mock, insert the following into your test file, to mock the sub-components, substituting out the names:
jest.mock("../MyComponent", () => ({ MyComponent: (props) => mockComponent("MyComponent", props) }));