Commit 3077c356 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '59521-job-sidebar-has-a-blank-block' into 'master'

Remove blank block from job sidebar

Closes #59521

See merge request gitlab-org/gitlab-ce!30754
parents 040eb078 144268da
...@@ -73,15 +73,14 @@ export default { ...@@ -73,15 +73,14 @@ export default {
}, },
renderBlock() { renderBlock() {
return ( return (
this.job.merge_request ||
this.job.duration || this.job.duration ||
this.job.finished_data || this.job.finished_at ||
this.job.erased_at || this.job.erased_at ||
this.job.queued || this.job.queued ||
this.hasTimeout ||
this.job.runner || this.job.runner ||
this.job.coverage || this.job.coverage ||
this.job.tags.length || this.job.tags.length
this.job.cancel_path
); );
}, },
hasArtifact() { hasArtifact() {
...@@ -160,7 +159,7 @@ export default { ...@@ -160,7 +159,7 @@ export default {
</gl-link> </gl-link>
</div> </div>
<div :class="{ block: renderBlock }"> <div v-if="renderBlock" class="block">
<detail-row <detail-row
v-if="job.duration" v-if="job.duration"
:value="duration" :value="duration"
......
---
title: Remove blank block from job sidebar
merge_request: 30754
author:
type: fixed
...@@ -486,6 +486,31 @@ describe('Job App ', () => { ...@@ -486,6 +486,31 @@ describe('Job App ', () => {
}); });
}); });
}); });
describe('sidebar', () => {
it('has no blank blocks', done => {
mock.onGet(props.endpoint).replyOnce(
200,
Object.assign({}, job, {
duration: null,
finished_at: null,
erased_at: null,
queued: null,
runner: null,
coverage: null,
tags: [],
cancel_path: null,
}),
);
vm.$nextTick(() => {
vm.$el.querySelectorAll('.blocks-container > *').forEach(block => {
expect(block.textContent.trim()).not.toBe('');
});
done();
});
});
});
}); });
describe('archived job', () => { describe('archived job', () => {
......
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