refactor: implement more review comments
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
ea3bdcaa65
commit
c3ad8894b0
2 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue