diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
commit | e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch) | |
tree | 9abb3c0706576bbda895fe9539a55556930606e2 /spec/features/projects/pipelines/pipeline_spec.rb | |
parent | f8d15ca65390475e356b06dedc51e10ccd179f86 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/pipelines/pipeline_spec.rb')
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 1c72c54f0a1..561c0552007 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -356,7 +356,7 @@ describe 'Pipeline', :js do end end - context 'test tabs' do + describe 'test tabs' do let(:pipeline) { create(:ci_pipeline, :with_test_reports, project: project) } before do @@ -364,21 +364,31 @@ describe 'Pipeline', :js do wait_for_requests end - it 'shows badge counter in Tests tab' do - expect(pipeline.test_reports.total_count).to eq(4) - expect(page.find('.js-test-report-badge-counter').text).to eq(pipeline.test_reports.total_count.to_s) - end + context 'with test reports' do + it 'shows badge counter in Tests tab' do + expect(pipeline.test_reports.total_count).to eq(4) + expect(page.find('.js-test-report-badge-counter').text).to eq(pipeline.test_reports.total_count.to_s) + end + + it 'does not call test_report.json endpoint by default', :js do + expect(page).to have_selector('.js-no-tests-to-show', visible: :all) + end - it 'does not call test_report.json endpoint by default', :js do - expect(page).to have_selector('.js-no-tests-to-show', visible: :all) + it 'does call test_report.json endpoint when tab is selected', :js do + find('.js-tests-tab-link').click + wait_for_requests + + expect(page).to have_content('Test suites') + expect(page).to have_selector('.js-tests-detail', visible: :all) + end end - it 'does call test_report.json endpoint when tab is selected', :js do - find('.js-tests-tab-link').click - wait_for_requests + context 'without test reports' do + let(:pipeline) { create(:ci_pipeline, project: project) } - expect(page).to have_content('Test suites') - expect(page).to have_selector('.js-tests-detail', visible: :all) + it 'shows nothing' do + expect(page.find('.js-test-report-badge-counter', visible: :all).text).to eq("") + end end end |