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

blob_spec.js « pages « repository « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4fe6188370e3e8411d19e57f982189733275a0c4 (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
import { shallowMount } from '@vue/test-utils';
import BlobContentViewer from '~/repository/components/blob_content_viewer.vue';
import BlobPage from '~/repository/pages/blob.vue';

jest.mock('~/repository/utils/dom');

describe('Repository blob page component', () => {
  let wrapper;

  const findBlobContentViewer = () => wrapper.findComponent(BlobContentViewer);
  const path = 'file.js';

  beforeEach(() => {
    wrapper = shallowMount(BlobPage, {
      propsData: { path, projectPath: 'some/path' },
    });
  });

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

  it('has a Blob Content Viewer component', () => {
    expect(findBlobContentViewer().exists()).toBe(true);
    expect(findBlobContentViewer().props('path')).toBe(path);
  });
});