Skip to content

Instantly share code, notes, and snippets.

@Tin-Nguyen
Created April 14, 2017 02:54
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