Преглед на файлове

Added test checking undo with inserting image with caption.

Szymon Kupś преди 8 години
родител
ревизия
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' );
+			} );
 		} );
 	} );
 } );