Browse Source

Merge branch t/ckeditor5-engine/1234

Internal: Update API usage after merge t/1234 on engine.
Piotr Jasiun 7 years ago
parent
commit
216a4e870e
1 changed files with 3 additions and 6 deletions
  1. 3 6
      packages/ckeditor5-typing/tests/deletecommand.js

+ 3 - 6
packages/ckeditor5-typing/tests/deletecommand.js

@@ -244,12 +244,9 @@ describe( 'DeleteCommand', () => {
 		} );
 
 		it( 'does not replace an element if a paragraph is not allowed in current position', () => {
-			model.schema.on( 'checkChild', ( evt, args ) => {
-				const def = model.schema.getDefinition( args[ 1 ] );
-
-				if ( args[ 0 ].endsWith( '$root' ) && def.name == 'paragraph' ) {
-					evt.stop();
-					evt.return = false;
+			model.schema.addChildCheck( ( ctx, childDef ) => {
+				if ( ctx.endsWith( '$root' ) && childDef.name == 'paragraph' ) {
+					return false;
 				}
 			} );