diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/requests/api/graphql/ci/jobs_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/requests/api/graphql/ci/jobs_spec.rb')
-rw-r--r-- | spec/requests/api/graphql/ci/jobs_spec.rb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/spec/requests/api/graphql/ci/jobs_spec.rb b/spec/requests/api/graphql/ci/jobs_spec.rb index b191b585d06..2d1bb45390b 100644 --- a/spec/requests/api/graphql/ci/jobs_spec.rb +++ b/spec/requests/api/graphql/ci/jobs_spec.rb @@ -155,6 +155,56 @@ RSpec.describe 'Query.project.pipeline' do end end + describe '.jobs.kind' do + let_it_be(:pipeline) { create(:ci_pipeline, project: project) } + + let(:query) do + %( + query { + project(fullPath: "#{project.full_path}") { + pipeline(iid: "#{pipeline.iid}") { + stages { + nodes { + groups{ + nodes { + jobs { + nodes { + kind + } + } + } + } + } + } + } + } + } + ) + end + + context 'when the job is a build' do + it 'returns BUILD' do + create(:ci_build, pipeline: pipeline) + + post_graphql(query, current_user: user) + + job_data = graphql_data_at(:project, :pipeline, :stages, :nodes, :groups, :nodes, :jobs, :nodes).first + expect(job_data['kind']).to eq 'BUILD' + end + end + + context 'when the job is a bridge' do + it 'returns BRIDGE' do + create(:ci_bridge, pipeline: pipeline) + + post_graphql(query, current_user: user) + + job_data = graphql_data_at(:project, :pipeline, :stages, :nodes, :groups, :nodes, :jobs, :nodes).first + expect(job_data['kind']).to eq 'BRIDGE' + end + end + end + describe '.jobs.artifacts' do let_it_be(:pipeline) { create(:ci_pipeline, project: project) } |