feat: add groups to member detail view #374
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-02-17 14:15:43 +01:00
parent 46f9094e1f
commit b1a9eb8b1d
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
6 changed files with 45 additions and 12 deletions

View file

@ -3,19 +3,15 @@ defmodule MvWeb.MemberLive.ShowGroupsDisplayTest do
Tests for displaying groups in the member detail view (Issue #374).
Tests cover:
- Groups section visibility (with and without groups)
- Group badges with correct names and links to group detail pages
- Groups in Personal Data (with and without groups)
- Group buttons with correct names and links to group detail pages
- Edge cases (one group, many groups)
- Security: groups section visible only when user may view member
- Accessibility: badges have role and aria-label
- Security: groups visible only when user may view member
- Accessibility: group links have role and aria-label
## Note on async
async: false to avoid PostgreSQL deadlocks when creating members and groups
in the same test run (same as IndexGroupsDisplayTest).
## Expected state
These tests fail until the Groups section is implemented on the member show page
(Issue #374: load groups in handle_params, add "Groups" section with badges and links).
"""
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
@ -97,10 +93,11 @@ defmodule MvWeb.MemberLive.ShowGroupsDisplayTest do
member: member
} do
conn = conn_with_oidc_user(conn)
{:ok, view, _html} = live(conn, ~p"/members/#{member}")
{:ok, _view, html} = live(conn, ~p"/members/#{member}")
# Assert Groups section in main content (section with h2 "Groups"), not sidebar link
assert has_element?(view, "main section h2", gettext("Groups"))
# Groups are in Personal Data; label "Groups" and empty state "No groups" must be present
assert html =~ gettext("Groups")
assert html =~ gettext("No groups")
end
test "groups are loaded with member (single request returns all group names)", %{