feat: keep empty cells consistent empty
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
carla 2026-02-26 13:37:35 +01:00
parent 9751525a0c
commit 4ac56958b4
18 changed files with 263 additions and 372 deletions

View file

@ -210,7 +210,9 @@ defmodule MvWeb.UserLive.IndexTest do
end
describe "Password column display" do
test "user without password shows em dash in Password column", %{conn: conn} do
test "user without password shows empty cell with sr-only text in Password column", %{
conn: conn
} do
# User created with hashed_password: nil (no password) - must not get default password
user_no_pw =
create_test_user(%{
@ -223,9 +225,13 @@ defmodule MvWeb.UserLive.IndexTest do
assert html =~ "no-password@example.com"
# Password column must show "—" (em dash) for user without password, not "Enabled"
# Password column: visually empty, screen-reader gets "Not set" (Design Guidelines §8.6)
row = view |> element("tr#row-#{user_no_pw.id}") |> render()
assert row =~ "", "Password column should show em dash for user without password"
assert row =~ "sr-only", "Password column should have sr-only text for accessibility"
assert row =~ "Not set", "Screen reader should get 'Not set' for empty password"
refute row =~ "",
"Password column must not show dash (use empty cell + sr-only per CODE_GUIDELINES §8)"
refute row =~ "Enabled",
"Password column must not show Enabled when user has no password"