8
0
فهرست منبع

Fixed FormatsCommand failing tests.

Szymon Kupś 9 سال پیش
والد
کامیت
16ce07c23b
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      packages/ckeditor5-heading/src/formatscommand.js
  2. 2 2
      packages/ckeditor5-heading/tests/formatscommand.js

+ 1 - 1
packages/ckeditor5-heading/src/formatscommand.js

@@ -106,7 +106,7 @@ function _findTopmostBlock( position, nodeAfter = true ) {
 		return nodeAfter ? position.nodeAfter : position.nodeBefore ;
 		return nodeAfter ? position.nodeAfter : position.nodeBefore ;
 	}
 	}
 
 
-	while ( !( parent instanceof RootElement ) ) {
+	while ( !( parent.parent instanceof RootElement ) ) {
 		parent = parent.parent;
 		parent = parent.parent;
 	}
 	}
 
 

+ 2 - 2
packages/ckeditor5-heading/tests/formatscommand.js

@@ -5,7 +5,7 @@
 
 
 'use strict';
 'use strict';
 
 
-import VirtualTestEditor from '/tests/ckeditor5/_utils/virtualtesteditor.js';
+import ModelTestEditor from '/tests/ckeditor5/_utils/modeltesteditor.js';
 import FormatsCommand from '/ckeditor5/formats/formatscommand.js';
 import FormatsCommand from '/ckeditor5/formats/formatscommand.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import { setData, getData } from '/tests/engine/_utils/model.js';
 import { setData, getData } from '/tests/engine/_utils/model.js';
@@ -21,7 +21,7 @@ describe( 'FormatsCommand', () => {
 	let editor, document, command, root;
 	let editor, document, command, root;
 
 
 	beforeEach( () => {
 	beforeEach( () => {
-		return VirtualTestEditor.create()
+		return ModelTestEditor.create()
 			.then( newEditor => {
 			.then( newEditor => {
 				editor = newEditor;
 				editor = newEditor;
 				document = editor.document;
 				document = editor.document;