2020-04-21 11:21:10 -04:00
|
|
|
import { mount } from '@vue/test-utils';
|
2021-03-26 14:09:16 -04:00
|
|
|
import jobNameComponent from '~/pipelines/components/jobs_shared/job_name_component.vue';
|
2021-02-14 13:09:20 -05:00
|
|
|
import ciIcon from '~/vue_shared/components/ci_icon.vue';
|
2020-04-21 11:21:10 -04:00
|
|
|
|
|
|
|
describe('job name component', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
const propsData = {
|
|
|
|
name: 'foo',
|
|
|
|
status: {
|
|
|
|
icon: 'status_success',
|
|
|
|
group: 'success',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
wrapper = mount(jobNameComponent, {
|
|
|
|
propsData,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render the provided name', () => {
|
2020-10-16 08:09:33 -04:00
|
|
|
expect(wrapper.text()).toBe(propsData.name);
|
2020-04-21 11:21:10 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should render an icon with the provided status', () => {
|
2022-09-12 11:14:03 -04:00
|
|
|
expect(wrapper.findComponent(ciIcon).exists()).toBe(true);
|
2020-04-21 11:21:10 -04:00
|
|
|
expect(wrapper.find('.ci-status-icon-success').exists()).toBe(true);
|
|
|
|
});
|
|
|
|
});
|