Welcome to mirror list, hosted at ThFree Co, Russian Federation.

directory_download_links_spec.js « components « repository « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4d70b44de08828cbf7c1f07ee61f7dc8a59185ac (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
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();
  });
});