blob: b84ca77081a3a54dbeab81948949a997be24f068 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import { mount } from '@vue/test-utils';
import jobNameComponent from '~/ci/common/private/job_name_component.vue';
import CiIcon from '~/vue_shared/components/ci_icon/ci_icon.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', () => {
expect(wrapper.text()).toBe(propsData.name);
});
it('should render an icon with the provided status', () => {
expect(wrapper.findComponent(CiIcon).exists()).toBe(true);
expect(wrapper.find('[data-testid="status_success_borderless-icon"]').exists()).toBe(true);
});
});
|