Skip to content

Improve documentation on unit testing redux components #1462

Closed
@c089

Description

@c089

I've noticed that the Writing Tests page explains how to unit test react components, but doesn't really go into details / show examples for containers wrapped by redux. I believe that unit testing vanilla JS components should rather be documented in the react documentation instead and redux docs should show users how to test components that are connected to redux.

My personal approach to this is to use shallow rendering and assert on the props of the wrapped component, so that I test the logic in mapStateToProps in one unit test and have independent unit tests for the wrapped components (if at all, as they often end up being static markup with no logic).

I'm happy to work on a PR for this but want to get some opinions before starting that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions