File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed
client/modules/User/components
translations/locales/en-US Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,11 @@ export function LoginForm() {
8787 className = "form__eye__icon"
8888 type = "button"
8989 onClick = { handleVisibility }
90- aria-hidden = "true"
90+ aria-label = { t (
91+ showPassword
92+ ? 'LoginForm.HidePasswordARIA'
93+ : 'LoginForm.ShowPasswordARIA'
94+ ) }
9195 >
9296 { showPassword ? (
9397 < AiOutlineEyeInvisible />
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ describe('<LoginForm/>', () => {
4747 const passwordTextElement = screen . getByText ( / p a s s w o r d / i) ;
4848 expect ( passwordTextElement ) . toBeInTheDocument ( ) ;
4949
50- const passwordInputElement = screen . getByLabelText ( / p a s s w o r d / i) ;
50+ const passwordInputElement = screen . getByLabelText ( / ^ p a s s w o r d $ / i) ;
5151 expect ( passwordInputElement ) . toBeInTheDocument ( ) ;
5252
5353 const loginButtonElement = screen . getByRole ( 'button' , {
@@ -67,7 +67,7 @@ describe('<LoginForm/>', () => {
6767 }
6868 } ) ;
6969
70- const passwordElement = screen . getByLabelText ( / p a s s w o r d / i) ;
70+ const passwordElement = screen . getByLabelText ( / ^ p a s s w o r d $ / i) ;
7171
7272 fireEvent . change ( passwordElement , {
7373 target : {
Original file line number Diff line number Diff line change @@ -158,7 +158,11 @@ export function SignupForm() {
158158 className = "form__eye__icon"
159159 type = "button"
160160 onClick = { handleVisibility }
161- aria-hidden = "true"
161+ aria-label = { t (
162+ showPassword
163+ ? 'SignupForm.HidePasswordARIA'
164+ : 'SignupForm.ShowPasswordARIA'
165+ ) }
162166 >
163167 { showPassword ? (
164168 < AiOutlineEyeInvisible />
@@ -194,7 +198,11 @@ export function SignupForm() {
194198 className = "form__eye__icon"
195199 type = "button"
196200 onClick = { handleConfirmVisibility }
197- aria-hidden = "true"
201+ aria-label = { t (
202+ showConfirmPassword
203+ ? 'SignupForm.HideConfirmPasswordARIA'
204+ : 'SignupForm.ShowConfirmPasswordARIA'
205+ ) }
198206 >
199207 { showConfirmPassword ? (
200208 < AiOutlineEyeInvisible />
Original file line number Diff line number Diff line change 7878 "UsernameOrEmailARIA" : " Email or Username" ,
7979 "Password" : " Password" ,
8080 "PasswordARIA" : " Password" ,
81+ "ShowPasswordARIA" : " Show password as plain text" ,
82+ "HidePasswordARIA" : " Hide password" ,
8183 "Submit" : " Log In" ,
8284 "Errors" : {
8385 "invalidCredentials" : " Invalid email or password."
427429 "EmailARIA" : " email" ,
428430 "Password" : " Password" ,
429431 "PasswordARIA" : " password" ,
432+ "ShowPasswordARIA" : " Show password as plain text" ,
433+ "HidePasswordARIA" : " Hide password" ,
430434 "ConfirmPassword" : " Confirm Password" ,
431435 "ConfirmPasswordARIA" : " Confirm password" ,
436+ "ShowConfirmPasswordARIA" : " Show confirm password as plain text" ,
437+ "HideConfirmPasswordARIA" : " Hide confirm password" ,
432438 "SubmitSignup" : " Sign Up"
433439 },
434440 "SignupView" : {
You can’t perform that action at this time.
0 commit comments