Răsfoiți Sursa

Add test for adding blockquote to paragraph in table cell.

Maciej Gołaszewski 7 ani în urmă
părinte
comite
af3d56f57b
1 a modificat fișierele cu 23 adăugiri și 0 ștergeri
  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>'
+			);
+		} );
 	} );
 } );