diff --git a/frontend/src/pages/ForgotPassword.spec.js b/frontend/src/pages/ForgotPassword.spec.js index 321f04913..dd703d7fc 100644 --- a/frontend/src/pages/ForgotPassword.spec.js +++ b/frontend/src/pages/ForgotPassword.spec.js @@ -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({ diff --git a/frontend/src/pages/ForgotPassword.vue b/frontend/src/pages/ForgotPassword.vue index 510567703..580a0ed97 100644 --- a/frontend/src/pages/ForgotPassword.vue +++ b/frontend/src/pages/ForgotPassword.vue @@ -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') }) },