diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/graphql/types | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/graphql/types')
-rw-r--r-- | spec/graphql/types/base_object_spec.rb | 20 | ||||
-rw-r--r-- | spec/graphql/types/ci/job_kind_enum_spec.rb | 11 | ||||
-rw-r--r-- | spec/graphql/types/ci/job_type_spec.rb | 1 | ||||
-rw-r--r-- | spec/graphql/types/container_repository_details_type_spec.rb | 4 | ||||
-rw-r--r-- | spec/graphql/types/container_repository_type_spec.rb | 4 | ||||
-rw-r--r-- | spec/graphql/types/dependency_proxy/manifest_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/types/issue_sort_enum_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/types/range_input_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/types/repository/blob_type_spec.rb | 3 | ||||
-rw-r--r-- | spec/graphql/types/subscription_type_spec.rb | 1 |
10 files changed, 43 insertions, 7 deletions
diff --git a/spec/graphql/types/base_object_spec.rb b/spec/graphql/types/base_object_spec.rb index d8f2ef58ea5..45dc885ecba 100644 --- a/spec/graphql/types/base_object_spec.rb +++ b/spec/graphql/types/base_object_spec.rb @@ -428,5 +428,25 @@ RSpec.describe Types::BaseObject do expect(result.dig('data', 'users', 'nodes')) .to contain_exactly({ 'name' => active_users.first.name }) end + + describe '.authorize' do + let_it_be(:read_only_type) do + Class.new(described_class) do + authorize :read_only + end + end + + let_it_be(:inherited_read_only_type) { Class.new(read_only_type) } + + it 'keeps track of the specified value' do + expect(described_class.authorize).to be_nil + expect(read_only_type.authorize).to match_array [:read_only] + expect(inherited_read_only_type.authorize).to match_array [:read_only] + end + + it 'can not redefine the authorize value' do + expect { read_only_type.authorize(:write_only) }.to raise_error('Cannot redefine authorize') + end + end end end diff --git a/spec/graphql/types/ci/job_kind_enum_spec.rb b/spec/graphql/types/ci/job_kind_enum_spec.rb new file mode 100644 index 00000000000..b48d20b71e2 --- /dev/null +++ b/spec/graphql/types/ci/job_kind_enum_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GitlabSchema.types['CiJobKind'] do + it 'exposes some job type values' do + expect(described_class.values.keys).to match_array( + (%w[BRIDGE BUILD]) + ) + end +end diff --git a/spec/graphql/types/ci/job_type_spec.rb b/spec/graphql/types/ci/job_type_spec.rb index 47d697ab8b8..655c3636883 100644 --- a/spec/graphql/types/ci/job_type_spec.rb +++ b/spec/graphql/types/ci/job_type_spec.rb @@ -21,6 +21,7 @@ RSpec.describe Types::Ci::JobType do downstreamPipeline finished_at id + kind manual_job name needs diff --git a/spec/graphql/types/container_repository_details_type_spec.rb b/spec/graphql/types/container_repository_details_type_spec.rb index aa770284f89..d94516c6fce 100644 --- a/spec/graphql/types/container_repository_details_type_spec.rb +++ b/spec/graphql/types/container_repository_details_type_spec.rb @@ -3,7 +3,9 @@ require 'spec_helper' RSpec.describe GitlabSchema.types['ContainerRepositoryDetails'] do - fields = %i[id name path location created_at updated_at expiration_policy_started_at status tags_count can_delete expiration_policy_cleanup_status tags size project] + fields = %i[id name path location created_at updated_at expiration_policy_started_at + status tags_count can_delete expiration_policy_cleanup_status tags size + project migration_state] it { expect(described_class.graphql_name).to eq('ContainerRepositoryDetails') } diff --git a/spec/graphql/types/container_repository_type_spec.rb b/spec/graphql/types/container_repository_type_spec.rb index 87e1c11ce19..9815449dd68 100644 --- a/spec/graphql/types/container_repository_type_spec.rb +++ b/spec/graphql/types/container_repository_type_spec.rb @@ -3,7 +3,9 @@ require 'spec_helper' RSpec.describe GitlabSchema.types['ContainerRepository'] do - fields = %i[id name path location created_at updated_at expiration_policy_started_at status tags_count can_delete expiration_policy_cleanup_status project] + fields = %i[id name path location created_at updated_at expiration_policy_started_at + status tags_count can_delete expiration_policy_cleanup_status project + migration_state] it { expect(described_class.graphql_name).to eq('ContainerRepository') } diff --git a/spec/graphql/types/dependency_proxy/manifest_type_spec.rb b/spec/graphql/types/dependency_proxy/manifest_type_spec.rb index b251ca63c4f..f688b085b10 100644 --- a/spec/graphql/types/dependency_proxy/manifest_type_spec.rb +++ b/spec/graphql/types/dependency_proxy/manifest_type_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe GitlabSchema.types['DependencyProxyManifest'] do it 'includes dependency proxy manifest fields' do expected_fields = %w[ - id file_name image_name size created_at updated_at digest + id file_name image_name size created_at updated_at digest status ] expect(described_class).to include_graphql_fields(*expected_fields) diff --git a/spec/graphql/types/issue_sort_enum_spec.rb b/spec/graphql/types/issue_sort_enum_spec.rb index 4433709d193..95184477e75 100644 --- a/spec/graphql/types/issue_sort_enum_spec.rb +++ b/spec/graphql/types/issue_sort_enum_spec.rb @@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['IssueSort'] do it 'exposes all the existing issue sort values' do expect(described_class.values.keys).to include( - *%w[DUE_DATE_ASC DUE_DATE_DESC RELATIVE_POSITION_ASC SEVERITY_ASC SEVERITY_DESC] + *%w[DUE_DATE_ASC DUE_DATE_DESC RELATIVE_POSITION_ASC SEVERITY_ASC SEVERITY_DESC ESCALATION_STATUS_ASC ESCALATION_STATUS_DESC] ) end end diff --git a/spec/graphql/types/range_input_type_spec.rb b/spec/graphql/types/range_input_type_spec.rb index fc9126247fa..dbfcf4a41c7 100644 --- a/spec/graphql/types/range_input_type_spec.rb +++ b/spec/graphql/types/range_input_type_spec.rb @@ -24,7 +24,7 @@ RSpec.describe ::Types::RangeInputType do it 'follows expected subtyping relationships for instances' do context = GraphQL::Query::Context.new( - query: double('query', schema: nil), + query: GraphQL::Query.new(GitlabSchema), values: {}, object: nil ) diff --git a/spec/graphql/types/repository/blob_type_spec.rb b/spec/graphql/types/repository/blob_type_spec.rb index a813ef85e6e..787b5f4a311 100644 --- a/spec/graphql/types/repository/blob_type_spec.rb +++ b/spec/graphql/types/repository/blob_type_spec.rb @@ -34,7 +34,6 @@ RSpec.describe Types::Repository::BlobType do :environment_external_url_for_route_map, :code_navigation_path, :project_blob_path_root, - :code_owners, :simple_viewer, :rich_viewer, :plain_data, @@ -47,6 +46,6 @@ RSpec.describe Types::Repository::BlobType do :ide_fork_and_edit_path, :fork_and_view_path, :language - ) + ).at_least end end diff --git a/spec/graphql/types/subscription_type_spec.rb b/spec/graphql/types/subscription_type_spec.rb index 593795de004..1a2629ed422 100644 --- a/spec/graphql/types/subscription_type_spec.rb +++ b/spec/graphql/types/subscription_type_spec.rb @@ -8,6 +8,7 @@ RSpec.describe GitlabSchema.types['Subscription'] do issuable_assignees_updated issue_crm_contacts_updated issuable_title_updated + issuable_labels_updated ] expect(described_class).to have_graphql_fields(*expected_fields).only |