8
0
Просмотр исходного кода

Merge branch t/ckeditor5-table

Tests: Updated tests after introducing selection post-fixer.
Piotrek Koszuliński 7 лет назад
Родитель
Сommit
70f473ea0c
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      packages/ckeditor5-heading/tests/integration.js

+ 8 - 2
packages/ckeditor5-heading/tests/integration.js

@@ -92,7 +92,10 @@ describe( 'Heading integration', () => {
 
 
 	describe( 'with the undo feature', () => {
 	describe( 'with the undo feature', () => {
 		it( 'does not create undo steps when applied to an existing heading (collapsed selection)', () => {
 		it( 'does not create undo steps when applied to an existing heading (collapsed selection)', () => {
-			setModelData( model, '<heading1>foo[]bar</heading1>' );
+			// Ensure no undo step by using a transparent batch.
+			model.enqueueChange( 'transparent', () => {
+				setModelData( model, '<heading1>foo[]bar</heading1>' );
+			} );
 
 
 			editor.execute( 'heading', { value: 'heading1' } );
 			editor.execute( 'heading', { value: 'heading1' } );
 			expect( getModelData( model ) ).to.equal( '<heading1>foo[]bar</heading1>' );
 			expect( getModelData( model ) ).to.equal( '<heading1>foo[]bar</heading1>' );
@@ -101,7 +104,10 @@ describe( 'Heading integration', () => {
 		} );
 		} );
 
 
 		it( 'does not create undo steps when applied to an existing heading (non–collapsed selection)', () => {
 		it( 'does not create undo steps when applied to an existing heading (non–collapsed selection)', () => {
-			setModelData( model, '<heading1>[foo</heading1><heading1>bar]</heading1>' );
+			// Ensure no undo step by using a transparent batch.
+			model.enqueueChange( 'transparent', () => {
+				setModelData( model, '<heading1>[foo</heading1><heading1>bar]</heading1>' );
+			} );
 
 
 			editor.execute( 'heading', { value: 'heading1' } );
 			editor.execute( 'heading', { value: 'heading1' } );
 			expect( getModelData( model ) ).to.equal( '<heading1>[foo</heading1><heading1>bar]</heading1>' );
 			expect( getModelData( model ) ).to.equal( '<heading1>[foo</heading1><heading1>bar]</heading1>' );