8
0
فهرست منبع

Tests: changed some tests so that there is always some content in model document.

Szymon Cofalik 8 سال پیش
والد
کامیت
03c741c47b
1فایلهای تغییر یافته به همراه9 افزوده شده و 8 حذف شده
  1. 9 8
      packages/ckeditor5-list/tests/listengine.js

+ 9 - 8
packages/ckeditor5-list/tests/listengine.js

@@ -3152,15 +3152,16 @@ describe( 'ListEngine', () => {
 		} );
 
 		it( 'model remove converter should not fire if change was already consumed', () => {
-			editor.editing.modelToView.on( 'remove', ( evt, data, consumable ) => {
+			editor.editing.modelToView.on( 'remove:listItem', ( evt, data, consumable ) => {
 				consumable.consume( data.item, 'remove' );
 			}, { priority: 'highest' } );
 
-			setModelData( modelDoc, '<listItem indent="0" type="bulleted"></listItem>' );
+			// Paragraph is needed to prevent autoparagraphing of empty editor.
+			setModelData( modelDoc, '<paragraph>x</paragraph><listItem indent="0" type="bulleted"></listItem>' );
 
-			modelDoc.batch().remove( modelRoot.getChild( 0 ) );
+			modelDoc.batch().remove( modelRoot.getChild( 1 ) );
 
-			expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<ul><li></li></ul>' );
+			expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<p>x</p><ul><li></li></ul>' );
 		} );
 
 		it( 'model change type converter should not fire if change was already consumed', () => {
@@ -3192,9 +3193,9 @@ describe( 'ListEngine', () => {
 				consumable.consume( data.input, { name: true } );
 			}, { priority: 'highest' } );
 
-			editor.setData( '<ul><li></li></ul>' );
+			editor.setData( '<p></p><ul><li></li></ul>' );
 
-			expect( getModelData( modelDoc, { withoutSelection: true } ) ).to.equal( '' );
+			expect( getModelData( modelDoc, { withoutSelection: true } ) ).to.equal( '<paragraph></paragraph>' );
 		} );
 
 		it( 'view ul converter should not fire if change was already consumed', () => {
@@ -3202,9 +3203,9 @@ describe( 'ListEngine', () => {
 				consumable.consume( data.input, { name: true } );
 			}, { priority: 'highest' } );
 
-			editor.setData( '<ul><li></li></ul>' );
+			editor.setData( '<p></p><ul><li></li></ul>' );
 
-			expect( getModelData( modelDoc, { withoutSelection: true } ) ).to.equal( '' );
+			expect( getModelData( modelDoc, { withoutSelection: true } ) ).to.equal( '<paragraph></paragraph>' );
 		} );
 
 		it( 'view converter should pass model document fragment in data.output', () => {