Created
May 30, 2018 16:41
-
-
Save mladenp/004d34f5dc7358d5b1fb49937410764b to your computer and use it in GitHub Desktop.
Test componentDidMount jest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('componentDidMount should dispatch loadHomeAction', () => { | |
const wrapper = shallow(<Home dispatch={jest.fn()} />); | |
wrapper.instance().componentDidMount(); | |
expect(wrapper.instance().props.dispatch).toBeCalledWith(loadHomeAction()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment