瀏覽代碼

Aligned code to recent changes that landed on master.

Maciej Bukowski 7 年之前
父節點
當前提交
70078a0183
共有 1 個文件被更改,包括 15 次插入15 次删除
  1. 15 15
      packages/ckeditor5-engine/tests/view/observer/mutationobserver.js

+ 15 - 15
packages/ckeditor5-engine/tests/view/observer/mutationobserver.js

@@ -271,17 +271,17 @@ describe( 'MutationObserver', () => {
 
 	// https://github.com/ckeditor/ckeditor5/issues/692 Scenario 1.
 	it( 'should handle space after inline filler at the end of container', () => {
-		const { view, selection } = parse(
+		const { view: viewContainer, selection } = parse(
 			'<container:p>' +
 				'foo' +
 				'<attribute:b>[]</attribute:b>' +
 			'</container:p>'
 		);
 
-		viewRoot.appendChildren( view );
-		viewDocument.selection.setTo( selection );
-
-		viewDocument.render();
+		view.change( writer => {
+			viewRoot.appendChildren( viewContainer );
+			writer.setSelection( selection );
+		} );
 
 		// Appended container is third in the tree.
 		const container = domEditor.childNodes[ 2 ];
@@ -302,7 +302,7 @@ describe( 'MutationObserver', () => {
 
 	// https://github.com/ckeditor/ckeditor5/issues/692 Scenario 3.
 	it( 'should handle space after inline filler at the end of container #2', () => {
-		const { view, selection } = parse(
+		const { view: viewContainer, selection } = parse(
 			'<container:p>' +
 				'foo' +
 				'<attribute:b>bar</attribute:b>' +
@@ -310,10 +310,10 @@ describe( 'MutationObserver', () => {
 			'</container:p>'
 		);
 
-		viewRoot.appendChildren( view );
-		viewDocument.selection.setTo( selection );
-
-		viewDocument.render();
+		view.change( writer => {
+			viewRoot.appendChildren( viewContainer );
+			writer.setSelection( selection );
+		} );
 
 		// Appended container is third in the tree.
 		const container = domEditor.childNodes[ 2 ];
@@ -346,17 +346,17 @@ describe( 'MutationObserver', () => {
 
 	// https://github.com/ckeditor/ckeditor5/issues/692 Scenario 2.
 	it( 'should handle space after inline filler at the beginning of container', () => {
-		const { view, selection } = parse(
+		const { view: viewContainer, selection } = parse(
 			'<container:p>' +
 				'<attribute:b>[]</attribute:b>' +
 				'foo' +
 			'</container:p>'
 		);
 
-		viewRoot.appendChildren( view );
-		viewDocument.selection.setTo( selection );
-
-		viewDocument.render();
+		view.change( writer => {
+			viewRoot.appendChildren( viewContainer );
+			writer.setSelection( selection );
+		} );
 
 		// Appended container is third in the tree.
 		const container = domEditor.childNodes[ 2 ];