diff options
Diffstat (limited to 'spec/features/projects/pipelines/legacy_pipeline_spec.rb')
-rw-r--r-- | spec/features/projects/pipelines/legacy_pipeline_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/features/projects/pipelines/legacy_pipeline_spec.rb b/spec/features/projects/pipelines/legacy_pipeline_spec.rb index db6feecba03..14f60dfe061 100644 --- a/spec/features/projects/pipelines/legacy_pipeline_spec.rb +++ b/spec/features/projects/pipelines/legacy_pipeline_spec.rb @@ -385,6 +385,37 @@ RSpec.describe 'Pipeline', :js do end end + describe 'test tabs' do + let(:pipeline) { create(:ci_pipeline, :with_test_reports, :with_report_results, project: project) } + + before do + stub_feature_flags(pipeline_tabs_vue: false) + visit_pipeline + wait_for_requests + end + + context 'with test reports' do + it 'shows badge counter in Tests tab' do + expect(page.find('.js-test-report-badge-counter').text).to eq(pipeline.test_report_summary.total[:count].to_s) + end + + it 'calls summary.json endpoint', :js do + find('.js-tests-tab-link').click + + expect(page).to have_content('Jobs') + expect(page).to have_selector('[data-testid="tests-detail"]', visible: :all) + end + end + + context 'without test reports' do + let(:pipeline) { create(:ci_pipeline, project: project) } + + it 'shows zero' do + expect(page.find('.js-test-report-badge-counter', visible: :all).text).to eq("0") + end + end + end + context 'retrying jobs' do before do visit_pipeline |