See the Architecture Decision Records #5 about why we test the way we do.
Concretely, a higher-order component is a function that takes a component and returns a new component.
- Test the component returned by higher-order-component or HOC functions as expected.
Decorated components can be tested by providing the context necessary for those decorators to function. Where it permits, try to separate the component from its decorators.
Testing components that use custom attributes from the theme will need to use the Material UI theme provider, and import and use the default theme or a mock theme js object.
- Snapshot testing
- Testing component functionality like
onClick
events - Integration testing