updated tests and fix merge conflict results

This commit is contained in:
carla 2025-12-03 14:55:20 +01:00
parent f0613fe1e5
commit 064c0df701
5 changed files with 23 additions and 98 deletions

View file

@ -241,23 +241,4 @@ defmodule MvWeb.MemberLive.IndexCustomFieldsDisplayTest do
assert html =~ "alice.private@example.com"
end
test "shows empty cell or placeholder for members without custom field values", %{
conn: conn,
member2: _member2,
field_show_string: field
} do
conn = conn_with_oidc_user(conn)
{:ok, _view, html} = live(conn, "/members")
# The custom field column should exist
assert html =~ field.name
# Member2 should have an empty cell for this field
# We check that member2's row exists but doesn't have the value
assert html =~ "Bob Brown"
# The value should not appear for member2 (only for member1)
# We check that the value appears somewhere (for member1) but member2 row should have "-"
assert html =~ "+49123456789"
end
end

View file

@ -161,37 +161,6 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
refute html =~ "bob@example.com"
end
test "showing a hidden field adds it to display", %{conn: conn} do
conn = conn_with_oidc_user(conn)
# Start with only first_name and street explicitly set in URL
# Note: Other fields may still be visible due to global settings
{:ok, view, _html} = live(conn, "/members?fields=first_name,street")
# Verify first_name and street are visible
html = render(view)
assert html =~ "Alice"
assert html =~ "Main St"
# Open dropdown and toggle email (to ensure it's visible)
view
|> element("button[aria-controls='field-visibility-menu']")
|> render_click()
# If email is not visible, toggle it to make it visible
# If it's already visible, toggle it off and on again
view
|> element("button[phx-click='select_item'][phx-value-item='email']")
|> render_click()
# Wait for update
:timer.sleep(100)
# Email should now be visible
html = render(view)
assert html =~ "alice@example.com"
end
test "hiding custom field removes it from display", %{conn: conn, custom_field: custom_field} do
conn = conn_with_oidc_user(conn)
{:ok, view, _html} = live(conn, "/members")
@ -470,7 +439,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
# Simulate Enter key press on email field button
view
|> element("button[phx-click='select_item'][phx-value-item='email']")
|> render_keydown("Enter")
|> render_keydown(%{key: "Enter"})
# Wait for update
:timer.sleep(100)
@ -496,7 +465,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
# Simulate Space key press on email field button
view
|> element("button[phx-click='select_item'][phx-value-item='email']")
|> render_keydown(" ")
|> render_keydown(%{key: " "})
# Wait for update
:timer.sleep(100)