Browse Source

Use input command in text transformation integration tests.

Maciej Gołaszewski 6 years ago
parent
commit
8abd943631
1 changed files with 5 additions and 8 deletions
  1. 5 8
      packages/ckeditor5-typing/tests/texttransformation-integration.js

+ 5 - 8
packages/ckeditor5-typing/tests/texttransformation-integration.js

@@ -47,13 +47,11 @@ describe( 'Text transformation feature - integration', () => {
 			model.enqueueChange( model.createBatch(), writer => {
 				writer.setSelection( doc.getRoot().getChild( 0 ), 'end' );
 				writer.insertText( '(c', doc.selection.focus );
-			} );
-
-			model.enqueueChange( model.createBatch(), writer => {
 				writer.setSelection( doc.getRoot().getChild( 0 ), 'end' );
-				writer.insertText( ')', doc.selection.focus );
 			} );
 
+			editor.execute( 'input', { text: ')' } );
+
 			expect( editor.getData(), 'inserted text' ).to.equal( '<p>foo©</p>' );
 
 			editor.execute( 'undo' );
@@ -71,12 +69,11 @@ describe( 'Text transformation feature - integration', () => {
 			model.enqueueChange( model.createBatch(), writer => {
 				writer.setSelection( doc.getRoot().getChild( 0 ), 'end' );
 				writer.insertText( 'foo bar baz(c', doc.selection.focus );
-			} );
-
-			model.enqueueChange( model.createBatch(), writer => {
 				writer.setSelection( doc.getRoot().getChild( 0 ), 'end' );
-				writer.insertText( ')', doc.selection.focus );
 			} );
+
+			editor.execute( 'input', { text: ')' } );
+
 			expect( editor.getData() ).to.equal( '<p>foo bar baz©</p>' );
 
 			editor.execute( 'undo' );