From bcc3ca49077a11012100601888b2ae32f0f6c37f Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 7 Mar 2022 19:07:14 +0100 Subject: [PATCH] rename password with forgot-password --- frontend/src/pages/ForgotPassword.spec.js | 8 ++++---- frontend/src/pages/ForgotPassword.vue | 6 +++--- frontend/src/pages/Login.spec.js | 4 ++-- frontend/src/pages/Login.vue | 2 +- frontend/src/pages/ResetPassword.spec.js | 4 ++-- frontend/src/pages/ResetPassword.vue | 2 +- frontend/src/pages/thx.spec.js | 6 +++--- frontend/src/pages/thx.vue | 2 +- frontend/src/routes/router.test.js | 18 ++++++++++-------- frontend/src/routes/routes.js | 6 +++--- 10 files changed, 30 insertions(+), 28 deletions(-) diff --git a/frontend/src/pages/ForgotPassword.spec.js b/frontend/src/pages/ForgotPassword.spec.js index 41f1575cd..b8f1be3c0 100644 --- a/frontend/src/pages/ForgotPassword.spec.js +++ b/frontend/src/pages/ForgotPassword.spec.js @@ -116,7 +116,7 @@ describe('ForgotPassword', () => { await flushPromises() }) - it('pushes to "/thx/password"', () => { + it('pushes to "/thx/forgotPassword"', () => { expect(mockAPIcall).toBeCalledWith( expect.objectContaining({ variables: { @@ -124,7 +124,7 @@ describe('ForgotPassword', () => { }, }), ) - expect(mockRouterPush).toHaveBeenCalledWith('/thx/password') + expect(mockRouterPush).toHaveBeenCalledWith('/thx/forgotPassword') }) }) @@ -141,7 +141,7 @@ describe('ForgotPassword', () => { await flushPromises() }) - it('pushes to "/thx/password"', () => { + it('pushes to "/thx/forgotPassword"', () => { expect(mockAPIcall).toBeCalledWith( expect.objectContaining({ variables: { @@ -149,7 +149,7 @@ describe('ForgotPassword', () => { }, }), ) - expect(mockRouterPush).toHaveBeenCalledWith('/thx/password') + expect(mockRouterPush).toHaveBeenCalledWith('/thx/forgotPassword') }) }) }) diff --git a/frontend/src/pages/ForgotPassword.vue b/frontend/src/pages/ForgotPassword.vue index 87c31dcf2..7d389ff59 100644 --- a/frontend/src/pages/ForgotPassword.vue +++ b/frontend/src/pages/ForgotPassword.vue @@ -57,7 +57,7 @@ const textFields = { } export default { - name: 'password', + name: 'ForgotPassword', components: { InputEmail, }, @@ -80,10 +80,10 @@ export default { }, }) .then(() => { - this.$router.push('/thx/password') + this.$router.push('/thx/forgotPassword') }) .catch(() => { - this.$router.push('/thx/password') + this.$router.push('/thx/forgotPassword') }) }, }, diff --git a/frontend/src/pages/Login.spec.js b/frontend/src/pages/Login.spec.js index 411bba88b..ce32e1971 100644 --- a/frontend/src/pages/Login.spec.js +++ b/frontend/src/pages/Login.spec.js @@ -136,8 +136,8 @@ describe('Login', () => { ) }) - it('links to /password when clicking "Forgot Password"', () => { - expect(wrapper.findAllComponents(RouterLinkStub).at(0).props().to).toBe('/password') + it('links to /forgot-password when clicking "Forgot Password"', () => { + expect(wrapper.findAllComponents(RouterLinkStub).at(0).props().to).toBe('/forgot-password') }) it('has a link "Create new account"', () => { diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 67afc6a8c..75b9ae1e3 100755 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -44,7 +44,7 @@ - + {{ $t('settings.password.forgot_pwd') }} diff --git a/frontend/src/pages/ResetPassword.spec.js b/frontend/src/pages/ResetPassword.spec.js index 5c02a41ab..0e798c193 100644 --- a/frontend/src/pages/ResetPassword.spec.js +++ b/frontend/src/pages/ResetPassword.spec.js @@ -156,8 +156,8 @@ describe('ResetPassword', () => { expect(toastErrorSpy).toHaveBeenCalledWith('...Code is older than 10 minutes') }) - it('router pushes to /password/reset', () => { - expect(routerPushMock).toHaveBeenCalledWith('/password/reset') + it('router pushes to /forgot-password/reset', () => { + expect(routerPushMock).toHaveBeenCalledWith('/forgot-password/reset') }) }) diff --git a/frontend/src/pages/ResetPassword.vue b/frontend/src/pages/ResetPassword.vue index ee43df310..970cf1cba 100644 --- a/frontend/src/pages/ResetPassword.vue +++ b/frontend/src/pages/ResetPassword.vue @@ -101,7 +101,7 @@ export default { .catch((error) => { this.toastError(error.message) if (error.message.includes('Code is older than 10 minutes')) - this.$router.push('/password/reset') + this.$router.push('/forgot-password/reset') }) }, setDisplaySetup() { diff --git a/frontend/src/pages/thx.spec.js b/frontend/src/pages/thx.spec.js index 7d3925a0c..bcba121bd 100644 --- a/frontend/src/pages/thx.spec.js +++ b/frontend/src/pages/thx.spec.js @@ -23,7 +23,7 @@ describe('Thx', () => { describe('mount', () => { beforeEach(() => { - wrapper = Wrapper(createMockObject('password')) + wrapper = Wrapper(createMockObject('forgotPassword')) }) it('renders the thx page', () => { @@ -35,9 +35,9 @@ describe('Thx', () => { }) }) - describe('coming from /password', () => { + describe('coming from /forgot-password', () => { beforeEach(() => { - wrapper = Wrapper(createMockObject('password')) + wrapper = Wrapper(createMockObject('forgotPassword')) }) it('renders the thanks text', () => { diff --git a/frontend/src/pages/thx.vue b/frontend/src/pages/thx.vue index cd74f1872..1308ca0fc 100644 --- a/frontend/src/pages/thx.vue +++ b/frontend/src/pages/thx.vue @@ -18,7 +18,7 @@