blob: 72c4165c2e96ab8bbf529c1f3bc87f88d2b54423 (
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
|
import { shallowMount } from '@vue/test-utils';
import DirectoryDownloadLinks from '~/repository/components/directory_download_links.vue';
let vm;
function factory(currentPath) {
vm = shallowMount(DirectoryDownloadLinks, {
propsData: {
currentPath,
links: [
{ text: 'zip', path: 'http://test.com/' },
{ text: 'tar', path: 'http://test.com/' },
],
},
});
}
describe('Repository directory download links component', () => {
afterEach(() => {
vm.destroy();
});
it.each`
path
${'app'}
${'app/assets'}
`('renders downloads links for path $path', ({ path }) => {
factory(path);
expect(vm.element).toMatchSnapshot();
});
});
|