fix: implement review comments
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-02-16 15:30:16 +01:00
parent 65581d0639
commit ace59bbae6
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
7 changed files with 43 additions and 37 deletions

View file

@ -145,8 +145,10 @@ defmodule MvWeb.MemberLive.IndexCustomFieldsSortingTest do
|> element("[data-testid='custom_field_#{field.id}']")
|> render_click()
# Check URL was updated
assert_patch(view, "/members?query=&sort_field=custom_field_#{field.id}&sort_order=desc")
# Check URL was updated (param order may vary)
path = assert_patch(view)
assert path =~ "sort_order=desc"
assert path =~ "sort_field=custom_field_#{field.id}"
# Verify sort state
assert has_element?(view, "[data-testid='custom_field_#{field.id}'][aria-label='descending']")

View file

@ -52,9 +52,8 @@ defmodule MvWeb.MemberLive.IndexGroupsAccessibilityTest do
conn = conn_with_oidc_user(conn)
{:ok, view, html} = live(conn, "/members")
# Verify badges have accessibility attributes
# Badges should have role="status" and aria-label describing the group
assert html =~ ~r/role=["']status["']/ or html =~ ~r/aria-label=.*#{group1.name}/
# Verify badges have role="status" and aria-label containing the group name
assert has_element?(view, "span[role='status'][aria-label*='#{group1.name}']")
assert html =~ group1.name
# Verify member1's row contains the badge
@ -84,12 +83,10 @@ defmodule MvWeb.MemberLive.IndexGroupsAccessibilityTest do
conn: conn
} do
conn = conn_with_oidc_user(conn)
{:ok, view, html} = live(conn, "/members")
{:ok, view, _html} = live(conn, "/members")
# Verify sort header has aria-label
# Sort header should have aria-label describing the sort state
assert html =~ ~r/aria-label=.*[Gg]roup/ or
has_element?(view, "[data-testid='groups'][aria-label]")
# Verify sort header has aria-label describing the sort state
assert has_element?(view, "[data-testid='groups'][aria-label]")
end
@tag :ui
@ -170,7 +167,7 @@ defmodule MvWeb.MemberLive.IndexGroupsAccessibilityTest do
|> Ash.create(actor: system_actor)
conn = conn_with_oidc_user(conn)
{:ok, view, html} = live(conn, "/members")
{:ok, _view, html} = live(conn, "/members")
# Verify multiple badges are present
assert html =~ member1.first_name

View file

@ -3,7 +3,8 @@ defmodule MvWeb.MemberLive.IndexGroupsFilterTest do
Tests for filtering members by group in the member overview.
Uses the filter dropdown (MemberFilterComponent) with one row per group:
All / Yes / No (per group).
All / Yes / No (per group). Multiple active group filters combine with AND
(member must match all selected group conditions).
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
use MvWeb.ConnCase, async: false

View file

@ -78,7 +78,7 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
group1: group1
} do
conn = conn_with_oidc_user(conn)
{:ok, view, html} = live(conn, "/members")
{:ok, _view, html} = live(conn, "/members")
# Verify groups column is visible by default
assert html =~ group1.name

View file

@ -6,7 +6,7 @@ defmodule MvWeb.MemberLive.IndexGroupsPerformanceTest do
- Groups are loaded with members in a single query (preloading)
- No N+1 queries when loading members with groups
- Filter works at database level (not in-memory)
- Sort works at database level
- Sort runs in-memory but uses preloaded group data (no extra DB queries)
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
use MvWeb.ConnCase, async: false
@ -73,7 +73,7 @@ defmodule MvWeb.MemberLive.IndexGroupsPerformanceTest do
# For now, we verify the functionality works correctly
conn = conn_with_oidc_user(conn)
{:ok, view, html} = live(conn, "/members")
{:ok, _view, html} = live(conn, "/members")
# Verify all members are loaded
Enum.each(1..10, fn i ->
@ -193,7 +193,7 @@ defmodule MvWeb.MemberLive.IndexGroupsPerformanceTest do
end)
conn = conn_with_oidc_user(conn)
{:ok, view, html} = live(conn, "/members")
{:ok, _view, html} = live(conn, "/members")
# Verify all members are loaded efficiently
Enum.each(11..30, fn i ->