Commit ec37b1b2 authored by Phil Hughes's avatar Phil Hughes

added empty state

parent b9928718
<script>
import { mapActions, mapState } from 'vuex';
import _ from 'underscore';
import { __ } from '../../../locale';
import tooltip from '../../../vue_shared/directives/tooltip';
import Icon from '../../../vue_shared/components/icon.vue';
import ScrollButton from './detail/scroll_button.vue';
......@@ -33,6 +34,9 @@ export default {
isScrolledToTop() {
return this.scrollPos === scrollPositions.top;
},
jobOutput() {
return this.detailJob.output || __('No messages were logged');
},
},
mounted() {
this.getTrace();
......@@ -119,7 +123,7 @@ export default {
>
<code
class="bash"
v-html="detailJob.output"
v-html="jobOutput"
>
</code>
<div
......
......@@ -32,6 +32,7 @@ export default {
/>
<div class="ml-auto align-self-center">
<button
v-if="job.started"
type="button"
class="btn btn-default btn-sm"
@click="clickViewLog"
......
......@@ -1207,7 +1207,7 @@
margin-left: -$gl-padding;
}
.top-bar {
&.build-page .top-bar {
top: 0;
font-size: 12px;
border-top-right-radius: $border-radius-default;
......
......@@ -47,6 +47,16 @@ describe('IDE jobs detail view', () => {
expect(vm.$el.querySelector('.bash').textContent).toContain('testing');
});
it('renders empty message output', done => {
vm.$store.state.pipelines.detailJob.output = '';
vm.$nextTick(() => {
expect(vm.$el.querySelector('.bash').textContent).toContain('No messages were logged');
done();
});
});
it('renders loading icon', () => {
expect(vm.$el.querySelector('.build-loader-animation')).not.toBe(null);
expect(vm.$el.querySelector('.build-loader-animation').style.display).toBe('');
......
......@@ -26,4 +26,14 @@ describe('IDE jobs item', () => {
it('renders CI icon', () => {
expect(vm.$el.querySelector('.ic-status_passed_borderless')).not.toBe(null);
});
it('does not render view logs button if not started', done => {
vm.job.started = false;
vm.$nextTick(() => {
expect(vm.$el.querySelector('.btn')).toBe(null);
done();
});
});
});
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