Use FIXTURES_PATH for loading test.pdf

This commit is contained in:
Winnie Hellmann 2019-04-25 14:22:00 +02:00
parent 96ad838433
commit d89b19476d
4 changed files with 10 additions and 4 deletions

View file

@ -110,7 +110,7 @@ module.exports = function(config) {
frameworks: ['jasmine'], frameworks: ['jasmine'],
files: [ files: [
{ pattern: 'spec/javascripts/test_bundle.js', watched: false }, { pattern: 'spec/javascripts/test_bundle.js', watched: false },
{ pattern: `spec/javascripts/fixtures/**/*@(.json|.html|.png|.bmpr)`, included: false }, { pattern: `spec/javascripts/fixtures/**/*@(.json|.html|.png|.bmpr|.pdf)`, included: false },
], ],
preprocessors: { preprocessors: {
'spec/javascripts/**/*.js': ['webpack', 'sourcemap'], 'spec/javascripts/**/*.js': ['webpack', 'sourcemap'],

View file

@ -1,5 +1,7 @@
import renderPDF from '~/blob/pdf'; import renderPDF from '~/blob/pdf';
import testPDF from '../../fixtures/blob/pdf/test.pdf'; import { FIXTURES_PATH } from 'spec/test_constants';
const testPDF = `${FIXTURES_PATH}/blob/pdf/test.pdf`;
describe('PDF renderer', () => { describe('PDF renderer', () => {
let viewer; let viewer;

View file

@ -3,7 +3,9 @@ import { GlobalWorkerOptions } from 'vendor/pdf';
import workerSrc from 'vendor/pdf.worker.min'; import workerSrc from 'vendor/pdf.worker.min';
import PDFLab from '~/pdf/index.vue'; import PDFLab from '~/pdf/index.vue';
import pdf from '../fixtures/blob/pdf/test.pdf'; import { FIXTURES_PATH } from 'spec/test_constants';
const pdf = `${FIXTURES_PATH}/blob/pdf/test.pdf`;
GlobalWorkerOptions.workerSrc = workerSrc; GlobalWorkerOptions.workerSrc = workerSrc;
const Component = Vue.extend(PDFLab); const Component = Vue.extend(PDFLab);

View file

@ -4,7 +4,9 @@ import workerSrc from 'vendor/pdf.worker.min';
import PageComponent from '~/pdf/page/index.vue'; import PageComponent from '~/pdf/page/index.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
import testPDF from 'spec/fixtures/blob/pdf/test.pdf'; import { FIXTURES_PATH } from 'spec/test_constants';
const testPDF = `${FIXTURES_PATH}/blob/pdf/test.pdf`;
describe('Page component', () => { describe('Page component', () => {
const Component = Vue.extend(PageComponent); const Component = Vue.extend(PageComponent);