8
0
Pārlūkot izejas kodu

Tests: additional integration tests.

Szymon Cofalik 8 gadi atpakaļ
vecāks
revīzija
a0b6d9d2ee

+ 18 - 0
packages/ckeditor5-undo/tests/undoengine-integration.js

@@ -31,6 +31,7 @@ describe( 'UndoEngine integration', () => {
 				doc.schema.registerItem( 'p', '$block' );
 				doc.schema.registerItem( 'h1', '$block' );
 				doc.schema.registerItem( 'h2', '$block' );
+				doc.schema.registerItem( 'div', '$block' );
 				root = doc.getRoot();
 			} );
 	} );
@@ -731,6 +732,23 @@ describe( 'UndoEngine integration', () => {
 			editor.execute( 'undo' );
 			output( '<h1>[]Foo</h1><p>Bar</p>' );
 		} );
+
+		// ckeditor5-engine#t/1053
+		it( 'wrap, split, undo, undo is correct', () => {
+			input( '<p>[]Foo</p><p>Bar</p>' );
+
+			doc.batch().wrap( Range.createIn( root ), 'div' );
+			output( '<div><p>[]Foo</p><p>Bar</p></div>' );
+
+			doc.batch().split( new Position( root, [ 0, 0, 1 ] ) );
+			output( '<div><p>[]F</p><p>oo</p><p>Bar</p></div>' );
+
+			editor.execute( 'undo' );
+			output( '<div><p>[]Foo</p><p>Bar</p></div>' );
+
+			editor.execute( 'undo' );
+			output( '<p>[]Foo</p><p>Bar</p>' );
+		} );
 	} );
 
 	describe( 'other edge cases', () => {