Skip to content

Commit

Permalink
Fix: Remove unhandled errors from unit tests (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Nov 22, 2017
1 parent 6d61b9d commit 2e71743
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,6 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => {
});
});

describe('loadPanoramaFile()', () => {
it('should have @jholdstock implement this test after @mbond gets 3D image representations in prod');
});

describe('enableVr()', () => {
beforeEach(() => {
// We don't care about super calls :D
Expand Down
24 changes: 12 additions & 12 deletions src/lib/viewers/doc/__tests__/DocBaseViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,12 +749,12 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {
docBase.isMobile = false;
sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({}));

docBase.initViewer('');

expect(stubs.pdfViewerStub).to.be.calledWith({
container: sinon.match.any,
linkService: sinon.match.any,
enhanceTextSelection: true
return docBase.initViewer('').then(() => {
expect(stubs.pdfViewerStub).to.be.calledWith({
container: sinon.match.any,
linkService: sinon.match.any,
enhanceTextSelection: true
});
});
});

Expand All @@ -765,12 +765,12 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {
docBase.isMobile = true;
sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({}));

docBase.initViewer('');

expect(stubs.pdfViewerStub).to.be.calledWith({
container: sinon.match.any,
linkService: sinon.match.any,
enhanceTextSelection: false
return docBase.initViewer('').then(() => {
expect(stubs.pdfViewerStub).to.be.calledWith({
container: sinon.match.any,
linkService: sinon.match.any,
enhanceTextSelection: false
});
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/lib/viewers/media/__tests__/MediaBaseViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ describe('lib/viewers/media/MediaBaseViewer', () => {
describe('errorHandler', () => {
it('should emit the error and set a display message', () => {
sandbox.stub(media, 'emit');

const err = new Error('blah');
sandbox.mock(window.console).expects('error').withArgs(err);

media.errorHandler(err);

err.displayMessage = 'We\'re sorry, the preview didn\'t load. Please refresh the page.';
Expand Down

0 comments on commit 2e71743

Please sign in to comment.