diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/graphql/types/ci | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/graphql/types/ci')
-rw-r--r-- | spec/graphql/types/ci/detailed_status_type_spec.rb | 21 | ||||
-rw-r--r-- | spec/graphql/types/ci/job_type_spec.rb | 1 | ||||
-rw-r--r-- | spec/graphql/types/ci/runner_setup_type_spec.rb | 16 |
3 files changed, 37 insertions, 1 deletions
diff --git a/spec/graphql/types/ci/detailed_status_type_spec.rb b/spec/graphql/types/ci/detailed_status_type_spec.rb index ddb3a1450df..9fa3280657a 100644 --- a/spec/graphql/types/ci/detailed_status_type_spec.rb +++ b/spec/graphql/types/ci/detailed_status_type_spec.rb @@ -3,11 +3,30 @@ require 'spec_helper' RSpec.describe Types::Ci::DetailedStatusType do + include GraphqlHelpers + specify { expect(described_class.graphql_name).to eq('DetailedStatus') } - it "has all fields" do + it 'has all fields' do expect(described_class).to have_graphql_fields(:group, :icon, :favicon, :details_path, :has_details, :label, :text, :tooltip, :action) end + + describe 'action field' do + it 'correctly renders the field' do + stage = create(:ci_stage_entity, status: :skipped) + 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 + } + + expect(resolve_field('action', status)).to eq(expected_status) + end + end end diff --git a/spec/graphql/types/ci/job_type_spec.rb b/spec/graphql/types/ci/job_type_spec.rb index 3a54ed2efed..3dcb81eefbf 100644 --- a/spec/graphql/types/ci/job_type_spec.rb +++ b/spec/graphql/types/ci/job_type_spec.rb @@ -7,6 +7,7 @@ RSpec.describe Types::Ci::JobType do it 'exposes the expected fields' do expected_fields = %i[ + pipeline name needs detailedStatus diff --git a/spec/graphql/types/ci/runner_setup_type_spec.rb b/spec/graphql/types/ci/runner_setup_type_spec.rb new file mode 100644 index 00000000000..197e717e964 --- /dev/null +++ b/spec/graphql/types/ci/runner_setup_type_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::Ci::RunnerSetupType do + specify { expect(described_class.graphql_name).to eq('RunnerSetup') } + + it 'exposes the expected fields' do + expected_fields = %i[ + install_instructions + register_instructions + ] + + expect(described_class).to have_graphql_fields(*expected_fields) + end +end |