feat(web): add tooltips to icon-only action buttons

This commit is contained in:
Moritz 2026-06-08 12:35:30 +02:00
parent bec49f0771
commit 035edae522
10 changed files with 144 additions and 44 deletions

View file

@ -300,4 +300,31 @@ defmodule MvWeb.GlobalSettingsLiveTest do
"Single Sign-On"
end
end
describe "Vereinfacht sync control tooltip (§1.9)" do
setup %{conn: conn} do
user = create_test_user(%{email: "admin@example.com"})
conn = conn_with_oidc_user(conn, user)
System.put_env("VEREINFACHT_API_URL", "https://example.test/api/v1")
System.put_env("VEREINFACHT_API_KEY", "test-key")
System.put_env("VEREINFACHT_CLUB_ID", "club-1")
on_exit(fn ->
System.delete_env("VEREINFACHT_API_URL")
System.delete_env("VEREINFACHT_API_KEY")
System.delete_env("VEREINFACHT_CLUB_ID")
end)
{:ok, conn: conn}
end
test "global Vereinfacht sync control carries a tooltip and accessible label", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/settings")
# The sync button is wrapped in a <.tooltip> (data-tip) and carries an aria-label
assert has_element?(view, ".tooltip[data-tip] button[phx-click=sync_vereinfacht_contacts]")
assert has_element?(view, "button[phx-click=sync_vereinfacht_contacts][aria-label]")
end
end
end

View file

@ -55,6 +55,22 @@ defmodule MvWeb.MemberLive.ShowMembershipFeesTest do
|> Ash.create!(actor: system_actor)
end
describe "cycle-regeneration control tooltip (§3.5 icon/tooltip audit)" do
test "the regenerate_cycles control carries a tooltip and accessible label", %{conn: conn} do
fee_type = create_fee_type(%{interval: :yearly})
member = Mv.Fixtures.member_fixture(%{membership_fee_type_id: fee_type.id})
{:ok, view, _html} = live(conn, "/members/#{member.id}")
view
|> element("button[phx-click='switch_tab'][phx-value-tab='membership_fees']")
|> render_click()
assert has_element?(view, ".tooltip[data-tip] button[phx-click=regenerate_cycles]")
assert has_element?(view, "button[phx-click=regenerate_cycles][aria-label]")
end
end
describe "cycles table display" do
test "displays all cycles for member", %{conn: conn} do
fee_type = create_fee_type(%{interval: :yearly})