summaryrefslogtreecommitdiff
path: root/spec/features/projects/commit/mini_pipeline_graph_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/commit/mini_pipeline_graph_spec.rb')
-rw-r--r--spec/features/projects/commit/mini_pipeline_graph_spec.rb52
1 files changed, 35 insertions, 17 deletions
diff --git a/spec/features/projects/commit/mini_pipeline_graph_spec.rb b/spec/features/projects/commit/mini_pipeline_graph_spec.rb
index cf9b86f16bb..7d206f76031 100644
--- a/spec/features/projects/commit/mini_pipeline_graph_spec.rb
+++ b/spec/features/projects/commit/mini_pipeline_graph_spec.rb
@@ -7,37 +7,55 @@ RSpec.describe 'Mini Pipeline Graph in Commit View', :js do
context 'when commit has pipelines' do
let(:pipeline) do
- create(:ci_empty_pipeline,
+ create(:ci_pipeline,
+ status: :running,
project: project,
ref: project.default_branch,
sha: project.commit.sha)
end
- let(:build) { create(:ci_build, pipeline: pipeline) }
+ let(:build) { create(:ci_build, pipeline: pipeline, status: :running) }
- it 'display icon with status' do
- build.run
- visit project_commit_path(project, project.commit.id)
+ shared_examples 'shows ci icon and mini pipeline' do
+ before do
+ build.run
+ visit project_commit_path(project, project.commit.id)
+ end
- expect(page).to have_selector('.ci-status-icon-running')
- end
+ it 'display icon with status' do
+ expect(page).to have_selector('.ci-status-icon-running')
+ end
- it 'displays a mini pipeline graph' do
- build.run
- visit project_commit_path(project, project.commit.id)
+ it 'displays a mini pipeline graph' do
+ expect(page).to have_selector('.mr-widget-pipeline-graph')
- expect(page).to have_selector('.mr-widget-pipeline-graph')
+ first('.mini-pipeline-graph-dropdown-toggle').click
- first('.mini-pipeline-graph-dropdown-toggle').click
+ wait_for_requests
- wait_for_requests
+ page.within '.js-builds-dropdown-list' do
+ expect(page).to have_selector('.ci-status-icon-running')
+ expect(page).to have_content(build.stage)
+ end
- page.within '.js-builds-dropdown-list' do
- expect(page).to have_selector('.ci-status-icon-running')
- expect(page).to have_content(build.stage)
+ build.drop
+ end
+ end
+
+ context 'when ci_commit_pipeline_mini_graph_vue is disabled' do
+ before do
+ stub_feature_flags(ci_commit_pipeline_mini_graph_vue: false)
+ end
+
+ it_behaves_like 'shows ci icon and mini pipeline'
+ end
+
+ context 'when ci_commit_pipeline_mini_graph_vue is enabled' do
+ before do
+ stub_feature_flags(ci_commit_pipeline_mini_graph_vue: true)
end
- build.drop
+ it_behaves_like 'shows ci icon and mini pipeline'
end
end