Make sure draft events are not selected in search
Closes https://framagit.org/framasoft/mobilizon/-/issues/807 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
acd921432f
commit
011128b0fb
|
@ -531,6 +531,7 @@ defmodule Mobilizon.Events do
|
|||
|> events_for_ends_on(args)
|
||||
|> events_for_tags(args)
|
||||
|> events_for_location(args)
|
||||
|> filter_draft()
|
||||
|> filter_local_or_from_followed_instances_events()
|
||||
|> filter_public_visibility()
|
||||
|> event_order_begins_on_asc()
|
||||
|
|
|
@ -205,6 +205,19 @@ defmodule Mobilizon.GraphQL.Resolvers.SearchTest do
|
|||
assert hd(res["data"]["searchEvents"]["elements"])["uuid"] ==
|
||||
event.uuid
|
||||
end
|
||||
|
||||
test "doesn't find drafts", %{conn: conn} do
|
||||
insert(:event, title: "A draft event", draft: true)
|
||||
|
||||
res =
|
||||
AbsintheHelpers.graphql_query(conn,
|
||||
query: @search_events_query,
|
||||
variables: %{term: "draft"}
|
||||
)
|
||||
|
||||
assert res["errors"] == nil
|
||||
assert res["data"]["searchEvents"]["total"] == 0
|
||||
end
|
||||
end
|
||||
|
||||
describe "search_persons/3" do
|
||||
|
|
Loading…
Reference in a new issue