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

Add test for adding blockquote to paragraph in table cell.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
af3d56f57b
1 измененных файлов с 23 добавлено и 0 удалено
  1. 23 0
      packages/ckeditor5-block-quote/tests/integration.js

+ 23 - 0
packages/ckeditor5-block-quote/tests/integration.js

@@ -443,5 +443,28 @@ describe( 'BlockQuote integration', () => {
 				'[<table><tableRow><tableCell><paragraph>foo</paragraph></tableCell></tableRow></table>]'
 			);
 		} );
+
+		it( 'wraps table cell paragraph', () => {
+			setModelData( model, '<table><tableRow><tableCell><paragraph>[]foo</paragraph></tableCell></tableRow></table>' );
+
+			editor.execute( 'blockQuote' );
+
+			expect( getModelData( model ) ).to.equal(
+				'<table><tableRow><tableCell><blockQuote><paragraph>[]foo</paragraph></blockQuote></tableCell></tableRow></table>'
+			);
+		} );
+
+		it( 'unwraps table cell paragraph', () => {
+			setModelData(
+				model,
+				'<table><tableRow><tableCell><blockQuote><paragraph>[]foo</paragraph></blockQuote></tableCell></tableRow></table>'
+			);
+
+			editor.execute( 'blockQuote' );
+
+			expect( getModelData( model ) ).to.equal(
+				'<table><tableRow><tableCell><paragraph>[]foo</paragraph></tableCell></tableRow></table>'
+			);
+		} );
 	} );
 } );