Add a text to the show password link in management area
We were using an icon for this link, but people who can't see the icon couldn't know what the link was about. Axe was reporting the following accessibility error: ``` link-name: Links must have discernible text (serious) https://dequeuniversity.com/rules/axe/4.10/link-name?application=axeAPI The following 1 node violate this rule: Selector: .show-password HTML: <a href="#" class="show-password"> <span class="icon-eye"></span> </a> Fix all of the following: - Element is in tab order and does not have accessible text Fix any of the following: - Element does not have text that is visible to screen readers - aria-label attribute does not exist or is empty - aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty - Element has no title attribute ```
This commit is contained in:
@@ -10,7 +10,10 @@
|
||||
<div class="input-group">
|
||||
<%= f.password_field :password, class: "input-group-field", label: false, value: nil %>
|
||||
<span class="input-group-label">
|
||||
<a href="#" class="show-password"><span class="icon-eye"></span></a>
|
||||
<a href="#" class="show-password">
|
||||
<span class="icon-eye"></span>
|
||||
<span class="show-for-sr"><%= t("management.account.edit.password.show") %></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ en:
|
||||
reseted: Password reseted successfully
|
||||
random: Generate random password
|
||||
save: Save password
|
||||
show: Show password
|
||||
print: Print password
|
||||
print_help: You will be able to print the password when it is saved.
|
||||
account_info:
|
||||
|
||||
@@ -18,6 +18,7 @@ es:
|
||||
reseted: Contraseña restablecida correctamente
|
||||
random: Generar contraseña aleatoria
|
||||
save: Guardar contraseña
|
||||
show: Mostrar contraseña
|
||||
print: Imprimir contraseña
|
||||
print_help: Podrás imprimir la contraseña cuando se haya guardado.
|
||||
account_info:
|
||||
|
||||
@@ -59,6 +59,16 @@ describe "Account" do
|
||||
|
||||
new_password = find_field("user_password").value
|
||||
|
||||
expect(page).to have_field "Password", type: :password
|
||||
|
||||
click_link "Show password"
|
||||
|
||||
expect(page).to have_field "Password", type: :text
|
||||
|
||||
click_link "Show password"
|
||||
|
||||
expect(page).to have_field "Password", type: :password
|
||||
|
||||
click_button "Save password"
|
||||
|
||||
expect(page).to have_content "Password reseted successfully"
|
||||
|
||||
Reference in New Issue
Block a user