debian-mirror-gitlab/spec/frontend/repository/pages/blob_spec.js
2023-05-27 22:25:52 +05:30

23 lines
703 B
JavaScript

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' },
});
});
it('has a Blob Content Viewer component', () => {
expect(findBlobContentViewer().exists()).toBe(true);
expect(findBlobContentViewer().props('path')).toBe(path);
});
});