refactor: add data-testid selectors for groups ui
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Simon 2026-02-20 16:34:15 +01:00
parent 83b104ecf3
commit 123227a50e
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
13 changed files with 231 additions and 384 deletions

View file

@ -305,9 +305,8 @@ defmodule MvWeb.GroupLive.ShowIntegrationTest do
|> render_click()
# Both members should be in list
html = render(view)
assert html =~ "Frank"
assert html =~ "Grace"
assert has_element?(view, "[data-testid=group-show-members-table]", "Frank")
assert has_element?(view, "[data-testid=group-show-members-table]", "Grace")
end
test "multiple members can be removed sequentially", %{conn: conn} do
@ -343,11 +342,11 @@ defmodule MvWeb.GroupLive.ShowIntegrationTest do
actor: system_actor
)
{:ok, view, html} = live(conn, "/groups/#{group.slug}")
{:ok, view, _html} = live(conn, "/groups/#{group.slug}")
# Both should be in list initially
assert html =~ "Henry"
assert html =~ "Isabel"
assert has_element?(view, "[data-testid=group-show-members-table]", "Henry")
assert has_element?(view, "[data-testid=group-show-members-table]", "Isabel")
# Remove first member
view
@ -360,9 +359,8 @@ defmodule MvWeb.GroupLive.ShowIntegrationTest do
|> render_click()
# Both should be removed
html = render(view)
refute html =~ "Henry"
refute html =~ "Isabel"
refute has_element?(view, "[data-testid=group-show-members-table]", "Henry")
refute has_element?(view, "[data-testid=group-show-members-table]", "Isabel")
end
test "add and remove can be mixed", %{conn: conn} do
@ -424,9 +422,8 @@ defmodule MvWeb.GroupLive.ShowIntegrationTest do
|> render_click()
# Only member2 should remain
html = render(view)
refute html =~ "Jack"
assert html =~ "Kate"
refute has_element?(view, "[data-testid=group-show-members-table]", "Jack")
assert has_element?(view, "[data-testid=group-show-members-table]", "Kate")
end
end
end