2020-04-22 19:07:51 +05:30
|
|
|
import { mount } from '@vue/test-utils';
|
2021-04-29 21:17:54 +05:30
|
|
|
import jobNameComponent from '~/pipelines/components/jobs_shared/job_name_component.vue';
|
2021-03-11 19:13:27 +05:30
|
|
|
import ciIcon from '~/vue_shared/components/ci_icon.vue';
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
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', () => {
|
2021-01-03 14:25:43 +05:30
|
|
|
expect(wrapper.text()).toBe(propsData.name);
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('should render an icon with the provided status', () => {
|
2022-10-11 01:57:18 +05:30
|
|
|
expect(wrapper.findComponent(ciIcon).exists()).toBe(true);
|
2020-04-22 19:07:51 +05:30
|
|
|
expect(wrapper.find('.ci-status-icon-success').exists()).toBe(true);
|
|
|
|
});
|
|
|
|
});
|