2017-05-06 13:02:06 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import jobNameComponent from '~/pipelines/components/graph/job_name_component.vue';
|
|
|
|
|
|
|
|
describe('job name component', () => {
|
|
|
|
let component;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
const JobNameComponent = Vue.extend(jobNameComponent);
|
|
|
|
component = new JobNameComponent({
|
|
|
|
propsData: {
|
|
|
|
name: 'foo',
|
|
|
|
status: {
|
2018-07-18 12:56:19 -04:00
|
|
|
icon: 'status_success',
|
2017-05-06 13:02:06 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}).$mount();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render the provided name', () => {
|
|
|
|
expect(component.$el.querySelector('.ci-status-text').textContent.trim()).toEqual('foo');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render an icon with the provided status', () => {
|
|
|
|
expect(component.$el.querySelector('.ci-status-icon-success')).toBeDefined();
|
|
|
|
expect(component.$el.querySelector('.ci-status-icon-success svg')).toBeDefined();
|
|
|
|
});
|
|
|
|
});
|