Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/graphql/types')
-rw-r--r--spec/graphql/types/achievements/user_achievement_type_spec.rb1
-rw-r--r--spec/graphql/types/base_edge_spec.rb3
-rw-r--r--spec/graphql/types/base_field_spec.rb40
-rw-r--r--spec/graphql/types/boards/board_issue_input_type_spec.rb4
-rw-r--r--spec/graphql/types/ci/ci_cd_setting_type_spec.rb22
-rw-r--r--spec/graphql/types/ci/detailed_status_type_spec.rb21
-rw-r--r--spec/graphql/types/ci/job_base_field_spec.rb4
-rw-r--r--spec/graphql/types/ci/job_trace_type_spec.rb16
-rw-r--r--spec/graphql/types/ci/pipeline_type_spec.rb6
-rw-r--r--spec/graphql/types/current_user_todos_type_spec.rb8
-rw-r--r--spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb2
-rw-r--r--spec/graphql/types/issue_type_spec.rb6
-rw-r--r--spec/graphql/types/merge_request_type_spec.rb1
-rw-r--r--spec/graphql/types/merge_requests/mergeability_check_identifier_enum_spec.rb13
-rw-r--r--spec/graphql/types/merge_requests/mergeability_check_status_enum_spec.rb13
-rw-r--r--spec/graphql/types/merge_requests/mergeability_check_type_spec.rb10
-rw-r--r--spec/graphql/types/namespace_type_spec.rb2
-rw-r--r--spec/graphql/types/packages/package_base_type_spec.rb4
-rw-r--r--spec/graphql/types/packages/protection/rule_access_level_enum_spec.rb9
-rw-r--r--spec/graphql/types/packages/protection/rule_package_type_enum_spec.rb9
-rw-r--r--spec/graphql/types/packages/protection/rule_type_spec.rb29
-rw-r--r--spec/graphql/types/project_statistics_type_spec.rb10
-rw-r--r--spec/graphql/types/project_type_spec.rb90
-rw-r--r--spec/graphql/types/snippet_type_spec.rb2
-rw-r--r--spec/graphql/types/todo_type_spec.rb32
-rw-r--r--spec/graphql/types/work_item_type_spec.rb1
-rw-r--r--spec/graphql/types/work_items/widgets/hierarchy_type_spec.rb2
27 files changed, 239 insertions, 121 deletions
diff --git a/spec/graphql/types/achievements/user_achievement_type_spec.rb b/spec/graphql/types/achievements/user_achievement_type_spec.rb
index b7fe4d815f7..bb332c26894 100644
--- a/spec/graphql/types/achievements/user_achievement_type_spec.rb
+++ b/spec/graphql/types/achievements/user_achievement_type_spec.rb
@@ -15,6 +15,7 @@ RSpec.describe GitlabSchema.types['UserAchievement'], feature_category: :user_pr
created_at
updated_at
revoked_at
+ priority
]
end
diff --git a/spec/graphql/types/base_edge_spec.rb b/spec/graphql/types/base_edge_spec.rb
index 0cc0c838fac..8aad77a6400 100644
--- a/spec/graphql/types/base_edge_spec.rb
+++ b/spec/graphql/types/base_edge_spec.rb
@@ -7,8 +7,7 @@ RSpec.describe Types::BaseEdge, feature_category: :api do
let_it_be(:test_schema) do
project_edge_type = Class.new(described_class) do
- field :proof_of_admin_rights, String,
- null: true, authorize: :admin_project
+ field :proof_of_admin_rights, String, null: true, authorize: :admin_project
def proof_of_admin_rights
'ok'
diff --git a/spec/graphql/types/base_field_spec.rb b/spec/graphql/types/base_field_spec.rb
index 831d36950db..b52d5514368 100644
--- a/spec/graphql/types/base_field_spec.rb
+++ b/spec/graphql/types/base_field_spec.rb
@@ -31,23 +31,25 @@ RSpec.describe Types::BaseField, feature_category: :api do
end
it 'only tests the resolver authorization if it authorizes_object?' do
- resolver = Class.new
+ resolver = Class.new(Resolvers::BaseResolver)
- field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true,
- resolver_class: resolver)
+ field = described_class.new(
+ name: 'test', type: GraphQL::Types::String, null: true, resolver_class: resolver
+ )
expect(field).to be_authorized(object, nil, ctx)
end
it 'tests the resolver authorization, if provided' do
- resolver = Class.new do
+ resolver = Class.new(Resolvers::BaseResolver) do
include Gitlab::Graphql::Authorize::AuthorizeResource
authorizes_object!
end
- field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true,
- resolver_class: resolver)
+ field = described_class.new(
+ name: 'test', type: GraphQL::Types::String, null: true, resolver_class: resolver
+ )
expect(resolver).to receive(:authorized?).with(object, ctx).and_return(false)
@@ -55,15 +57,19 @@ RSpec.describe Types::BaseField, feature_category: :api do
end
it 'tests field authorization before resolver authorization, when field auth fails' do
- resolver = Class.new do
+ resolver = Class.new(Resolvers::BaseResolver) do
include Gitlab::Graphql::Authorize::AuthorizeResource
authorizes_object!
end
- field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true,
- authorize: :foo,
- resolver_class: resolver)
+ field = described_class.new(
+ name: 'test',
+ type: GraphQL::Types::String,
+ null: true,
+ authorize: :foo,
+ resolver_class: resolver
+ )
expect(Ability).to receive(:allowed?).with(current_user, :foo, object).and_return(false)
expect(resolver).not_to receive(:authorized?)
@@ -72,15 +78,19 @@ RSpec.describe Types::BaseField, feature_category: :api do
end
it 'tests field authorization before resolver authorization, when field auth succeeds' do
- resolver = Class.new do
+ resolver = Class.new(Resolvers::BaseResolver) do
include Gitlab::Graphql::Authorize::AuthorizeResource
authorizes_object!
end
- field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true,
- authorize: :foo,
- resolver_class: resolver)
+ field = described_class.new(
+ name: 'test',
+ type: GraphQL::Types::String,
+ null: true,
+ authorize: :foo,
+ resolver_class: resolver
+ )
expect(Ability).to receive(:allowed?).with(current_user, :foo, object).and_return(true)
expect(resolver).to receive(:authorized?).with(object, ctx).and_return(false)
@@ -91,7 +101,7 @@ RSpec.describe Types::BaseField, feature_category: :api do
context 'when considering complexity' do
let(:resolver) do
- Class.new(described_class) do
+ Class.new(Resolvers::BaseResolver) do
def self.resolver_complexity(args, child_complexity:)
2 if args[:foo]
end
diff --git a/spec/graphql/types/boards/board_issue_input_type_spec.rb b/spec/graphql/types/boards/board_issue_input_type_spec.rb
index ed2872c3598..dccd9f1c16c 100644
--- a/spec/graphql/types/boards/board_issue_input_type_spec.rb
+++ b/spec/graphql/types/boards/board_issue_input_type_spec.rb
@@ -6,8 +6,8 @@ RSpec.describe GitlabSchema.types['BoardIssueInput'] do
it { expect(described_class.graphql_name).to eq('BoardIssueInput') }
it 'has specific fields' do
- allowed_args = %w(labelName milestoneTitle assigneeUsername authorUsername
- releaseTag myReactionEmoji not search assigneeWildcardId confidential)
+ allowed_args = %w[labelName milestoneTitle assigneeUsername authorUsername
+ releaseTag myReactionEmoji not search assigneeWildcardId confidential]
expect(described_class.arguments.keys).to include(*allowed_args)
expect(described_class.arguments['not'].type).to eq(Types::Boards::NegatedBoardIssueInputType)
diff --git a/spec/graphql/types/ci/ci_cd_setting_type_spec.rb b/spec/graphql/types/ci/ci_cd_setting_type_spec.rb
new file mode 100644
index 00000000000..5fdfb405e23
--- /dev/null
+++ b/spec/graphql/types/ci/ci_cd_setting_type_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Types::Ci::CiCdSettingType, feature_category: :continuous_integration do
+ specify { expect(described_class.graphql_name).to eq('ProjectCiCdSetting') }
+
+ it 'exposes the expected fields' do
+ expected_fields = %w[
+ inbound_job_token_scope_enabled job_token_scope_enabled
+ keep_latest_artifact merge_pipelines_enabled project
+ ]
+
+ if Gitlab.ee?
+ expected_fields += %w[
+ merge_trains_skip_train_allowed merge_trains_enabled
+ ]
+ end
+
+ expect(described_class).to have_graphql_fields(*expected_fields)
+ end
+end
diff --git a/spec/graphql/types/ci/detailed_status_type_spec.rb b/spec/graphql/types/ci/detailed_status_type_spec.rb
index 81ab1b52552..c069098e5b0 100644
--- a/spec/graphql/types/ci/detailed_status_type_spec.rb
+++ b/spec/graphql/types/ci/detailed_status_type_spec.rb
@@ -10,9 +10,12 @@ RSpec.describe Types::Ci::DetailedStatusType do
specify { expect(described_class.graphql_name).to eq('DetailedStatus') }
it 'has all fields' do
- expect(described_class).to have_graphql_fields(:id, :group, :icon, :favicon,
- :details_path, :has_details,
- :label, :text, :tooltip, :action)
+ expect(described_class).to have_graphql_fields(
+ :id, :group, :icon, :favicon,
+ :details_path, :has_details,
+ :label, :name, :text, :tooltip,
+ :action
+ )
end
describe 'id field' do
@@ -29,12 +32,12 @@ RSpec.describe Types::Ci::DetailedStatusType do
status = stage.detailed_status(stage.pipeline.user)
expected_status = {
- button_title: status.action_button_title,
- icon: status.action_icon,
- method: status.action_method,
- path: status.action_path,
- title: status.action_title
- }
+ button_title: status.action_button_title,
+ icon: status.action_icon,
+ method: status.action_method,
+ path: status.action_path,
+ title: status.action_title
+ }
expect(resolve_field('action', status, arg_style: :internal)).to eq(expected_status)
end
diff --git a/spec/graphql/types/ci/job_base_field_spec.rb b/spec/graphql/types/ci/job_base_field_spec.rb
index 2d283ce854d..ec7d2a7d33a 100644
--- a/spec/graphql/types/ci/job_base_field_spec.rb
+++ b/spec/graphql/types/ci/job_base_field_spec.rb
@@ -77,7 +77,7 @@ RSpec.describe Types::Ci::JobBaseField, feature_category: :runner_fleet do
end
context 'with field resolver' do
- let(:resolver) { Class.new }
+ let(:resolver) { Class.new(Resolvers::BaseResolver) }
let(:args) { { resolver_class: resolver } }
it 'only tests the resolver authorization if it authorizes_object?' do
@@ -86,7 +86,7 @@ RSpec.describe Types::Ci::JobBaseField, feature_category: :runner_fleet do
context 'when resolver authorizes object' do
let(:resolver) do
- Class.new do
+ Class.new(Resolvers::BaseResolver) do
include Gitlab::Graphql::Authorize::AuthorizeResource
authorizes_object!
diff --git a/spec/graphql/types/ci/job_trace_type_spec.rb b/spec/graphql/types/ci/job_trace_type_spec.rb
index 69123445b8b..6d1214eafe6 100644
--- a/spec/graphql/types/ci/job_trace_type_spec.rb
+++ b/spec/graphql/types/ci/job_trace_type_spec.rb
@@ -123,22 +123,6 @@ RSpec.describe GitlabSchema.types['CiJobTrace'], feature_category: :continuous_i
end
end
- context 'when FF graphql_job_trace_html_summary_max_size is disabled' do
- before do
- stub_feature_flags(graphql_job_trace_html_summary_max_size: false)
- end
-
- let(:args) { { last_lines: 20 } }
-
- it 'does not limit the read size from the raw trace' do
- expect_next_instance_of(Gitlab::Ci::Trace) do |trace|
- expect(trace).to receive(:html).with(last_lines: 20, max_size: nil).and_call_original
- end
-
- is_expected.to eq "<span>#{(1..20).map { (1..1024).map { 'a' }.join('') }.join('<br/>')}</span>"
- end
- end
-
context 'when trace is cut in middle of a line' do
let(:args) { {} }
diff --git a/spec/graphql/types/ci/pipeline_type_spec.rb b/spec/graphql/types/ci/pipeline_type_spec.rb
index 67209874b54..26dfc0b10c6 100644
--- a/spec/graphql/types/ci/pipeline_type_spec.rb
+++ b/spec/graphql/types/ci/pipeline_type_spec.rb
@@ -9,18 +9,20 @@ RSpec.describe Types::Ci::PipelineType do
it 'contains attributes related to a pipeline' do
expected_fields = %w[
- id iid sha before_sha complete status detailed_status config_source
+ id iid sha before_sha complete status detailed_status config_source name
duration queued_duration
coverage created_at updated_at started_at finished_at committed_at
stages user retryable cancelable jobs source_job job job_artifacts downstream
upstream path project active user_permissions warnings commit commit_path uses_needs
test_report_summary test_suite ref ref_path warning_messages merge_request_event_type
+ name total_jobs triggered_by_path child source stuck
+ latest merge_request ref_text failure_reason
]
if Gitlab.ee?
expected_fields += %w[
security_report_summary security_report_findings security_report_finding
- code_quality_reports dast_profile code_quality_report_summary
+ code_quality_reports dast_profile code_quality_report_summary compute_minutes
]
end
diff --git a/spec/graphql/types/current_user_todos_type_spec.rb b/spec/graphql/types/current_user_todos_type_spec.rb
index 4ce97e1c006..febbe868f33 100644
--- a/spec/graphql/types/current_user_todos_type_spec.rb
+++ b/spec/graphql/types/current_user_todos_type_spec.rb
@@ -173,9 +173,7 @@ RSpec.describe GitlabSchema.types['CurrentUserTodos'] do
end
it 'returns correct data' do
- result = execute_query(query_type,
- graphql: query_without_state_arguments,
- raise_on_error: true).to_h
+ result = execute_query(query_type, graphql: query_without_state_arguments, raise_on_error: true).to_h
expect(result.dig('data', 'a', 'todos', 'nodes')).to contain_exactly(
a_graphql_entity_for(todo_a),
@@ -198,9 +196,7 @@ RSpec.describe GitlabSchema.types['CurrentUserTodos'] do
end
it 'returns correct data, when state arguments are supplied' do
- result = execute_query(query_type,
- raise_on_error: true,
- graphql: with_state_arguments).to_h
+ result = execute_query(query_type, raise_on_error: true, graphql: with_state_arguments).to_h
expect(result.dig('data', 'a', 'todos', 'nodes')).to contain_exactly(
a_graphql_entity_for(todo_a)
diff --git a/spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb b/spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb
index f536d91aeda..15960407a6f 100644
--- a/spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb
+++ b/spec/graphql/types/design_management/design_collection_copy_state_enum_spec.rb
@@ -6,6 +6,6 @@ RSpec.describe GitlabSchema.types['DesignCollectionCopyState'] do
it { expect(described_class.graphql_name).to eq('DesignCollectionCopyState') }
it 'exposes the correct event states' do
- expect(described_class.values.keys).to match_array(%w(READY IN_PROGRESS ERROR))
+ expect(described_class.values.keys).to match_array(%w[READY IN_PROGRESS ERROR])
end
end
diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb
index d4d0eff9adb..f6d461d6a5f 100644
--- a/spec/graphql/types/issue_type_spec.rb
+++ b/spec/graphql/types/issue_type_spec.rb
@@ -32,7 +32,7 @@ RSpec.describe GitlabSchema.types['Issue'] do
let_it_be(:now) { Time.now.change(usec: 0) }
let_it_be(:issues) { create_list(:issue, 10, project: project, created_at: now) }
- let(:count_path) { %w(data project issues count) }
+ let(:count_path) { %w[data project issues count] }
let(:page_size) { 3 }
let(:query) do
<<~GRAPHQL
@@ -81,8 +81,8 @@ RSpec.describe GitlabSchema.types['Issue'] do
end
context 'count' do
- let(:end_cursor) { %w(data project issues pageInfo endCursor) }
- let(:issues_edges) { %w(data project issues edges) }
+ let(:end_cursor) { %w[data project issues pageInfo endCursor] }
+ let(:issues_edges) { %w[data project issues edges] }
it 'returns total count' do
expect(subject.dig(*count_path)).to eq(issues.count)
diff --git a/spec/graphql/types/merge_request_type_spec.rb b/spec/graphql/types/merge_request_type_spec.rb
index 9742908edf9..be25c5177f6 100644
--- a/spec/graphql/types/merge_request_type_spec.rb
+++ b/spec/graphql/types/merge_request_type_spec.rb
@@ -37,6 +37,7 @@ RSpec.describe GitlabSchema.types['MergeRequest'], feature_category: :code_revie
squash_on_merge available_auto_merge_strategies
has_ci mergeable commits committers commits_without_merge_commits squash security_auto_fix default_squash_commit_message
auto_merge_strategy merge_user award_emoji prepared_at codequality_reports_comparer supports_lock_on_merge
+ mergeability_checks
]
expect(described_class).to have_graphql_fields(*expected_fields).at_least
diff --git a/spec/graphql/types/merge_requests/mergeability_check_identifier_enum_spec.rb b/spec/graphql/types/merge_requests/mergeability_check_identifier_enum_spec.rb
new file mode 100644
index 00000000000..093cd670418
--- /dev/null
+++ b/spec/graphql/types/merge_requests/mergeability_check_identifier_enum_spec.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Types::MergeRequests::MergeabilityCheckIdentifierEnum, feature_category: :code_review_workflow do
+ specify { expect(described_class.graphql_name).to eq('MergeabilityCheckIdentifier') }
+
+ it 'exposes all the existing mergeability check identifiers' do
+ expect(described_class.values.keys).to contain_exactly(
+ *MergeRequest.all_mergeability_checks.map { |check_class| check_class.identifier.to_s.upcase }
+ )
+ end
+end
diff --git a/spec/graphql/types/merge_requests/mergeability_check_status_enum_spec.rb b/spec/graphql/types/merge_requests/mergeability_check_status_enum_spec.rb
new file mode 100644
index 00000000000..0a15d83f560
--- /dev/null
+++ b/spec/graphql/types/merge_requests/mergeability_check_status_enum_spec.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Types::MergeRequests::MergeabilityCheckStatusEnum, feature_category: :code_review_workflow do
+ specify { expect(described_class.graphql_name).to eq('MergeabilityCheckStatus') }
+
+ it 'exposes all the existing mergeability check statuses' do
+ expect(described_class.values.keys).to contain_exactly(
+ *%w[SUCCESS FAILED INACTIVE]
+ )
+ end
+end
diff --git a/spec/graphql/types/merge_requests/mergeability_check_type_spec.rb b/spec/graphql/types/merge_requests/mergeability_check_type_spec.rb
new file mode 100644
index 00000000000..fb6ac0ad271
--- /dev/null
+++ b/spec/graphql/types/merge_requests/mergeability_check_type_spec.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Types::MergeRequests::MergeabilityCheckType, feature_category: :code_review_workflow do
+ let(:fields) { %i[identifier status] }
+
+ specify { expect(described_class.graphql_name).to eq('MergeRequestMergeabilityCheck') }
+ specify { expect(described_class).to have_graphql_fields(fields) }
+end
diff --git a/spec/graphql/types/namespace_type_spec.rb b/spec/graphql/types/namespace_type_spec.rb
index d80235023ef..9e1a2bfd466 100644
--- a/spec/graphql/types/namespace_type_spec.rb
+++ b/spec/graphql/types/namespace_type_spec.rb
@@ -15,5 +15,5 @@ RSpec.describe GitlabSchema.types['Namespace'] do
expect(described_class).to include_graphql_fields(*expected_fields)
end
- specify { expect(described_class).to require_graphql_authorizations(:read_namespace) }
+ specify { expect(described_class).to require_graphql_authorizations(:read_namespace_via_membership) }
end
diff --git a/spec/graphql/types/packages/package_base_type_spec.rb b/spec/graphql/types/packages/package_base_type_spec.rb
index 7156f22c513..ebe29da0539 100644
--- a/spec/graphql/types/packages/package_base_type_spec.rb
+++ b/spec/graphql/types/packages/package_base_type_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe GitlabSchema.types['PackageBase'] do
+RSpec.describe GitlabSchema.types['PackageBase'], feature_category: :package_registry do
specify { expect(described_class.description).to eq('Represents a package in the Package Registry') }
specify { expect(described_class).to require_graphql_authorizations(:read_package) }
@@ -13,7 +13,7 @@ RSpec.describe GitlabSchema.types['PackageBase'] do
created_at updated_at
project
tags metadata
- status can_destroy
+ status status_message can_destroy
]
expect(described_class).to include_graphql_fields(*expected_fields)
diff --git a/spec/graphql/types/packages/protection/rule_access_level_enum_spec.rb b/spec/graphql/types/packages/protection/rule_access_level_enum_spec.rb
new file mode 100644
index 00000000000..421b5fb0f39
--- /dev/null
+++ b/spec/graphql/types/packages/protection/rule_access_level_enum_spec.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe GitlabSchema.types['PackagesProtectionRuleAccessLevel'], feature_category: :package_registry do
+ it 'exposes all options' do
+ expect(described_class.values.keys).to match_array(%w[DEVELOPER MAINTAINER OWNER])
+ end
+end
diff --git a/spec/graphql/types/packages/protection/rule_package_type_enum_spec.rb b/spec/graphql/types/packages/protection/rule_package_type_enum_spec.rb
new file mode 100644
index 00000000000..b0d9772f285
--- /dev/null
+++ b/spec/graphql/types/packages/protection/rule_package_type_enum_spec.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe GitlabSchema.types['PackagesProtectionRulePackageType'], feature_category: :package_registry do
+ it 'exposes all options' do
+ expect(described_class.values.keys).to contain_exactly('NPM')
+ end
+end
diff --git a/spec/graphql/types/packages/protection/rule_type_spec.rb b/spec/graphql/types/packages/protection/rule_type_spec.rb
new file mode 100644
index 00000000000..a4a458d3568
--- /dev/null
+++ b/spec/graphql/types/packages/protection/rule_type_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe GitlabSchema.types['PackagesProtectionRule'], feature_category: :package_registry do
+ specify { expect(described_class.graphql_name).to eq('PackagesProtectionRule') }
+
+ specify { expect(described_class.description).to be_present }
+
+ specify { expect(described_class).to require_graphql_authorizations(:admin_package) }
+
+ describe 'package_name_pattern' do
+ subject { described_class.fields['packageNamePattern'] }
+
+ it { is_expected.to have_non_null_graphql_type(GraphQL::Types::String) }
+ end
+
+ describe 'package_type' do
+ subject { described_class.fields['packageType'] }
+
+ it { is_expected.to have_non_null_graphql_type(Types::Packages::Protection::RulePackageTypeEnum) }
+ end
+
+ describe 'push_protected_up_to_access_level' do
+ subject { described_class.fields['pushProtectedUpToAccessLevel'] }
+
+ it { is_expected.to have_non_null_graphql_type(Types::Packages::Protection::RuleAccessLevelEnum) }
+ end
+end
diff --git a/spec/graphql/types/project_statistics_type_spec.rb b/spec/graphql/types/project_statistics_type_spec.rb
index 558ff41f6f4..f639d042efe 100644
--- a/spec/graphql/types/project_statistics_type_spec.rb
+++ b/spec/graphql/types/project_statistics_type_spec.rb
@@ -4,9 +4,11 @@ require 'spec_helper'
RSpec.describe GitlabSchema.types['ProjectStatistics'] do
it 'has the expected fields' do
- expect(described_class).to include_graphql_fields(:storage_size, :repository_size, :lfs_objects_size,
- :build_artifacts_size, :packages_size, :commit_count,
- :wiki_size, :snippets_size, :pipeline_artifacts_size,
- :uploads_size, :container_registry_size)
+ expect(described_class).to include_graphql_fields(
+ :storage_size, :repository_size, :lfs_objects_size,
+ :build_artifacts_size, :packages_size, :commit_count,
+ :wiki_size, :snippets_size, :pipeline_artifacts_size,
+ :uploads_size, :container_registry_size
+ )
end
end
diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb
index a20a4767bb5..e295014a2a6 100644
--- a/spec/graphql/types/project_type_spec.rb
+++ b/spec/graphql/types/project_type_spec.rb
@@ -39,6 +39,7 @@ RSpec.describe GitlabSchema.types['Project'] do
recent_issue_boards ci_config_path_or_default packages_cleanup_policy ci_variables
timelog_categories fork_targets branch_rules ci_config_variables pipeline_schedules languages
incident_management_timeline_event_tags visible_forks inherited_ci_variables autocomplete_users
+ ci_cd_settings
]
expect(described_class).to include_graphql_fields(*expected_fields)
@@ -328,30 +329,31 @@ RSpec.describe GitlabSchema.types['Project'] do
it { is_expected.to have_graphql_resolver(Resolvers::ProjectMergeRequestsResolver) }
it do
- is_expected.to have_graphql_arguments(:iids,
- :source_branches,
- :target_branches,
- :state,
- :draft,
- :approved,
- :labels,
- :before,
- :after,
- :first,
- :last,
- :merged_after,
- :merged_before,
- :created_after,
- :created_before,
- :updated_after,
- :updated_before,
- :author_username,
- :assignee_username,
- :reviewer_username,
- :milestone_title,
- :not,
- :sort
- )
+ is_expected.to have_graphql_arguments(
+ :iids,
+ :source_branches,
+ :target_branches,
+ :state,
+ :draft,
+ :approved,
+ :labels,
+ :before,
+ :after,
+ :first,
+ :last,
+ :merged_after,
+ :merged_before,
+ :created_after,
+ :created_before,
+ :updated_after,
+ :updated_before,
+ :author_username,
+ :assignee_username,
+ :reviewer_username,
+ :milestone_title,
+ :not,
+ :sort
+ )
end
end
@@ -755,23 +757,29 @@ RSpec.describe GitlabSchema.types['Project'] do
describe 'timeline_event_tags' do
let_it_be(:user) { create(:user) }
let_it_be(:project) do
- create(:project,
- :private,
- :repository,
- creator_id: user.id,
- namespace: user.namespace)
+ create(
+ :project,
+ :private,
+ :repository,
+ creator_id: user.id,
+ namespace: user.namespace
+ )
end
let_it_be(:tag1) do
- create(:incident_management_timeline_event_tag,
- project: project,
- name: 'Tag 1')
+ create(
+ :incident_management_timeline_event_tag,
+ project: project,
+ name: 'Tag 1'
+ )
end
let_it_be(:tag2) do
- create(:incident_management_timeline_event_tag,
- project: project,
- name: 'Tag 2')
+ create(
+ :incident_management_timeline_event_tag,
+ project: project,
+ name: 'Tag 2'
+ )
end
let(:query) do
@@ -809,11 +817,13 @@ RSpec.describe GitlabSchema.types['Project'] do
describe 'languages' do
let_it_be(:user) { create(:user) }
let_it_be(:project) do
- create(:project,
- :private,
- :repository,
- creator_id: user.id,
- namespace: user.namespace)
+ create(
+ :project,
+ :private,
+ :repository,
+ creator_id: user.id,
+ namespace: user.namespace
+ )
end
let(:query) do
diff --git a/spec/graphql/types/snippet_type_spec.rb b/spec/graphql/types/snippet_type_spec.rb
index a46c51e0a27..1fc9bc8b429 100644
--- a/spec/graphql/types/snippet_type_spec.rb
+++ b/spec/graphql/types/snippet_type_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe GitlabSchema.types['Snippet'] do
let_it_be(:user) { create(:user) }
it 'has the correct fields' do
- expected_fields = [:id, :title, :project, :author,
+ expected_fields = [:id, :title, :project, :author, :hidden,
:file_name, :description,
:visibility_level, :created_at, :updated_at,
:web_url, :raw_url, :ssh_url_to_repo, :http_url_to_repo,
diff --git a/spec/graphql/types/todo_type_spec.rb b/spec/graphql/types/todo_type_spec.rb
index 2118a777a45..af1981e804c 100644
--- a/spec/graphql/types/todo_type_spec.rb
+++ b/spec/graphql/types/todo_type_spec.rb
@@ -32,13 +32,15 @@ RSpec.describe GitlabSchema.types['Todo'] do
describe 'project field' do
let(:todo) do
- create(:todo,
- user: current_user,
- project: project,
- state: :done,
- action: Todo::ASSIGNED,
- author: author,
- target: issue)
+ create(
+ :todo,
+ user: current_user,
+ project: project,
+ state: :done,
+ action: Todo::ASSIGNED,
+ author: author,
+ target: issue
+ )
end
let(:query) do
@@ -86,13 +88,15 @@ RSpec.describe GitlabSchema.types['Todo'] do
describe 'group field' do
let(:todo) do
- create(:todo,
- user: current_user,
- group: group,
- state: :done,
- action: Todo::MENTIONED,
- author: author,
- target: issue)
+ create(
+ :todo,
+ user: current_user,
+ group: group,
+ state: :done,
+ action: Todo::MENTIONED,
+ author: author,
+ target: issue
+ )
end
let(:query) do
diff --git a/spec/graphql/types/work_item_type_spec.rb b/spec/graphql/types/work_item_type_spec.rb
index 328450084c2..e57f7aa77ce 100644
--- a/spec/graphql/types/work_item_type_spec.rb
+++ b/spec/graphql/types/work_item_type_spec.rb
@@ -31,6 +31,7 @@ RSpec.describe GitlabSchema.types['WorkItem'], feature_category: :team_planning
web_url
create_note_email
reference
+ archived
]
expect(described_class).to have_graphql_fields(*fields)
diff --git a/spec/graphql/types/work_items/widgets/hierarchy_type_spec.rb b/spec/graphql/types/work_items/widgets/hierarchy_type_spec.rb
index 20413a35c58..a46ffc3db50 100644
--- a/spec/graphql/types/work_items/widgets/hierarchy_type_spec.rb
+++ b/spec/graphql/types/work_items/widgets/hierarchy_type_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Types::WorkItems::Widgets::HierarchyType, feature_category: :team_planning do
it 'exposes the expected fields' do
- expected_fields = %i[parent children has_children type]
+ expected_fields = %i[parent children has_children ancestors type]
expect(described_class).to have_graphql_fields(*expected_fields)
end