summaryrefslogtreecommitdiff
path: root/spec/graphql/types/ci
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/graphql/types/ci
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/graphql/types/ci')
-rw-r--r--spec/graphql/types/ci/detailed_status_type_spec.rb6
-rw-r--r--spec/graphql/types/ci/pipeline_merge_request_event_type_enum_spec.rb14
-rw-r--r--spec/graphql/types/ci/pipeline_type_spec.rb2
-rw-r--r--spec/graphql/types/ci/runner_type_spec.rb2
-rw-r--r--spec/graphql/types/ci/status_action_type_spec.rb8
5 files changed, 19 insertions, 13 deletions
diff --git a/spec/graphql/types/ci/detailed_status_type_spec.rb b/spec/graphql/types/ci/detailed_status_type_spec.rb
index 5ed79b73a47..0c05227aec2 100644
--- a/spec/graphql/types/ci/detailed_status_type_spec.rb
+++ b/spec/graphql/types/ci/detailed_status_type_spec.rb
@@ -17,12 +17,10 @@ RSpec.describe Types::Ci::DetailedStatusType do
describe 'id field' do
it 'correctly renders the field' do
- parent_object = double(:parent_object, object: stage)
- parent = double(:parent, object: parent_object)
status = stage.detailed_status(stage.pipeline.user)
expected_id = "#{status.id}-#{stage.id}"
- expect(resolve_field('id', status, extras: { parent: parent })).to eq(expected_id)
+ expect(resolve_field('id', status, extras: { parent: stage }, arg_style: :internal)).to eq(expected_id)
end
end
@@ -38,7 +36,7 @@ RSpec.describe Types::Ci::DetailedStatusType do
title: status.action_title
}
- expect(resolve_field('action', status)).to eq(expected_status)
+ expect(resolve_field('action', status, arg_style: :internal)).to eq(expected_status)
end
end
end
diff --git a/spec/graphql/types/ci/pipeline_merge_request_event_type_enum_spec.rb b/spec/graphql/types/ci/pipeline_merge_request_event_type_enum_spec.rb
new file mode 100644
index 00000000000..3a90e4f1fd9
--- /dev/null
+++ b/spec/graphql/types/ci/pipeline_merge_request_event_type_enum_spec.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe GitlabSchema.types['PipelineMergeRequestEventType'] do
+ specify { expect(described_class.graphql_name).to eq('PipelineMergeRequestEventType') }
+
+ it 'has specific values' do
+ expect(described_class.values).to match a_hash_including(
+ 'MERGED_RESULT' => have_attributes(value: :merged_result),
+ 'DETACHED' => have_attributes(value: :detached)
+ )
+ end
+end
diff --git a/spec/graphql/types/ci/pipeline_type_spec.rb b/spec/graphql/types/ci/pipeline_type_spec.rb
index 94d1b42da37..9dee834d05f 100644
--- a/spec/graphql/types/ci/pipeline_type_spec.rb
+++ b/spec/graphql/types/ci/pipeline_type_spec.rb
@@ -14,7 +14,7 @@ RSpec.describe Types::Ci::PipelineType do
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
+ test_report_summary test_suite ref ref_path warning_messages merge_request_event_type
]
if Gitlab.ee?
diff --git a/spec/graphql/types/ci/runner_type_spec.rb b/spec/graphql/types/ci/runner_type_spec.rb
index 26ac7a4da8d..4ec35db13fb 100644
--- a/spec/graphql/types/ci/runner_type_spec.rb
+++ b/spec/graphql/types/ci/runner_type_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe GitlabSchema.types['CiRunner'] do
id description created_at contacted_at maximum_timeout access_level active paused status
version short_sha revision locked run_untagged ip_address runner_type tag_list
project_count job_count admin_url edit_admin_url user_permissions executor_name architecture_name platform_name
- maintenance_note groups projects jobs token_expires_at
+ maintenance_note maintenance_note_html groups projects jobs token_expires_at owner_project
]
expect(described_class).to include_graphql_fields(*expected_fields)
diff --git a/spec/graphql/types/ci/status_action_type_spec.rb b/spec/graphql/types/ci/status_action_type_spec.rb
index ab7dee3dd11..4c467bf240e 100644
--- a/spec/graphql/types/ci/status_action_type_spec.rb
+++ b/spec/graphql/types/ci/status_action_type_spec.rb
@@ -25,15 +25,9 @@ RSpec.describe Types::Ci::StatusActionType do
stage = build(:ci_stage_entity, status: :skipped)
status = stage.detailed_status(stage.pipeline.user)
- grandparent_object = double(:grandparent_object, object: stage)
- parent_object = double(:parent_object, object: status)
-
- grandparent = double(:parent, object: grandparent_object)
- parent = double(:parent, object: parent_object, parent: grandparent)
-
expected_id = "#{stage.class.name}-#{status.id}"
- expect(resolve_field('id', status, extras: { parent: parent })).to eq(expected_id)
+ expect(resolve_field('id', status, extras: { parent: status }, arg_style: :internal)).to eq(expected_id)
end
end
end