Skip to content

Instantly share code, notes, and snippets.

@kuroski
Last active September 11, 2018 22:33
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 kuroski/eac25b60f0d4f3283cd088b02a5db5aa to your computer and use it in GitHub Desktop.
Save kuroski/eac25b60f0d4f3283cd088b02a5db5aa to your computer and use it in GitHub Desktop.
...
...
it('calls "submitted" event when submitting form', () => {
// arrange
const expectedUser = 'kuroski'
const { wrapperMounted, button, inputMounted } = build()
inputMounted().element.value = expectedUser
// act
inputMounted().trigger('input')
button().trigger('click')
button().trigger('submit')
// assert
expect(wrapperMounted.emitted().submitted[0]).toEqual([expectedUser])
})
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment