summaryrefslogtreecommitdiff
path: root/spec/frontend/fixtures/namespaces.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/fixtures/namespaces.rb
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
downloadgitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/fixtures/namespaces.rb')
-rw-r--r--spec/frontend/fixtures/namespaces.rb46
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/frontend/fixtures/namespaces.rb b/spec/frontend/fixtures/namespaces.rb
new file mode 100644
index 00000000000..b11f661fe09
--- /dev/null
+++ b/spec/frontend/fixtures/namespaces.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'Jobs (JavaScript fixtures)' do
+ include ApiHelpers
+ include JavaScriptFixturesHelpers
+ include GraphqlHelpers
+
+ describe GraphQL::Query, type: :request do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:groups) { create_list(:group, 4) }
+
+ before_all do
+ groups.each { |group| group.add_owner(user) }
+ end
+
+ query_name = 'search_namespaces_where_user_can_transfer_projects'
+ query_extension = '.query.graphql'
+
+ full_input_path = "projects/settings/graphql/queries/#{query_name}#{query_extension}"
+ base_output_path = "graphql/projects/settings/#{query_name}"
+
+ it "#{base_output_path}_page_1#{query_extension}.json" do
+ query = get_graphql_query_as_string(full_input_path)
+
+ post_graphql(query, current_user: user, variables: { first: 2 })
+
+ expect_graphql_errors_to_be_empty
+ end
+
+ it "#{base_output_path}_page_2#{query_extension}.json" do
+ query = get_graphql_query_as_string(full_input_path)
+
+ post_graphql(query, current_user: user, variables: { first: 2 })
+
+ post_graphql(
+ query,
+ current_user: user,
+ variables: { first: 2, after: graphql_data_at('currentUser', 'groups', 'pageInfo', 'endCursor') }
+ )
+
+ expect_graphql_errors_to_be_empty
+ end
+ end
+end