Skip to content

Instantly share code, notes, and snippets.

@Tin-Nguyen
Created April 14, 2017 02:54
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 Tin-Nguyen/743b228c07a4ee58c19e16b4625e9d1f to your computer and use it in GitHub Desktop.
Save Tin-Nguyen/743b228c07a4ee58c19e16b4625e9d1f to your computer and use it in GitHub Desktop.
it('simulates click events', () => {
const onButtonClick = sinon.spy()
const wrapper = shallow(
<Foo onButtonClick={onButtonClick} />
)
wrapper.find('button').simulate('click')
expect(onButtonClick.calledOnce).to.be.true
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment