summaryrefslogtreecommitdiff
path: root/spec/frontend/packages/details/components/file_sha_spec.js
blob: 7bfcf78baab7ee969cf036c00b49bded1a0a17ac (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
import { shallowMount } from '@vue/test-utils';

import FileSha from '~/packages/details/components/file_sha.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import DetailsRow from '~/vue_shared/components/registry/details_row.vue';

describe('FileSha', () => {
  let wrapper;

  const defaultProps = { sha: 'foo', title: 'bar' };

  function createComponent() {
    wrapper = shallowMount(FileSha, {
      propsData: {
        ...defaultProps,
      },
      stubs: {
        ClipboardButton,
        DetailsRow,
      },
    });
  }

  afterEach(() => {
    wrapper.destroy();
  });

  it('renders', () => {
    createComponent();

    expect(wrapper.element).toMatchSnapshot();
  });
});