8
0
Просмотр исходного кода

Added test checking undo with inserting image with caption.

Szymon Kupś 8 лет назад
Родитель
Сommit
8cd9b6a4f9
1 измененных файлов с 17 добавлено и 0 удалено
  1. 17 0
      packages/ckeditor5-image/tests/imagecaption/imagecaptionengine.js

+ 17 - 0
packages/ckeditor5-image/tests/imagecaption/imagecaptionengine.js

@@ -350,6 +350,23 @@ describe( 'ImageCaptionEngine', () => {
 					'</figure>'
 				);
 			} );
+
+			it( 'undo should work after inserting the image', () => {
+				const modelRoot = document.getRoot();
+				const image = new ModelElement( 'image' );
+
+				document.enqueueChanges( () => {
+					const batch = document.batch();
+
+					batch.insert( ModelPosition.createAt( modelRoot ), image );
+				} );
+
+				expect( getModelData( document, { withoutSelection: true } ) ).to.equal(
+					'<image><caption></caption></image>'
+				);
+
+				editor.execute( 'undo' );
+			} );
 		} );
 	} );
 } );