refactor: implement more review comments
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-01-28 14:47:30 +01:00
parent ea3bdcaa65
commit c3ad8894b0
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
2 changed files with 9 additions and 9 deletions

View file

@ -98,14 +98,12 @@ defmodule MvWeb.UserLive.IndexTest do
|> has_element?()
# Select second user
html = view |> element("input[type='checkbox'][name='#{user2.id}']") |> render_click()
view |> element("input[type='checkbox'][name='#{user2.id}']") |> render_click()
# Now select all should be automatically checked (all individual users are selected)
# Note: This test might need adjustment based on actual implementation
# The logic depends on whether authenticated user is included in the count
assert html =~ "Email"
assert html =~ to_string(user1.email)
assert html =~ to_string(user2.email)
assert view
|> element("input[type='checkbox'][name='select_all'][checked]")
|> has_element?()
end
end
@ -118,11 +116,12 @@ defmodule MvWeb.UserLive.IndexTest do
# Confirm user is displayed
assert render(view) =~ "delete-me@example.com"
# Click the first delete button to test the functionality
# Click the delete button (phx-click="delete" event)
view |> element("tbody tr:first-child a[data-confirm]") |> render_click()
# The page should still render (basic functionality test)
# Verify user was actually deleted (should not appear in HTML anymore)
html = render(view)
refute html =~ "delete-me@example.com"
# Table header should still be there
assert html =~ "Email"
end