Improve searching for group actors
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -38,16 +38,23 @@ defmodule Mobilizon.GraphQL.API.SearchTest do
|
||||
|
||||
test "search actors" do
|
||||
with_mock Actors,
|
||||
build_actors_by_username_or_name_page: fn "toto", _options, 1, 10 ->
|
||||
search_actors: fn "toto", _options, 1, 10 ->
|
||||
%Page{total: 1, elements: [%Actor{id: 42}]}
|
||||
end do
|
||||
assert {:ok, %{total: 1, elements: [%Actor{id: 42}]}} =
|
||||
Search.search_actors(%{term: "toto"}, 1, 10, :Person)
|
||||
|
||||
assert_called(
|
||||
Actors.build_actors_by_username_or_name_page(
|
||||
Actors.search_actors(
|
||||
"toto",
|
||||
[actor_type: [:Person], radius: nil, location: nil, minimum_visibility: :public],
|
||||
[
|
||||
actor_type: :Person,
|
||||
radius: nil,
|
||||
location: nil,
|
||||
minimum_visibility: :public,
|
||||
current_actor_id: nil,
|
||||
exclude_my_groups: false
|
||||
],
|
||||
1,
|
||||
10
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user