summaryrefslogtreecommitdiff
path: root/spec/requests/api/graphql_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/graphql_spec.rb')
-rw-r--r--spec/requests/api/graphql_spec.rb53
1 files changed, 12 insertions, 41 deletions
diff --git a/spec/requests/api/graphql_spec.rb b/spec/requests/api/graphql_spec.rb
index d94257c61eb..1c1ae73ddfe 100644
--- a/spec/requests/api/graphql_spec.rb
+++ b/spec/requests/api/graphql_spec.rb
@@ -463,50 +463,21 @@ RSpec.describe 'GraphQL' do
)
end
- context 'when new_graphql_keyset_pagination feature flag is off' do
- before do
- stub_feature_flags(new_graphql_keyset_pagination: false)
- end
-
- it 'paginates datetimes correctly when they have millisecond data' do
- # let's make sure we're actually querying a timestamp, just in case
- expect(Gitlab::Graphql::Pagination::Keyset::QueryBuilder)
- .to receive(:new).with(anything, anything, hash_including('created_at'), anything).and_call_original
+ it 'paginates datetimes correctly when they have millisecond data' do
+ execute_query
+ first_page = graphql_data
+ edges = first_page.dig(*issues_edges)
+ cursor = first_page.dig(*end_cursor)
- execute_query
- first_page = graphql_data
- edges = first_page.dig(*issues_edges)
- cursor = first_page.dig(*end_cursor)
+ expect(edges.count).to eq(6)
+ expect(edges.last['node']['iid']).to eq(issues[4].iid.to_s)
- expect(edges.count).to eq(6)
- expect(edges.last['node']['iid']).to eq(issues[4].iid.to_s)
+ execute_query(after: cursor)
+ second_page = graphql_data
+ edges = second_page.dig(*issues_edges)
- execute_query(after: cursor)
- second_page = graphql_data
- edges = second_page.dig(*issues_edges)
-
- expect(edges.count).to eq(4)
- expect(edges.last['node']['iid']).to eq(issues[0].iid.to_s)
- end
- end
-
- context 'when new_graphql_keyset_pagination feature flag is on' do
- it 'paginates datetimes correctly when they have millisecond data' do
- execute_query
- first_page = graphql_data
- edges = first_page.dig(*issues_edges)
- cursor = first_page.dig(*end_cursor)
-
- expect(edges.count).to eq(6)
- expect(edges.last['node']['iid']).to eq(issues[4].iid.to_s)
-
- execute_query(after: cursor)
- second_page = graphql_data
- edges = second_page.dig(*issues_edges)
-
- expect(edges.count).to eq(4)
- expect(edges.last['node']['iid']).to eq(issues[0].iid.to_s)
- end
+ expect(edges.count).to eq(4)
+ expect(edges.last['node']['iid']).to eq(issues[0].iid.to_s)
end
end
end