blob: 629c442431401f613df35c659b621f3fd8bdc225 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
|
import { mount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
import Description from '~/ide/components/jobs/detail/description.vue';
import { jobs } from '../../../mock_data';
describe('IDE job description', () => {
let wrapper;
beforeEach(() => {
wrapper = mount(Description, {
propsData: {
job: jobs[0],
},
});
});
afterEach(() => {
wrapper.destroy();
});
it('renders job details', () => {
expect(wrapper.text()).toContain('#1');
expect(wrapper.text()).toContain('test');
});
it('renders CI icon', () => {
expect(wrapper.find('.ci-status-icon').findComponent(GlIcon).exists()).toBe(true);
});
it('renders a borderless CI icon', () => {
expect(wrapper.find('.borderless').findComponent(GlIcon).exists()).toBe(true);
});
it('renders bridge job details without the job link', () => {
wrapper = mount(Description, {
propsData: {
job: { ...jobs[0], path: undefined },
},
});
expect(wrapper.find('[data-testid="description-detail-link"]').exists()).toBe(false);
});
});
|