diff options
Diffstat (limited to 'spec/javascripts/pdf/page_spec.js')
-rw-r--r-- | spec/javascripts/pdf/page_spec.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/spec/javascripts/pdf/page_spec.js b/spec/javascripts/pdf/page_spec.js deleted file mode 100644 index cc2cc204ee3..00000000000 --- a/spec/javascripts/pdf/page_spec.js +++ /dev/null @@ -1,49 +0,0 @@ -import Vue from 'vue'; -import pdfjsLib from 'pdfjs-dist/webpack'; - -import mountComponent from 'spec/helpers/vue_mount_component_helper'; -import { FIXTURES_PATH } from 'spec/test_constants'; -import PageComponent from '~/pdf/page/index.vue'; - -const testPDF = `${FIXTURES_PATH}/blob/pdf/test.pdf`; - -describe('Page component', () => { - const Component = Vue.extend(PageComponent); - let vm; - let testPage; - - beforeEach(done => { - pdfjsLib - .getDocument(testPDF) - .promise.then(pdf => pdf.getPage(1)) - .then(page => { - testPage = page; - }) - .then(done) - .catch(done.fail); - }); - - afterEach(() => { - vm.$destroy(); - }); - - it('renders the page when mounting', done => { - const promise = Promise.resolve(); - spyOn(testPage, 'render').and.returnValue({ promise }); - - vm = mountComponent(Component, { - page: testPage, - number: 1, - }); - - expect(vm.rendering).toBe(true); - - promise - .then(() => { - expect(testPage.render).toHaveBeenCalledWith(vm.renderContext); - expect(vm.rendering).toBe(false); - }) - .then(done) - .catch(done.fail); - }); -}); |