Commit f108d27b authored by Paul Slaughter's avatar Paul Slaughter

Merge branch...

Merge branch '37725-pipeline-junit-view-performance-on-running-on-big-data-set-fix-no-test-reports' into 'master'

Fix junit test tab if no test reports

See merge request gitlab-org/gitlab!25285
parents c3fc527c d7403c3f
......@@ -134,6 +134,10 @@ export default () => {
axios
.get(dataset.testReportsCountEndpoint)
.then(({ data }) => {
if (!data.total_count) {
return;
}
document.querySelector('.js-test-report-badge-counter').innerHTML = data.total_count;
})
.catch(() => {});
......
......@@ -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,6 +364,7 @@ describe 'Pipeline', :js do
wait_for_requests
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)
......@@ -382,6 +383,15 @@ describe 'Pipeline', :js do
end
end
context 'without test reports' do
let(:pipeline) { create(:ci_pipeline, project: project) }
it 'shows nothing' do
expect(page.find('.js-test-report-badge-counter', visible: :all).text).to eq("")
end
end
end
context 'retrying jobs' do
before do
visit_pipeline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment