debian-mirror-gitlab/spec/frontend/pipelines/graph/job_name_component_spec.js

32 lines
757 B
JavaScript
Raw Normal View History

2020-04-22 19:07:51 +05:30
import { mount } from '@vue/test-utils';
import ciIcon from '~/vue_shared/components/ci_icon.vue';
import jobNameComponent from '~/pipelines/components/graph/job_name_component.vue';
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', () => {
expect(wrapper.find(ciIcon).exists()).toBe(true);
expect(wrapper.find('.ci-status-icon-success').exists()).toBe(true);
});
});