8
0
فهرست منبع

Improved test style.

Maciej Bukowski 8 سال پیش
والد
کامیت
73efe21a7c
1فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 6 5
      packages/ckeditor5-heading/tests/headingcommand.js

+ 6 - 5
packages/ckeditor5-heading/tests/headingcommand.js

@@ -95,12 +95,13 @@ describe( 'HeadingCommand', () => {
 				setData( model, `<${ modelElement }>[foo]</${ modelElement }><notBlock>foo</notBlock>` );
 				const element = document.getRoot().getChild( 1 );
 
-				// Purposely not putting it in `model.change` to update command manually.
-				model.document.selection._setTo( Range.createIn( element ) );
+				model.change( writer => {
+					writer.setSelection( Range.createIn( element ) );
 
-				expect( command.value ).to.be.true;
-				command.refresh();
-				expect( command.value ).to.be.false;
+					expect( command.value ).to.be.true;
+					command.refresh();
+					expect( command.value ).to.be.false;
+				} );
 			} );
 		}
 	} );