blob: 98946412264ef574c695d23c33b038a9fec9bb93 (
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 { FIXTURES_PATH } from 'spec/test_constants';
import PDFLab from '~/pdf/index.vue';
describe('PDFLab component', () => {
let wrapper;
const mountComponent = ({ pdf }) => shallowMount(PDFLab, { propsData: { pdf } });
afterEach(() => {
wrapper.destroy();
});
describe('without PDF data', () => {
beforeEach(() => {
wrapper = mountComponent({ pdf: '' });
});
it('does not render', () => {
expect(wrapper.isVisible()).toBe(false);
});
});
describe('with PDF data', () => {
beforeEach(() => {
wrapper = mountComponent({ pdf: `${FIXTURES_PATH}/blob/pdf/test.pdf` });
});
it('renders', () => {
expect(wrapper.isVisible()).toBe(true);
});
});
});
|