Răsfoiți Sursa

Improved CC after view refactoring.

Szymon Kupś 8 ani în urmă
părinte
comite
b28b3bb0cc

+ 7 - 7
packages/ckeditor5-image/tests/imagetoolbar.js

@@ -114,7 +114,7 @@ describe( 'ImageToolbar', () => {
 		} );
 		} );
 	} );
 	} );
 
 
-	describe( 'integration with the editor selection (#render event)', () => {
+	describe( 'integration with the editor selection (#change event)', () => {
 		beforeEach( () => {
 		beforeEach( () => {
 			editor.ui.focusTracker.isFocused = true;
 			editor.ui.focusTracker.isFocused = true;
 		} );
 		} );
@@ -124,7 +124,7 @@ describe( 'ImageToolbar', () => {
 
 
 			expect( balloon.visibleView ).to.be.null;
 			expect( balloon.visibleView ).to.be.null;
 
 
-			editingView.fire( 'render' );
+			editingView.change( () => {} );
 			expect( balloon.visibleView ).to.be.null;
 			expect( balloon.visibleView ).to.be.null;
 
 
 			model.change( writer => {
 			model.change( writer => {
@@ -136,9 +136,9 @@ describe( 'ImageToolbar', () => {
 
 
 			expect( balloon.visibleView ).to.equal( toolbar );
 			expect( balloon.visibleView ).to.equal( toolbar );
 
 
-			// Make sure successive render does not throw, e.g. attempting
+			// Make sure successive change does not throw, e.g. attempting
 			// to insert the toolbar twice.
 			// to insert the toolbar twice.
-			editingView.fire( 'render' );
+			editingView.change( () => {} );
 			expect( balloon.visibleView ).to.equal( toolbar );
 			expect( balloon.visibleView ).to.equal( toolbar );
 		} );
 		} );
 
 
@@ -152,7 +152,7 @@ describe( 'ImageToolbar', () => {
 			balloon.add( { view: lastView } );
 			balloon.add( { view: lastView } );
 			expect( balloon.visibleView ).to.equal( lastView );
 			expect( balloon.visibleView ).to.equal( lastView );
 
 
-			editingView.fire( 'render' );
+			editingView.change( () => {} );
 			expect( balloon.visibleView ).to.equal( lastView );
 			expect( balloon.visibleView ).to.equal( lastView );
 		} );
 		} );
 
 
@@ -170,9 +170,9 @@ describe( 'ImageToolbar', () => {
 
 
 			expect( balloon.visibleView ).to.be.null;
 			expect( balloon.visibleView ).to.be.null;
 
 
-			// Make sure successive render does not throw, e.g. attempting
+			// Make sure successive change does not throw, e.g. attempting
 			// to remove the toolbar twice.
 			// to remove the toolbar twice.
-			editingView.fire( 'render' );
+			editingView.change( () => {} );
 			expect( balloon.visibleView ).to.be.null;
 			expect( balloon.visibleView ).to.be.null;
 		} );
 		} );
 	} );
 	} );

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

@@ -140,7 +140,7 @@ describe( 'ImageUploadEditing', () => {
 
 
 	it( 'should not execute imageUpload command when file is not an image', () => {
 	it( 'should not execute imageUpload command when file is not an image', () => {
 		const spy = sinon.spy( editor, 'execute' );
 		const spy = sinon.spy( editor, 'execute' );
-		const viewDocument = editor.editing.view;
+		const viewDocument = editor.editing.view.document;
 		const fileMock = {
 		const fileMock = {
 			type: 'media/mp3',
 			type: 'media/mp3',
 			size: 1024
 			size: 1024