diff --git a/frontend/src/components/Inputs/InputEmail.vue b/frontend/src/components/Inputs/InputEmail.vue index 41338fd8c..2aa153486 100644 --- a/frontend/src/components/Inputs/InputEmail.vue +++ b/frontend/src/components/Inputs/InputEmail.vue @@ -6,22 +6,19 @@ v-slot="{ errors, valid, validated, ariaInput, ariaMsg }" > - - - - {{ errors[0] }} - - + + + {{ errors[0] }} + @@ -62,12 +59,3 @@ export default { }, } - diff --git a/frontend/src/components/Inputs/InputPassword.vue b/frontend/src/components/Inputs/InputPassword.vue index 6b72f0b01..15ce116c9 100644 --- a/frontend/src/components/Inputs/InputPassword.vue +++ b/frontend/src/components/Inputs/InputPassword.vue @@ -19,7 +19,11 @@ :state="validated ? valid : false" > - + diff --git a/frontend/src/components/Inputs/InputPasswordConfirmation.vue b/frontend/src/components/Inputs/InputPasswordConfirmation.vue index 08efaccfd..19d4ab02e 100644 --- a/frontend/src/components/Inputs/InputPasswordConfirmation.vue +++ b/frontend/src/components/Inputs/InputPasswordConfirmation.vue @@ -10,11 +10,11 @@ containsNumericCharacter: true, atLeastEightCharactera: true, }" - :label="$t('form.password_new')" + :label="register ? $t('form.password') : $t('form.password_new')" :showAllErrors="true" :immediate="true" - :name="$t('form.password_new')" - :placeholder="$t('form.password_new')" + :name="createId(register ? $t('form.password') : $t('form.password_new'))" + :placeholder="register ? $t('form.password') : $t('form.password_new')" v-model="password" > @@ -23,8 +23,9 @@ @@ -44,6 +45,10 @@ export default { type: Object, required: true, }, + register: { + type: Boolean, + required: false, + }, }, data() { return { @@ -51,6 +56,11 @@ export default { passwordRepeat: '', } }, + methods: { + createId(text) { + return text.replace(/ +/g, '-') + }, + }, computed: { passwordObject() { return { password: this.password, passwordRepeat: this.passwordRepeat } diff --git a/frontend/src/components/SidebarPlugin/SideBar.vue b/frontend/src/components/SidebarPlugin/SideBar.vue index 495dec3d2..c3f991297 100755 --- a/frontend/src/components/SidebarPlugin/SideBar.vue +++ b/frontend/src/components/SidebarPlugin/SideBar.vue @@ -16,7 +16,11 @@ diff --git a/frontend/src/views/Pages/Register.spec.js b/frontend/src/views/Pages/Register.spec.js index 85f3ca38f..b200eb397 100644 --- a/frontend/src/views/Pages/Register.spec.js +++ b/frontend/src/views/Pages/Register.spec.js @@ -61,15 +61,15 @@ describe('Register', () => { }) it('has email input fields', () => { - expect(wrapper.find('#registerEmail').exists()).toBeTruthy() + expect(wrapper.find('#Email-input-field').exists()).toBeTruthy() }) it('has password input fields', () => { - expect(wrapper.find('#registerPassword').exists()).toBeTruthy() + expect(wrapper.find('input[name="form.password"]').exists()).toBeTruthy() }) it('has password repeat input fields', () => { - expect(wrapper.find('#registerPasswordRepeat').exists()).toBeTruthy() + expect(wrapper.find('input[name="form.passwordRepeat"]').exists()).toBeTruthy() }) it('has 1 checkbox input fields', () => { @@ -80,30 +80,31 @@ describe('Register', () => { expect(wrapper.find('button[type="submit"]').exists()).toBe(false) }) - it('shows a warning when no valid Email is entered', async () => { - wrapper.find('#registerEmail').setValue('no_valid@Email') + it('displays a message that Email is required', async () => { + await wrapper.find('form').trigger('submit') await flushPromises() - await expect(wrapper.find('#registerEmailLiveFeedback').text()).toEqual( - 'validations.messages.email', + expect(wrapper.findAll('div.invalid-feedback').at(0).text()).toBe( + 'validations.messages.required', ) }) - it('shows 4 warnings when no password is set', async () => { - const passwords = wrapper.findAll('input[type="password"]') - passwords.at(0).setValue('') - passwords.at(1).setValue('') + it('displays a message that password is required', async () => { + await wrapper.find('form').trigger('submit') await flushPromises() - await expect(wrapper.find('div.hints').text()).toContain( - 'site.signup.lowercase', - 'site.signup.uppercase', - 'site.signup.minimum', - 'site.signup.one_number', + expect(wrapper.findAll('div.invalid-feedback').at(1).text()).toBe( + 'validations.messages.required', ) }) - // TODO test different invalid password combinations + it('displays a message that passwordConfirm is required', async () => { + await wrapper.find('form').trigger('submit') + await flushPromises() + expect(wrapper.findAll('div.invalid-feedback').at(2).text()).toBe( + 'validations.messages.required', + ) + }) }) - // TODO test submit button + // To Do: Test lines 156-197,210-213 }) }) diff --git a/frontend/src/views/Pages/Register.vue b/frontend/src/views/Pages/Register.vue index 7f475ebae..b0b2e4cd6 100755 --- a/frontend/src/views/Pages/Register.vue +++ b/frontend/src/views/Pages/Register.vue @@ -76,99 +76,14 @@ - - - - - - {{ validationContext.errors[0] }} - - - +
+ - - - - - - - - - - - - - {{ validationContext.errors[0] }} - - - - - - - - - - - - - - - - - -
- -
-
-

- {{ $t('site.signup.dont_match') }} - -

-
-
-
+
{{ $t('form.reset') }} {{ $t('signup') }} @@ -224,8 +129,11 @@ diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index 66a3dcfe5..be565333a 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -26,7 +26,7 @@ - +
{{ $t('reset') }} @@ -65,6 +65,7 @@ export default { sessionId: null, email: null, pending: true, + register: false, } }, methods: { diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue index 7921f4037..74dc87ddb 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue @@ -28,7 +28,7 @@ > - +
@@ -66,6 +66,7 @@ export default { passwordRepeat: '', }, }, + register: false, } }, methods: {