mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
toast an error when forgot password fails
This commit is contained in:
parent
ef3420ef2e
commit
749b9c38c3
@ -2,6 +2,8 @@ import { mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import flushPromises from 'flush-promises'
|
||||
import ForgotPassword from './ForgotPassword'
|
||||
|
||||
import { toastErrorSpy } from '@test/testSetup'
|
||||
|
||||
const mockAPIcall = jest.fn()
|
||||
|
||||
const localVue = global.localVue
|
||||
@ -116,6 +118,10 @@ describe('ForgotPassword', () => {
|
||||
await flushPromises()
|
||||
})
|
||||
|
||||
it('toasts a standard error message', () => {
|
||||
expect(toastErrorSpy).toBeCalledWith('error.email-already-sent')
|
||||
})
|
||||
|
||||
it('pushes to "/thx/forgotPassword"', () => {
|
||||
expect(mockAPIcall).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
|
||||
@ -69,6 +69,7 @@ export default {
|
||||
this.$router.push('/thx/forgotPassword')
|
||||
})
|
||||
.catch(() => {
|
||||
this.toastError(this.$t('error.email-already-sent'))
|
||||
this.$router.push('/thx/forgotPassword')
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user