debian-mirror-gitlab/spec/frontend/repository/pages/blob_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
753 B
JavaScript
Raw Normal View History

2021-04-29 21:17:54 +05:30
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;
2022-11-25 23:54:43 +05:30
const findBlobContentViewer = () => wrapper.findComponent(BlobContentViewer);
2021-04-29 21:17:54 +05:30
const path = 'file.js';
beforeEach(() => {
2021-06-08 01:23:25 +05:30
wrapper = shallowMount(BlobPage, {
propsData: { path, projectPath: 'some/path' },
});
2021-04-29 21:17:54 +05:30
});
afterEach(() => {
wrapper.destroy();
});
it('has a Blob Content Viewer component', () => {
expect(findBlobContentViewer().exists()).toBe(true);
expect(findBlobContentViewer().props('path')).toBe(path);
});
});