diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-29 22:47:40 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-30 16:52:56 +0300 |
commit | c34138e09e964bd8c141d9ae7d360c7085affd16 (patch) | |
tree | c06b5c7ac077c277efb001d8655deedf54834e60 /spec/javascripts/pdf | |
parent | 11f82c891ab82620982ef157d3a6783ee56a6997 (diff) |
Remove pdf.js deprecation warnings
1. `page.getViewpoint()` now takes in JSON instead of an integer.
2. Promises are returned from loading and rendering tasks.
See https://mozilla.github.io/pdf.js/examples/index.html for more
details.
Diffstat (limited to 'spec/javascripts/pdf')
-rw-r--r-- | spec/javascripts/pdf/page_spec.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/javascripts/pdf/page_spec.js b/spec/javascripts/pdf/page_spec.js index 6dea570266b..efeb65acf87 100644 --- a/spec/javascripts/pdf/page_spec.js +++ b/spec/javascripts/pdf/page_spec.js @@ -17,7 +17,7 @@ describe('Page component', () => { pdfjsLib.GlobalWorkerOptions.workerSrc = workerSrc; pdfjsLib .getDocument(testPDF) - .then(pdf => pdf.getPage(1)) + .promise.then(pdf => pdf.getPage(1)) .then(page => { testPage = page; }) @@ -31,7 +31,8 @@ describe('Page component', () => { it('renders the page when mounting', done => { const promise = Promise.resolve(); - spyOn(testPage, 'render').and.callFake(() => promise); + spyOn(testPage, 'render').and.returnValue({ promise }); + vm = mountComponent(Component, { page: testPage, number: 1, |