Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove unhandled errors from unit tests #498

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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