blob: 5f530f2c3beed4d177bd41f73326bcd4fbdc9f5c (
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 { shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import ImportHistoryLink from '~/import_entities/import_groups/components/import_history_link.vue';
describe('import history link', () => {
let wrapper;
const mockHistoryPath = '/import/history';
const createComponent = ({ props } = {}) => {
wrapper = shallowMount(ImportHistoryLink, {
propsData: {
historyPath: mockHistoryPath,
...props,
},
});
};
const findGlLink = () => wrapper.findComponent(GlLink);
it('renders link with href', () => {
const mockId = 174;
createComponent({
props: {
id: mockId,
},
});
expect(findGlLink().text()).toBe('View details');
expect(findGlLink().attributes('href')).toBe('/import/history?bulk_import_id=174');
});
});
|