blob: 128ccff65686597762cf1042523c7d59f4df58a6 (
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
44
|
import Vue from 'vue';
import mountComponent from 'helpers/vue_mount_component_helper';
import Description from '~/ide/components/jobs/detail/description.vue';
import { jobs } from '../../../mock_data';
describe('IDE job description', () => {
const Component = Vue.extend(Description);
let vm;
beforeEach(() => {
vm = mountComponent(Component, {
job: jobs[0],
});
});
afterEach(() => {
vm.$destroy();
});
it('renders job details', () => {
expect(vm.$el.textContent).toContain('#1');
expect(vm.$el.textContent).toContain('test');
});
it('renders CI icon', () => {
expect(
vm.$el.querySelector('.ci-status-icon [data-testid="status_success_borderless-icon"]'),
).not.toBe(null);
});
it('renders a borderless CI icon', () => {
expect(
vm.$el.querySelector('.borderless [data-testid="status_success_borderless-icon"]'),
).not.toBe(null);
});
it('renders bridge job details without the job link', () => {
vm = mountComponent(Component, {
job: { ...jobs[0], path: undefined },
});
expect(vm.$el.querySelector('[data-testid="description-detail-link"]')).toBe(null);
});
});
|