|
@@ -8,18 +8,18 @@
|
|
|
import FileUploader from '../../src/uploadgateway/fileuploader';
|
|
import FileUploader from '../../src/uploadgateway/fileuploader';
|
|
|
import UploadGateway from '../../src/uploadgateway/uploadgateway';
|
|
import UploadGateway from '../../src/uploadgateway/uploadgateway';
|
|
|
import Token from '../../src/token/token';
|
|
import Token from '../../src/token/token';
|
|
|
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
|
|
|
|
|
+import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
|
|
|
|
|
|
|
|
describe( 'UploadGateway', () => {
|
|
describe( 'UploadGateway', () => {
|
|
|
const token = new Token( 'url', { initValue: 'token', autoRefresh: false } );
|
|
const token = new Token( 'url', { initValue: 'token', autoRefresh: false } );
|
|
|
|
|
|
|
|
describe( 'constructor()', () => {
|
|
describe( 'constructor()', () => {
|
|
|
it( 'should throw error when no token provided', () => {
|
|
it( 'should throw error when no token provided', () => {
|
|
|
- expect( () => new UploadGateway( undefined, 'test' ) ).to.throw( CKEditorError, 'uploadgateway-missing-token' );
|
|
|
|
|
|
|
+ expectToThrowCKEditorError( () => new UploadGateway( undefined, 'test' ), 'uploadgateway-missing-token' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should throw error when no apiAddress provided', () => {
|
|
it( 'should throw error when no apiAddress provided', () => {
|
|
|
- expect( () => new UploadGateway( token ) ).to.throw( CKEditorError, 'uploadgateway-missing-api-address' );
|
|
|
|
|
|
|
+ expectToThrowCKEditorError( () => new UploadGateway( token ), 'uploadgateway-missing-api-address' );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|