Created
April 15, 2020 18:27
-
-
Save sonicoder86/0e8a8a5b071d2e4c00f2d4c9984dea23 to your computer and use it in GitHub Desktop.
React Testing Crash Course - part 15
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 set info coming from endpoint', async () => { | |
const commit = jest.fn(); | |
jest.spyOn(axios, 'post').mockImplementation(() => ({ | |
body: 'Modified by post' | |
})); | |
await onModify({ commit }, 'Modified by click'); | |
expect(commit).toHaveBeenCalledWith('modify', { info: 'Modified by post' }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment