fix: adress review comments
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Simon 2026-02-18 13:05:31 +01:00
parent f6575319f7
commit 63b8e70e62
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
4 changed files with 83 additions and 77 deletions

View file

@ -273,7 +273,9 @@ defmodule Mv.Membership.MemberSearchGroupsIntegrationTest do
end
describe "edge cases" do
test "partial group name matches via FTS", %{system_actor: actor} do
test "token match: single word in group name matches (e.g. Board in Board Members)", %{
system_actor: actor
} do
{:ok, member} =
Mv.Membership.create_member(
%{first_name: "Partial", last_name: "Test", email: "partial@example.com"},
@ -300,7 +302,9 @@ defmodule Mv.Membership.MemberSearchGroupsIntegrationTest do
"Search for 'Board' should find member in group 'Board Members'"
end
test "special characters in group name do not break search", %{system_actor: actor} do
test "search with token from group name containing special characters does not crash", %{
system_actor: actor
} do
{:ok, member} =
Mv.Membership.create_member(
%{first_name: "Special", last_name: "Char", email: "special@example.com"},
@ -317,7 +321,7 @@ defmodule Mv.Membership.MemberSearchGroupsIntegrationTest do
|> Ash.Changeset.for_create(:create, %{member_id: member.id, group_id: group.id})
|> Ash.create(actor: actor)
# Search should not crash; at least exact or word match should work
# Search for a token from the group name; proves tokenization does not crash on "A&B"
results =
Member
|> Member.fuzzy_search(%{query: "Team"})