File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
common-ui/src/components/auth Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11<template >
22 <v-card >
3- <v-card-title v-if = " !registrationRoute " class =" text-h5 bg-grey-lighten-2" > Create an Account </v-card-title >
3+ <v-card-title class =" text-h5 bg-grey-lighten-2" > Create an Account </v-card-title >
44
55 <v-card-text >
66 <v-form @submit.prevent =" createUser" >
4444 name =" retypedPassword"
4545 hover =" Show password"
4646 label =" Retype your password"
47- hint =" "
47+ :disabled =" password === '' || !!passwordError"
48+ :hint =" passwordRetypeError"
4849 min =" 4"
4950 :type =" passwordVisible ? 'text' : 'password'"
5051 ></v-text-field >
5859 <v-btn color =" pink" variant =" text" @click =" badLoginAttempt = false" > Close </v-btn >
5960 </v-snackbar >
6061 <v-btn
61- class =" mr-2"
62+ class =" mr-2 my-2 "
6263 type =" submit"
6364 :loading =" awaitingResponse"
6465 :color =" buttonStatus.color"
@@ -135,6 +136,14 @@ export default defineComponent({
135136 passwordError(): string {
136137 return validatePassword (this .password );
137138 },
139+ passwordRetypeError(): string {
140+ console .log (' [RTE]' );
141+ if (this .password !== this .retypedPassword ) {
142+ return ' Passwords must match.' ;
143+ } else {
144+ return ' ' ;
145+ }
146+ },
138147 },
139148
140149 async created() {
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ describe('User Registration', () => {
5858 cy . contains ( 'button' , 'Create Account' ) . should ( 'be.disabled' ) ;
5959
6060 // Assert that an error message about password mismatch is displayed
61- cy . contains ( 'Passwords do not match' ) . should ( 'be.visible' ) ;
61+ cy . contains ( 'Passwords must match' ) . should ( 'be.visible' ) ;
6262
6363 // Assert that we're still on the registration page
6464 cy . url ( ) . should ( 'not.include' , `/u/${ username } ` ) ;
You can’t perform that action at this time.
0 commit comments