From fd409252cbb49a3d0273f799e85afa766e0ad69c Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 10 Jan 2022 10:45:41 +0100 Subject: [PATCH] get the test working --- frontend/src/views/Pages/ResetPassword.spec.js | 3 +++ frontend/src/views/Pages/ResetPassword.vue | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index f3bbc7334..e28d16c3e 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -28,6 +28,9 @@ const createMockObject = (comingFrom) => { optin: '123', comingFrom, }, + path: { + includes: (t) => t, + }, }, $toasted: { global: { diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index c227eeabe..05d8a0f6e 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -95,15 +95,12 @@ export default { this.$router.push('/thx/reset') }) .catch((error) => { - if (error.message.includes('Code is older than 10 minutes')) { - this.$toasted.global.error(error.message) + this.$toasted.global.error(error.message) + if (error.message.includes('Code is older than 10 minutes')) this.$router.push('/password/reset') - } else { - this.$toasted.global.error(error.message) - } }) }, - setDisplaySetup(from) { + setDisplaySetup() { if (this.$route.path.includes('checkEmail')) { this.displaySetup = textFields.checkEmail }