Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge 4f28348 into b084de5
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Oct 8, 2019
2 parents b084de5 + 4f28348 commit 8b35fc5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/imageupload/imageuploadediting.js
Expand Up @@ -25,6 +25,7 @@ import { getData as getViewData, stringify as stringifyView } from '@ckeditor/ck

import env from '@ckeditor/ckeditor5-utils/src/env';
import Notification from '@ckeditor/ckeditor5-ui/src/notification/notification';
import { assertCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';

describe( 'ImageUploadEditing', () => {
// eslint-disable-next-line max-len
Expand Down Expand Up @@ -450,6 +451,7 @@ describe( 'ImageUploadEditing', () => {
it( 'should throw when other error happens during upload', done => {
const file = createNativeFileMock();
const error = new Error( 'Foo bar baz' );
error.stack = 'biz';
const uploadEditing = editor.plugins.get( ImageUploadEditing );
const loadSpy = sinon.spy( uploadEditing, '_readAndUpload' );
const catchSpy = sinon.spy();
Expand All @@ -476,7 +478,16 @@ describe( 'ImageUploadEditing', () => {

setTimeout( () => {
sinon.assert.calledOnce( catchSpy );
sinon.assert.calledWithExactly( catchSpy, error );
const error = catchSpy.getCall( 0 ).args[ 0 ];

assertCKEditorError( error, /unexpected-error/, editor, {
originalError: {
name: 'Error',
message: 'Foo bar baz',
stack: 'biz'
}
} );

done();
}, 0 );
} );
Expand Down

0 comments on commit 8b35fc5

Please sign in to comment.