Commit 2d6a74a4 authored by ivan's avatar ivan

tested event pagination

parent 8d792b33
......@@ -160,7 +160,7 @@ defmodule ValueFlows.Observation.EconomicEvent.EventsGraphQLTest do
some(5, fn ->
fake_economic_event!(user)
end)
after_event = List.first(events)
# deleted
some(2, fn ->
event = fake_economic_event!(user)
......@@ -171,8 +171,10 @@ defmodule ValueFlows.Observation.EconomicEvent.EventsGraphQLTest do
q = economic_events_pages_query()
conn = user_conn(user)
assert page = grumble_post_key(q, conn, :economic_events_pages, %{})
vars = %{after: after_event.id, limit: 2}
assert page = grumble_post_key(q, conn, :economic_events_pages, vars)
assert Enum.count(events) == page["totalCount"]
assert List.first(page["edges"])["id"] == after_event.id
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment