feat(member): condense the overview into composite name and address cells
This commit is contained in:
parent
b79d7ac9ea
commit
af2cc2e0d4
17 changed files with 716 additions and 93 deletions
56
test/mv_web/member_live/index_sticky_pinned_test.exs
Normal file
56
test/mv_web/member_live/index_sticky_pinned_test.exs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
defmodule MvWeb.MemberLive.IndexStickyPinnedTest do
|
||||
@moduledoc """
|
||||
§1.19 — When the table scrolls vertically and horizontally, the header stays
|
||||
sticky and the identifier (Name) column stays pinned; overflowing cell content
|
||||
truncates with ellipsis and exposes a hover/focus tooltip.
|
||||
"""
|
||||
use MvWeb.ConnCase, async: false
|
||||
|
||||
import Phoenix.LiveViewTest
|
||||
|
||||
alias Mv.Helpers.SystemActor
|
||||
|
||||
@moduletag :ui
|
||||
|
||||
setup %{conn: conn} do
|
||||
{:ok, _} =
|
||||
Mv.Membership.create_member(
|
||||
%{
|
||||
first_name: "Reginald",
|
||||
last_name: "Worthington-Smythe",
|
||||
email: "reginald@example.com",
|
||||
street: "A Very Long Street Name That Overflows",
|
||||
house_number: "123",
|
||||
postal_code: "10115",
|
||||
city: "Berlin"
|
||||
},
|
||||
actor: SystemActor.get_system_actor()
|
||||
)
|
||||
|
||||
%{conn: conn_with_oidc_user(conn)}
|
||||
end
|
||||
|
||||
test "header is sticky and the identifier column is pinned", %{conn: conn} do
|
||||
{:ok, _view, html} = live(conn, ~p"/members")
|
||||
|
||||
# Sticky header (desktop).
|
||||
assert html =~ "lg:sticky"
|
||||
assert html =~ "lg:top-0"
|
||||
|
||||
# Checkbox column pinned at left-0, identifier (Name) column pinned beside it.
|
||||
assert html =~ "left-0"
|
||||
assert html =~ "left-12"
|
||||
end
|
||||
|
||||
test "composite cells truncate and expose a tooltip via title", %{conn: conn} do
|
||||
{:ok, view, _html} = live(conn, ~p"/members")
|
||||
|
||||
name_cell = view |> element("[data-testid='member-name']") |> render()
|
||||
assert name_cell =~ "truncate"
|
||||
assert name_cell =~ ~s(title="Reginald Worthington-Smythe")
|
||||
|
||||
address_cell = view |> element("[data-testid='member-address']") |> render()
|
||||
assert address_cell =~ "truncate"
|
||||
assert address_cell =~ ~s(title="A Very Long Street Name That Overflows 123")
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue