blob: ab442a2781763addd33d65affcc6b84c1a011ccd (
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
|
import { mount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui';
import JobItem from '~/ide/components/jobs/item.vue';
import { jobs } from '../../mock_data';
describe('IDE jobs item', () => {
const job = jobs[0];
let wrapper;
beforeEach(() => {
wrapper = mount(JobItem, { propsData: { job } });
});
it('renders job details', () => {
expect(wrapper.text()).toContain(job.name);
expect(wrapper.text()).toContain(`#${job.id}`);
});
it('renders CI icon', () => {
expect(wrapper.find('[data-testid="status_success_borderless-icon"]').exists()).toBe(true);
});
it('does not render view logs button if not started', async () => {
await wrapper.setProps({
job: {
...jobs[0],
started: false,
},
});
expect(wrapper.findComponent(GlButton).exists()).toBe(false);
});
});
|