feat: improve groups fillter
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Simon 2026-02-13 17:45:51 +01:00
parent 3322efcdf6
commit 5fd7c0e7f6
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
13 changed files with 583 additions and 258 deletions

View file

@ -102,8 +102,12 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
{:ok, view, _html} = live(conn, "/members")
view
|> element("#group-filter-form")
|> render_change(%{"group_filter" => group1.id})
|> element("button[aria-label='Filter members']")
|> render_click()
view
|> element("[data-testid='member-filter-form']")
|> render_change(%{"group_#{group1.id}" => "in", "payment_filter" => "all"})
html = render(view)
assert html =~ member1.first_name
@ -160,13 +164,13 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
|> Ash.create(actor: system_actor)
conn = conn_with_oidc_user(conn)
# Visit with both group filter and cycle status filter in URL (cycle filter is toggled via button, not a select).
# Cycle filter may depend on "current" cycle; we only verify the page loads with both params.
{:ok, _view, html} =
live(conn, "/members?group_filter=#{group1.id}&cycle_status_filter=paid")
live(conn, "/members?group_#{group1.id}=in&cycle_status_filter=paid")
assert html =~ "Members"
assert html =~ group1.name
# member1 has a group and a paid cycle; page should load with both filters
assert html =~ member1.first_name
end
test "groups work with existing search (not testing search integration)", %{
@ -180,8 +184,12 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
# Apply group filter
view
|> element("#group-filter-form")
|> render_change(%{"group_filter" => group1.id})
|> element("button[aria-label='Filter members']")
|> render_click()
view
|> element("[data-testid='member-filter-form']")
|> render_change(%{"group_#{group1.id}" => "in", "payment_filter" => "all"})
# Apply search (this tests that filter and search work together;
# search form is in SearchBarComponent with phx-submit="search")
@ -208,8 +216,12 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
# Apply group filter
view
|> element("#group-filter-form")
|> render_change(%{"group_filter" => group1.id})
|> element("button[aria-label='Filter members']")
|> render_click()
view
|> element("[data-testid='member-filter-form']")
|> render_change(%{"group_#{group1.id}" => "in", "payment_filter" => "all"})
# Apply sorting
view