浏览代码

Merge branch t/ckeditor5-table

Tests: Updated tests after introducing selection post-fixer.
Piotrek Koszuliński 7 年之前
父节点
当前提交
66395fbac1
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 14 7
      packages/ckeditor5-undo/tests/undoediting-integration.js

+ 14 - 7
packages/ckeditor5-undo/tests/undoediting-integration.js

@@ -38,17 +38,13 @@ describe( 'UndoEditing integration', () => {
 				model = editor.model;
 				doc = model.document;
 
-				// Add "div feature".
-				model.schema.register( 'div', { inheritAllFrom: '$block' } );
-
-				editor.conversion.for( 'downcast' ).add( downcastElementToElement( { model: 'div', view: 'div' } ) );
-				editor.conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'div', view: 'div' } ) );
-
 				root = doc.getRoot();
 			} );
 	} );
 
 	afterEach( () => {
+		div.remove();
+
 		return editor.destroy();
 	} );
 
@@ -59,7 +55,9 @@ describe( 'UndoEditing integration', () => {
 	}
 
 	function input( input ) {
-		setData( model, input );
+		model.enqueueChange( 'transparent', () => {
+			setData( model, input );
+		} );
 	}
 
 	function output( output ) {
@@ -850,6 +848,15 @@ describe( 'UndoEditing integration', () => {
 
 		// ckeditor5-engine#t/1053
 		it( 'wrap, split, undo, undo is correct', () => {
+			// Add a "div feature".
+			model.schema.register( 'div', {
+				allowWhere: '$block',
+				allowContentOf: '$root'
+			} );
+
+			editor.conversion.for( 'downcast' ).add( downcastElementToElement( { model: 'div', view: 'div' } ) );
+			editor.conversion.for( 'upcast' ).add( upcastElementToElement( { model: 'div', view: 'div' } ) );
+
 			input( '<paragraph>[]Foo</paragraph><paragraph>Bar</paragraph>' );
 
 			model.change( writer => {