blob: f4893c4077f3207f9e36b2aad33da9a46d896066 (
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
|
import { GlEmptyState } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import JobsTableEmptyState from '~/ci/jobs_page/components/jobs_table_empty_state.vue';
describe('Jobs table empty state', () => {
let wrapper;
const pipelineEditorPath = '/root/project/-/ci/editor';
const emptyStateSvgPath = 'assets/jobs-empty-state.svg';
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
const createComponent = () => {
wrapper = shallowMount(JobsTableEmptyState, {
provide: {
pipelineEditorPath,
emptyStateSvgPath,
},
});
};
beforeEach(() => {
createComponent();
});
it('displays empty state', () => {
expect(findEmptyState().exists()).toBe(true);
});
it('links to the pipeline editor', () => {
expect(findEmptyState().props('primaryButtonLink')).toBe(pipelineEditorPath);
});
it('shows an empty state image', () => {
expect(findEmptyState().props('svgPath')).toBe(emptyStateSvgPath);
});
});
|