Commit d7403c3f authored by Maxime Orefice's avatar Maxime Orefice Committed by Paul Slaughter

Fix junit test tab if no test reports

parent 46eb6ce2
......@@ -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