Merge branch 'main' into bug/289_rauthy_error_message
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
commit
2315f2588f
16 changed files with 1136 additions and 88 deletions
|
|
@ -223,7 +223,7 @@ defmodule MvWeb.Components.SortHeaderComponentTest do
|
|||
end
|
||||
|
||||
describe "component behavior" do
|
||||
test "clicking sends sort message to parent", %{conn: conn} do
|
||||
test "clicking triggers sort event on parent LiveView", %{conn: conn} do
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, view, _html} = live(conn, "/members")
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ defmodule MvWeb.Components.SortHeaderComponentTest do
|
|||
|> element("button[phx-value-field='first_name']")
|
||||
|> render_click()
|
||||
|
||||
# The component should send a message to the parent LiveView
|
||||
# The component triggers a "sort" event on the parent LiveView
|
||||
# This is tested indirectly through the URL change in integration tests
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -8,16 +8,19 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
|
|||
- Groups sorting works with other sortings
|
||||
- Groups work with Membership Fee Status filter
|
||||
- Groups work with existing search (but not testing search integration itself)
|
||||
- Member index search by group name returns members in that group (Issue #375)
|
||||
"""
|
||||
# async: false to prevent PostgreSQL deadlocks when creating members and groups
|
||||
use MvWeb.ConnCase, async: false
|
||||
import Phoenix.LiveViewTest
|
||||
require Ash.Query
|
||||
|
||||
alias Mv.Membership.{Group, MemberGroup, CustomField, CustomFieldValue}
|
||||
alias Mv.Helpers.SystemActor
|
||||
alias Mv.Membership.{CustomField, CustomFieldValue, Group, MemberGroup}
|
||||
alias Mv.MembershipFees.{MembershipFeeCycle, MembershipFeeType}
|
||||
|
||||
setup do
|
||||
system_actor = Mv.Helpers.SystemActor.get_system_actor()
|
||||
system_actor = SystemActor.get_system_actor()
|
||||
|
||||
# Create test members
|
||||
{:ok, member1} =
|
||||
|
|
@ -80,15 +83,10 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
|
|||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, _view, html} = live(conn, "/members")
|
||||
|
||||
# Verify groups column is visible by default
|
||||
# Verify groups column is visible by default (header and content)
|
||||
assert html =~ group1.name
|
||||
assert html =~ member1.first_name
|
||||
|
||||
# Hide groups column via field visibility dropdown
|
||||
# (This tests integration with field visibility feature)
|
||||
# Note: Actual implementation depends on how field visibility works
|
||||
# For now, we verify the column exists and can be toggled
|
||||
assert html
|
||||
assert html =~ "Groups"
|
||||
end
|
||||
|
||||
test "groups filter works with custom field filters", %{
|
||||
|
|
@ -140,11 +138,11 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
|
|||
member1: member1,
|
||||
group1: group1
|
||||
} do
|
||||
system_actor = Mv.Helpers.SystemActor.get_system_actor()
|
||||
system_actor = SystemActor.get_system_actor()
|
||||
|
||||
# Create a membership fee type and cycle for member1
|
||||
{:ok, fee_type} =
|
||||
Mv.MembershipFees.MembershipFeeType
|
||||
MembershipFeeType
|
||||
|> Ash.Changeset.for_create(:create, %{
|
||||
name: "Test Fee",
|
||||
amount: Decimal.new("50.00"),
|
||||
|
|
@ -159,7 +157,7 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
|
|||
)
|
||||
|
||||
{:ok, _cycle} =
|
||||
Mv.MembershipFees.MembershipFeeCycle
|
||||
MembershipFeeCycle
|
||||
|> Ash.Changeset.for_create(:create, %{
|
||||
member_id: member1.id,
|
||||
membership_fee_type_id: fee_type.id,
|
||||
|
|
@ -212,6 +210,25 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
|
|||
# (that's part of Issue #5 - Search Integration)
|
||||
end
|
||||
|
||||
test "member index search by group name returns members in that group", %{
|
||||
conn: conn,
|
||||
member1: member1,
|
||||
member2: member2,
|
||||
group1: group1
|
||||
} do
|
||||
# member1 is in group1 "Board Members", member2 is not
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, view, _html} = live(conn, "/members")
|
||||
|
||||
view
|
||||
|> element("form[phx-submit='search']")
|
||||
|> render_submit(%{"query" => group1.name})
|
||||
|
||||
html = render(view)
|
||||
assert html =~ member1.first_name
|
||||
refute html =~ member2.first_name
|
||||
end
|
||||
|
||||
test "all filters and sortings work together", %{
|
||||
conn: conn,
|
||||
member1: member1,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
defmodule MvWeb.MemberLive.IndexTest do
|
||||
use MvWeb.ConnCase, async: true
|
||||
use MvWeb.ConnCase, async: false
|
||||
import Phoenix.LiveViewTest
|
||||
require Ash.Query
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue