Skip to content

Instantly share code, notes, and snippets.

@bmdalex
Created January 24, 2021 21:29
Show Gist options
  • Save bmdalex/64456e39e842dc2c87ceeecb0fabf124 to your computer and use it in GitHub Desktop.
Save bmdalex/64456e39e842dc2c87ceeecb0fabf124 to your computer and use it in GitHub Desktop.
DON'T create tests with many assertions (ideally just one assertion / test)
test('when the user submits a valid form should register the user', () => {
/*
* preconditions
*/
expect(getFormSubmitButton(wrapper).attributes('disabled')).toBe(undefined)
expect($auth.registerUser).toHaveBeenCalledWith({ email: validEmail })
expect(wrapper.emitted()['register-update'][0]).toBe(registerUserResponse)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment