Last active
June 17, 2017 02:05
-
-
Save lotif/90e557d4bae78e37c295c313b60a3422 to your computer and use it in GitHub Desktop.
integration test with promises
This file contains 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('should change the text on click', async () => { | |
http.get.mockImplementation(() => Promise.resolve({ body: 'the-return-of-my-get-request' })); | |
const sut = mount( | |
<Provider store={store}> | |
<MyComponent /> | |
</Provider> | |
); | |
sut.find('div').simulate('click'); | |
await flushAllPromises(); | |
expect(sut.find('div').prop('children')).toEqual('the-return-of-my-get-request'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment