Skip to content

Instantly share code, notes, and snippets.

@reime005
Created September 9, 2019 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/3b31dd343fc2d267886a04df351dbd21 to your computer and use it in GitHub Desktop.
Save reime005/3b31dd343fc2d267886a04df351dbd21 to your computer and use it in GitHub Desktop.
/* src/store/__tests__/ui.test.js */
//...
it('should handle button click event', () => {
const onButtonClick = sinon.spy();
const app = shallow(<Home makeCall={onButtonClick} />);
const button = app.find({ id: 'testButton' });
button.simulate('click');
expect(onButtonClick.calledOnce).toBe(true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment