diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/graphql/types/ci/status_action_type_spec.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/graphql/types/ci/status_action_type_spec.rb')
-rw-r--r-- | spec/graphql/types/ci/status_action_type_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/graphql/types/ci/status_action_type_spec.rb b/spec/graphql/types/ci/status_action_type_spec.rb index 8a99068e44f..ab7dee3dd11 100644 --- a/spec/graphql/types/ci/status_action_type_spec.rb +++ b/spec/graphql/types/ci/status_action_type_spec.rb @@ -3,10 +3,13 @@ require 'spec_helper' RSpec.describe Types::Ci::StatusActionType do + include GraphqlHelpers + specify { expect(described_class.graphql_name).to eq('StatusAction') } it 'exposes the expected fields' do expected_fields = %i[ + id buttonTitle icon path @@ -16,4 +19,21 @@ RSpec.describe Types::Ci::StatusActionType do expect(described_class).to have_graphql_fields(*expected_fields) end + + describe 'id field' do + it 'correctly renders the field' 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) + end + end end |