feat: sticky memberstable header
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
49fd2181a7
commit
e5a6003ace
8 changed files with 411 additions and 324 deletions
|
|
@ -46,6 +46,35 @@ defmodule MvWeb.MemberLive.IndexTest do
|
|||
|> Ash.create!(actor: actor)
|
||||
end
|
||||
|
||||
describe "desktop layout: scroll container and sticky table header" do
|
||||
@describetag :ui
|
||||
|
||||
test "header and filters are outside scroll container; table is in scroll container with lg:max-h and lg:overflow-auto",
|
||||
%{conn: conn} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, _view, html} = live(conn, ~p"/members")
|
||||
|
||||
assert html =~ ~r/data-testid="members-table-scroll"/
|
||||
# Scroll container has lg: overflow and max-height for desktop-only scroll
|
||||
assert html =~ "lg:overflow-auto"
|
||||
assert html =~ "lg:max-h-[calc(100vh-14rem)]"
|
||||
|
||||
# Header (page title) is present and not inside the scroll container (scroll container comes after filters)
|
||||
assert html =~ "Members"
|
||||
assert html =~ "id=\"members\""
|
||||
end
|
||||
|
||||
test "table thead has sticky classes on desktop when sticky_header is set", %{conn: conn} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, _view, html} = live(conn, ~p"/members")
|
||||
|
||||
# CoreComponents table with sticky_header adds lg:sticky lg:top-0 bg-base-100 z-10 to th
|
||||
assert html =~ "lg:sticky"
|
||||
assert html =~ "lg:top-0"
|
||||
assert html =~ "bg-base-100"
|
||||
end
|
||||
end
|
||||
|
||||
describe "translations" do
|
||||
@describetag :ui
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue