feat(member-live): default the overview to comfortable density with folded-in email

This commit is contained in:
Simon 2026-07-16 09:38:57 +02:00
parent 0a23d03d9d
commit 4d100aef22
10 changed files with 58 additions and 44 deletions

View file

@ -3,7 +3,7 @@ defmodule MvWeb.MemberLive.IndexViewSettingsTest do
§1.20 the view-settings dropdown toggles: the composite "Member" and address
fields, the "include email" sub-toggle and their effect on the rendered
columns. Turning a composite off surfaces the underlying separate columns.
§1.2 email is not in the Member cell by default.
§1.2 email is folded into the Member cell by default (include-email on).
"""
use MvWeb.ConnCase, async: false
@ -34,20 +34,23 @@ defmodule MvWeb.MemberLive.IndexViewSettingsTest do
view
end
test "member cell hides the email line by default", %{conn: conn} do
test "member cell shows the email line by default", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/members")
assert has_element?(view, "[data-testid='member-name']")
refute has_element?(view, "[data-testid='member-name-email']")
assert has_element?(view, "[data-testid='member-name-email']", "ada@example.com")
end
test "the include-email sub-toggle surfaces the email line in the member cell", %{conn: conn} do
test "the include-email sub-toggle removes the email line from the member cell", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/members")
# Email is folded into the Member cell by default; the sub-toggle turns it off.
assert has_element?(view, "[data-testid='member-name-email']", "ada@example.com")
open_view_settings(view)
view |> element("[data-testid='view-setting-member-include-email']") |> render_click()
assert has_element?(view, "[data-testid='member-name-email']", "ada@example.com")
refute has_element?(view, "[data-testid='member-name-email']")
end
test "turning off the compact member field shows separate name columns", %{conn: conn} do