From 078c117f6ee00f36be24b4d7986fc44764e51bd4 Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 21 Jan 2022 07:35:33 +0100 Subject: [PATCH 01/18] Changed the toasted message for successful creating a creation. --- admin/src/pages/CreationConfirm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 578c9b23f..5a46c4d45 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -75,7 +75,7 @@ export default { case 'confirmed': this.confirmResult.splice(index, 1) this.$store.commit('openCreationsMinus', 1) - this.$toasted.success('Pending Creation has been deleted') + this.$toasted.success('Creation has been created') break default: this.$toasted.error('Case ' + event + ' is not supported') From 397f1f9d67d99f748ed5bdb7919069b4eda0b89a Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 21 Jan 2022 07:41:11 +0100 Subject: [PATCH 02/18] Change the test to match the new toasted message. --- admin/src/pages/CreationConfirm.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/pages/CreationConfirm.spec.js b/admin/src/pages/CreationConfirm.spec.js index 14a71bb78..024910be8 100644 --- a/admin/src/pages/CreationConfirm.spec.js +++ b/admin/src/pages/CreationConfirm.spec.js @@ -189,7 +189,7 @@ describe('CreationConfirm', () => { }) it('toasts a success message', () => { - expect(toastedSuccessMock).toBeCalledWith('Pending Creation has been deleted') + expect(toastedSuccessMock).toBeCalledWith('Creation has been created') }) }) From 78cdab5edc08f8a642755a2ed4ba0699551120b6 Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 21 Jan 2022 08:24:33 +0100 Subject: [PATCH 03/18] Added a required to the password repeat field, errors are shown immediatly on password repeat --- .../src/components/Inputs/InputPasswordConfirmation.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Inputs/InputPasswordConfirmation.vue b/frontend/src/components/Inputs/InputPasswordConfirmation.vue index ecb3aa55a..8154984ef 100644 --- a/frontend/src/components/Inputs/InputPasswordConfirmation.vue +++ b/frontend/src/components/Inputs/InputPasswordConfirmation.vue @@ -24,8 +24,12 @@ Date: Fri, 21 Jan 2022 11:36:50 +0100 Subject: [PATCH 04/18] check array and send the correct parameters to the thx page --- frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- frontend/src/views/Pages/ResetPassword.vue | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 651944547..d92f42f5d 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -198,7 +198,7 @@ }, "thx": { "activateEmail": "Dein Konto wurde noch nicht aktiviert. Bitte überprüfe deine E-Mail und klicke den Aktivierungslink!", - "checkEmail": "Deine E-Mail wurde erfolgreich verifiziert.", + "checkEmail": "Deine E-Mail wurde erfolgreich verifiziert. Du kannst dich jetzt anmelden.", "email": "Wir haben dir eine E-Mail gesendet.", "emailActivated": "Danke dass Du deine E-Mail bestätigt hast.", "errorTitle": "Achtung!", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index c6cbeed69..014d449a0 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -198,7 +198,7 @@ }, "thx": { "activateEmail": "Your account has not been activated yet, please check your emails and click the activation link!", - "checkEmail": "Your email has been successfully verified.", + "checkEmail": "Your email has been successfully verified. You can sign in now.", "email": "We have sent you an email.", "emailActivated": "Thank you your email has been activated.", "errorTitle": "Attention!", diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index 05d8a0f6e..db4e0d6c8 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -92,7 +92,11 @@ export default { }) .then(() => { this.form.password = '' - this.$router.push('/thx/reset') + if (textFields.checkEmail) { + this.$router.push('/thx/checkEmail') + } else { + this.$router.push('/thx/reset') + } }) .catch((error) => { this.$toasted.global.error(error.message) From 40021fb46fdba96825f0bf197d1fe020779a309f Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 21 Jan 2022 13:15:34 +0100 Subject: [PATCH 05/18] check on the checkMail page which url path is attached --- frontend/src/views/Pages/ResetPassword.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index db4e0d6c8..69bc9e533 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -92,9 +92,10 @@ export default { }) .then(() => { this.form.password = '' - if (textFields.checkEmail) { + if (this.$route.path.includes('checkEmail')) { this.$router.push('/thx/checkEmail') - } else { + } + if (this.$route.path.includes('reset')) { this.$router.push('/thx/reset') } }) From 67df6952275b0c5c9d848e8f1ebb0c0ade69edae Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 21 Jan 2022 13:19:36 +0100 Subject: [PATCH 06/18] Localized the CreationConfirm toasted messages. --- admin/src/locales/de.json | 5 ++++- admin/src/locales/en.json | 5 ++++- admin/src/pages/CreationConfirm.spec.js | 6 +++--- admin/src/pages/CreationConfirm.vue | 6 +++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 111d6823f..5c9ef1713 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -13,7 +13,10 @@ "submit_creation": "Schöpfung einreichen", "toasted": "Offene Schöpfung ({value} GDD) für {email} wurde gespeichert und liegt zur Bestätigung bereit", "toasted_update": "`Offene Schöpfung {value} GDD) für {email} wurde geändert und liegt zur Bestätigung bereit", - "update_creation": "Schöpfung aktualisieren" + "update_creation": "Schöpfung aktualisieren", + "toasted_delete": "Offene Schöpfung wurde gelöscht", + "toasted_created": "Schöpfung wurde erfolgreich erstellt", + "toasted_default": "`Case {event} is not supported`" }, "details": "Details", "e_mail": "E-Mail", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index d412ecfcb..036c1892b 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -13,7 +13,10 @@ "submit_creation": "Submit creation", "toasted": "Open creation ({value} GDD) for {email} has been saved and is ready for confirmation.", "toasted_update": "Open creation {value} GDD) for {email} has been changed and is ready for confirmation.", - "update_creation": "Creation update" + "update_creation": "Creation update", + "toasted_delete": "Open creation has been deleted", + "toasted_created": "Creation has been successfully created", + "toasted_default": "`Case {event} is not supported`" }, "details": "Details", "e_mail": "E-Mail", diff --git a/admin/src/pages/CreationConfirm.spec.js b/admin/src/pages/CreationConfirm.spec.js index 024910be8..cc0a096da 100644 --- a/admin/src/pages/CreationConfirm.spec.js +++ b/admin/src/pages/CreationConfirm.spec.js @@ -127,7 +127,7 @@ describe('CreationConfirm', () => { }) it('toasts a success message', () => { - expect(toastedSuccessMock).toBeCalledWith('Pending Creation has been deleted') + expect(toastedSuccessMock).toBeCalledWith('creation_form.toasted_delete') }) }) @@ -189,7 +189,7 @@ describe('CreationConfirm', () => { }) it('toasts a success message', () => { - expect(toastedSuccessMock).toBeCalledWith('Creation has been created') + expect(toastedSuccessMock).toBeCalledWith('creation_form.toasted_created') }) }) @@ -201,7 +201,7 @@ describe('CreationConfirm', () => { }) it('toasts an error message', () => { - expect(toastedErrorMock).toBeCalledWith('Case confirm is not supported') + expect(toastedErrorMock).toBeCalledWith('creation_form.toasted_default') }) }) diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 5a46c4d45..bfb3100aa 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -66,7 +66,7 @@ export default { index = this.confirmResult.indexOf(findArr) this.confirmResult.splice(index, 1) this.$store.commit('openCreationsMinus', 1) - this.$toasted.success('Pending Creation has been deleted') + this.$toasted.success(this.$t('creation_form.toasted_delete')) }) .catch((error) => { this.$toasted.error(error.message) @@ -75,10 +75,10 @@ export default { case 'confirmed': this.confirmResult.splice(index, 1) this.$store.commit('openCreationsMinus', 1) - this.$toasted.success('Creation has been created') + this.$toasted.success(this.$t('creation_form.toasted_created')) break default: - this.$toasted.error('Case ' + event + ' is not supported') + this.$toasted.error(this.$t('creation_form.toasted_default', { event })) } }, getPendingCreations() { From 6ea44890dd38cd6a44d565aec6e328d4d054ed6f Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 21 Jan 2022 15:25:32 +0100 Subject: [PATCH 07/18] Locales where not ordered. yarn locales --fix changes. --- admin/src/locales/de.json | 8 ++++---- admin/src/locales/en.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 5c9ef1713..9042cd400 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -12,11 +12,11 @@ "select_value": "Betrag auswählen", "submit_creation": "Schöpfung einreichen", "toasted": "Offene Schöpfung ({value} GDD) für {email} wurde gespeichert und liegt zur Bestätigung bereit", - "toasted_update": "`Offene Schöpfung {value} GDD) für {email} wurde geändert und liegt zur Bestätigung bereit", - "update_creation": "Schöpfung aktualisieren", - "toasted_delete": "Offene Schöpfung wurde gelöscht", "toasted_created": "Schöpfung wurde erfolgreich erstellt", - "toasted_default": "`Case {event} is not supported`" + "toasted_default": "`Case {event} is not supported`", + "toasted_delete": "Offene Schöpfung wurde gelöscht", + "toasted_update": "`Offene Schöpfung {value} GDD) für {email} wurde geändert und liegt zur Bestätigung bereit", + "update_creation": "Schöpfung aktualisieren" }, "details": "Details", "e_mail": "E-Mail", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index 036c1892b..360c3c9c9 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -12,11 +12,11 @@ "select_value": "Select amount", "submit_creation": "Submit creation", "toasted": "Open creation ({value} GDD) for {email} has been saved and is ready for confirmation.", - "toasted_update": "Open creation {value} GDD) for {email} has been changed and is ready for confirmation.", - "update_creation": "Creation update", - "toasted_delete": "Open creation has been deleted", "toasted_created": "Creation has been successfully created", - "toasted_default": "`Case {event} is not supported`" + "toasted_default": "`Case {event} is not supported`", + "toasted_delete": "Open creation has been deleted", + "toasted_update": "Open creation {value} GDD) for {email} has been changed and is ready for confirmation.", + "update_creation": "Creation update" }, "details": "Details", "e_mail": "E-Mail", From 14e51b9f8705dcf4e37b2fca4c5bdbc778a9f75e Mon Sep 17 00:00:00 2001 From: Alexander Friedland Date: Fri, 21 Jan 2022 19:01:12 +0100 Subject: [PATCH 08/18] Update frontend/src/views/Pages/ResetPassword.vue Co-authored-by: Hannes Heine --- frontend/src/views/Pages/ResetPassword.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index 69bc9e533..f0ed0c348 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -94,8 +94,7 @@ export default { this.form.password = '' if (this.$route.path.includes('checkEmail')) { this.$router.push('/thx/checkEmail') - } - if (this.$route.path.includes('reset')) { + } else if (this.$route.path.includes('reset')) { this.$router.push('/thx/reset') } }) From 3132708204fc13a983890e300cda561a1210e377 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Sat, 22 Jan 2022 09:01:35 +0100 Subject: [PATCH 09/18] Update admin/src/locales/en.json --- admin/src/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index 360c3c9c9..47f98bf94 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -12,7 +12,7 @@ "select_value": "Select amount", "submit_creation": "Submit creation", "toasted": "Open creation ({value} GDD) for {email} has been saved and is ready for confirmation.", - "toasted_created": "Creation has been successfully created", + "toasted_created": " Creation has been successfully saved", "toasted_default": "`Case {event} is not supported`", "toasted_delete": "Open creation has been deleted", "toasted_update": "Open creation {value} GDD) for {email} has been changed and is ready for confirmation.", From 9b4510101f2efc01fe99448599e6d72ca817fea9 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Sat, 22 Jan 2022 09:01:58 +0100 Subject: [PATCH 10/18] Update admin/src/locales/de.json --- admin/src/locales/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 9042cd400..dc474e876 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -12,7 +12,7 @@ "select_value": "Betrag auswählen", "submit_creation": "Schöpfung einreichen", "toasted": "Offene Schöpfung ({value} GDD) für {email} wurde gespeichert und liegt zur Bestätigung bereit", - "toasted_created": "Schöpfung wurde erfolgreich erstellt", + "toasted_created": "Schöpfung wurde erfolgreich gespeichert", "toasted_default": "`Case {event} is not supported`", "toasted_delete": "Offene Schöpfung wurde gelöscht", "toasted_update": "`Offene Schöpfung {value} GDD) für {email} wurde geändert und liegt zur Bestätigung bereit", From 5f5ae03042c08540830375ee1b59f218c005f1f0 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Sat, 22 Jan 2022 09:02:13 +0100 Subject: [PATCH 11/18] Update admin/src/locales/de.json --- admin/src/locales/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index dc474e876..b1a008eaf 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -13,7 +13,7 @@ "submit_creation": "Schöpfung einreichen", "toasted": "Offene Schöpfung ({value} GDD) für {email} wurde gespeichert und liegt zur Bestätigung bereit", "toasted_created": "Schöpfung wurde erfolgreich gespeichert", - "toasted_default": "`Case {event} is not supported`", + "toasted_default": "`Fall {event} wird nicht unterstützt`", "toasted_delete": "Offene Schöpfung wurde gelöscht", "toasted_update": "`Offene Schöpfung {value} GDD) für {email} wurde geändert und liegt zur Bestätigung bereit", "update_creation": "Schöpfung aktualisieren" From a72d1ed3c75078da5b385030f574f7669e49c950 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Sat, 22 Jan 2022 09:02:45 +0100 Subject: [PATCH 12/18] Update admin/src/locales/en.json --- admin/src/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index 47f98bf94..2d2df4461 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -12,7 +12,7 @@ "select_value": "Select amount", "submit_creation": "Submit creation", "toasted": "Open creation ({value} GDD) for {email} has been saved and is ready for confirmation.", - "toasted_created": " Creation has been successfully saved", + "toasted_created": "Creation has been successfully saved", "toasted_default": "`Case {event} is not supported`", "toasted_delete": "Open creation has been deleted", "toasted_update": "Open creation {value} GDD) for {email} has been changed and is ready for confirmation.", From e17d1b34e2a90a3cd801d56f7d2dc86e8b276b09 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sat, 22 Jan 2022 10:09:04 +0100 Subject: [PATCH 13/18] test fixed for checkMail --- frontend/src/views/Pages/ResetPassword.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index e28d16c3e..4c45e7c2e 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -190,7 +190,7 @@ describe('ResetPassword', () => { }) it('redirects to "/thx/reset"', () => { - expect(routerPushMock).toHaveBeenCalledWith('/thx/reset') + expect(routerPushMock).toHaveBeenCalledWith('/thx/checkEmail') }) }) }) From 0bffe9d63ee10372d962d58e5d9966b3b1da063c Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 24 Jan 2022 12:43:04 +0100 Subject: [PATCH 14/18] change text for test checkMail --- frontend/src/views/Pages/ResetPassword.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index 4c45e7c2e..b86d37bc4 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -189,7 +189,7 @@ describe('ResetPassword', () => { ) }) - it('redirects to "/thx/reset"', () => { + it('redirects to "/thx/heckEmail"', () => { expect(routerPushMock).toHaveBeenCalledWith('/thx/checkEmail') }) }) From 65d23548177205f0e85bbddb75f8f80125684db1 Mon Sep 17 00:00:00 2001 From: Alexander Friedland Date: Mon, 24 Jan 2022 15:58:36 +0100 Subject: [PATCH 15/18] Update frontend/src/views/Pages/ResetPassword.spec.js Co-authored-by: Moriz Wahl --- frontend/src/views/Pages/ResetPassword.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index b86d37bc4..d6319086c 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -189,7 +189,7 @@ describe('ResetPassword', () => { ) }) - it('redirects to "/thx/heckEmail"', () => { + it('redirects to "/thx/checkEmail"', () => { expect(routerPushMock).toHaveBeenCalledWith('/thx/checkEmail') }) }) From d0fdd57b7d241058d41ada30ab44e30627f5cb13 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 24 Jan 2022 16:25:40 +0100 Subject: [PATCH 16/18] bold text if acive page --- frontend/src/components/Menu/Sidebar.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index 18ee08dbf..67e3a7d25 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -4,7 +4,7 @@

- + {{ $t('overview') }} @@ -52,3 +52,8 @@ export default { }, } + From 9df3ca7c01a3a79e7aaf63a971be2f780f7baff0 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 24 Jan 2022 16:42:09 +0100 Subject: [PATCH 17/18] mock path to have differnet include results --- .../src/views/Pages/ResetPassword.spec.js | 126 +++++++++++------- frontend/src/views/Pages/ResetPassword.vue | 2 +- 2 files changed, 81 insertions(+), 47 deletions(-) diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index d6319086c..da8b4bc4f 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -15,54 +15,48 @@ const stubs = { RouterLink: RouterLinkStub, } -const createMockObject = (comingFrom) => { - return { - localVue, - mocks: { - $i18n: { - locale: 'en', - }, - $t: jest.fn((t) => t), - $route: { - params: { - optin: '123', - comingFrom, - }, - path: { - includes: (t) => t, - }, - }, - $toasted: { - global: { - error: toasterMock, - }, - }, - $router: { - push: routerPushMock, - }, - $loading: { - show: jest.fn(() => { - return { hide: jest.fn() } - }), - }, - $apollo: { - mutate: apolloMutationMock, - }, +const mocks = { + $i18n: { + locale: 'en', + }, + $t: jest.fn((t) => t), + $route: { + params: { + optin: '123', }, - stubs, - } + path: { + mock: 'checkEmail', + includes: jest.fn((t) => t === mocks.$route.path.mock), + }, + }, + $toasted: { + global: { + error: toasterMock, + }, + }, + $router: { + push: routerPushMock, + }, + $loading: { + show: jest.fn(() => { + return { hide: jest.fn() } + }), + }, + $apollo: { + mutate: apolloMutationMock, + }, } describe('ResetPassword', () => { let wrapper - const Wrapper = (functionName) => { - return mount(ResetPassword, functionName) + const Wrapper = () => { + return mount(ResetPassword, { localVue, mocks, stubs }) } describe('mount', () => { beforeEach(() => { - wrapper = Wrapper(createMockObject()) + wrapper = Wrapper() }) describe('No valid optin', () => { @@ -86,11 +80,32 @@ describe('ResetPassword', () => { }) describe('Register header', () => { - it('has a welcome message', async () => { - expect(wrapper.find('div.header').text()).toContain('settings.password.reset') - expect(wrapper.find('div.header').text()).toContain( - 'settings.password.reset-password.text', - ) + describe('from reset', () => { + beforeEach(() => { + mocks.$route.path.mock = 'reset' + wrapper = Wrapper() + }) + + it('has a welcome message', async () => { + expect(wrapper.find('div.header').text()).toContain('settings.password.reset') + expect(wrapper.find('div.header').text()).toContain( + 'settings.password.reset-password.text', + ) + }) + }) + + describe('from checkEmail', () => { + beforeEach(() => { + mocks.$route.path.mock = 'checkEmail' + wrapper = Wrapper() + }) + + it('has a welcome message', async () => { + expect(wrapper.find('div.header').text()).toContain('settings.password.set') + expect(wrapper.find('div.header').text()).toContain( + 'settings.password.set-password.text', + ) + }) }) }) @@ -128,7 +143,6 @@ describe('ResetPassword', () => { describe('submit form', () => { beforeEach(async () => { - // wrapper = Wrapper(createMockObject()) await wrapper.findAll('input').at(0).setValue('Aa123456_') await wrapper.findAll('input').at(1).setValue('Aa123456_') await flushPromises() @@ -164,14 +178,14 @@ describe('ResetPassword', () => { }) }) - describe('server response with success', () => { + describe('server response with success on /checkEmail', () => { beforeEach(async () => { + mocks.$route.path.mock = 'checkEmail' apolloMutationMock.mockResolvedValue({ data: { resetPassword: 'success', }, }) - wrapper = Wrapper(createMockObject('checkEmail')) await wrapper.findAll('input').at(0).setValue('Aa123456_') await wrapper.findAll('input').at(1).setValue('Aa123456_') await wrapper.find('form').trigger('submit') @@ -193,6 +207,26 @@ describe('ResetPassword', () => { expect(routerPushMock).toHaveBeenCalledWith('/thx/checkEmail') }) }) + + describe('server response with success on /reset', () => { + beforeEach(async () => { + mocks.$route.path.mock = 'reset' + wrapper = Wrapper() + apolloMutationMock.mockResolvedValue({ + data: { + resetPassword: 'success', + }, + }) + await wrapper.findAll('input').at(0).setValue('Aa123456_') + await wrapper.findAll('input').at(1).setValue('Aa123456_') + await wrapper.find('form').trigger('submit') + await flushPromises() + }) + + it('redirects to "/thx/reset"', () => { + expect(routerPushMock).toHaveBeenCalledWith('/thx/reset') + }) + }) }) }) }) diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index f0ed0c348..0023c3838 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -94,7 +94,7 @@ export default { this.form.password = '' if (this.$route.path.includes('checkEmail')) { this.$router.push('/thx/checkEmail') - } else if (this.$route.path.includes('reset')) { + } else { this.$router.push('/thx/reset') } }) From 1be4d83a3648cdbb63b0feda9260c0a69f61dc87 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 24 Jan 2022 16:58:03 +0100 Subject: [PATCH 18/18] change css for twi elements, sidebar and navbar active only --- frontend/src/components/Menu/Sidebar.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index 67e3a7d25..20943d14a 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -53,7 +53,8 @@ export default { }