coverage my-email-address/index.spec.js

This commit is contained in:
Ulf Gebhardt 2021-04-24 02:08:50 +02:00
parent 9445627480
commit fc176e28a4
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View File

@ -111,6 +111,21 @@ describe('EmailSettingsIndexPage', () => {
expect(wrapper.text()).toContain('registration.signup.form.errors.email-exists')
})
})
describe('if backend sends any other error', () => {
beforeEach(() => {
mocks.$apollo.mutate = jest.fn().mockRejectedValue({
message: 'Ouch!',
})
wrapper = Wrapper()
wrapper.find('#email').setValue('already-taken@example.org')
wrapper.find('form').trigger('submit')
})
it('display a toast error', () => {
expect(mocks.$toast.error).toHaveBeenCalled()
})
})
})
})
})