Ver código fonte

Tests: Align tests to changes in the error handling.

Piotr Jasiun 6 anos atrás
pai
commit
c74f34e8ab

+ 3 - 3
packages/ckeditor5-image/tests/imageupload/imageuploadcommand.js

@@ -178,12 +178,12 @@ describe( 'ImageUploadCommand', () => {
 			expect( getModelData( model ) ).to.equal( '<other>[]</other>' );
 		} );
 
-		it( 'should not throw when upload adapter is not set (FileRepository will log an error anyway)', () => {
+		it( 'should not throw when upload adapter is not set (FileRepository will log an warn anyway)', () => {
 			const file = createNativeFileMock();
 
 			fileRepository.createUploadAdapter = undefined;
 
-			const consoleErrorStub = sinon.stub( console, 'error' );
+			const consoleWarnStub = sinon.stub( console, 'warn' );
 
 			setModelData( model, '<paragraph>fo[]o</paragraph>' );
 
@@ -192,7 +192,7 @@ describe( 'ImageUploadCommand', () => {
 			} ).to.not.throw();
 
 			expect( getModelData( model ) ).to.equal( '<paragraph>fo[]o</paragraph>' );
-			sinon.assert.calledOnce( consoleErrorStub );
+			sinon.assert.calledOnce( consoleWarnStub );
 		} );
 	} );
 } );

+ 3 - 3
packages/ckeditor5-image/tests/imageupload/imageuploadediting.js

@@ -279,10 +279,10 @@ describe( 'ImageUploadEditing', () => {
 		expect( getModelData( model ) ).to.equal( '<other>[]</other>' );
 	} );
 
-	it( 'should not throw when upload adapter is not set (FileRepository will log an error anyway) when image is pasted', () => {
+	it( 'should not throw when upload adapter is not set (FileRepository will log an warn anyway) when image is pasted', () => {
 		const fileMock = createNativeFileMock();
 		const dataTransfer = new DataTransfer( { files: [ fileMock ], types: [ 'Files' ] } );
-		const consoleErrorStub = sinon.stub( console, 'error' );
+		const consoleWarnStub = sinon.stub( console, 'warn' );
 
 		setModelData( model, '<paragraph>[]foo</paragraph>' );
 
@@ -296,7 +296,7 @@ describe( 'ImageUploadEditing', () => {
 		} ).to.not.throw();
 
 		expect( getModelData( model ) ).to.equal( '<paragraph>foo[]</paragraph>' );
-		sinon.assert.calledOnce( consoleErrorStub );
+		sinon.assert.calledOnce( consoleWarnStub );
 	} );
 
 	// https://github.com/ckeditor/ckeditor5-upload/issues/70