summaryrefslogtreecommitdiff
path: root/spec/requests/api/graphql/boards/board_lists_query_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/graphql/boards/board_lists_query_spec.rb')
-rw-r--r--spec/requests/api/graphql/boards/board_lists_query_spec.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/spec/requests/api/graphql/boards/board_lists_query_spec.rb b/spec/requests/api/graphql/boards/board_lists_query_spec.rb
index 5d5b963fed5..cd94ce91071 100644
--- a/spec/requests/api/graphql/boards/board_lists_query_spec.rb
+++ b/spec/requests/api/graphql/boards/board_lists_query_spec.rb
@@ -66,28 +66,22 @@ RSpec.describe 'get board lists' do
describe 'sorting and pagination' do
let_it_be(:current_user) { user }
- let(:data_path) { [board_parent_type, :boards, :edges, 0, :node, :lists] }
+ let(:data_path) { [board_parent_type, :boards, :nodes, 0, :lists] }
- def pagination_query(params, page_info)
+ def pagination_query(params)
graphql_query_for(
board_parent_type,
{ 'fullPath' => board_parent.full_path },
<<~BOARDS
boards(first: 1) {
- edges {
- node {
- #{query_graphql_field('lists', params, "#{page_info} edges { node { id } }")}
- }
+ nodes {
+ #{query_graphql_field(:lists, params, "#{page_info} nodes { id }")}
}
}
BOARDS
)
end
- def pagination_results_data(data)
- data.map { |list| list.dig('node', 'id') }
- end
-
context 'when using default sorting' do
let!(:label_list) { create(:list, board: board, label: label, position: 10) }
let!(:label_list2) { create(:list, board: board, label: label2, position: 2) }
@@ -99,7 +93,7 @@ RSpec.describe 'get board lists' do
it_behaves_like 'sorted paginated query' do
let(:sort_param) { }
let(:first_param) { 2 }
- let(:expected_results) { lists.map { |list| list.to_global_id.to_s } }
+ let(:expected_results) { lists.map { |list| global_id_of(list) } }
end
end
end