Browse Source

Add test for adding blockquote to paragraph in table cell.

Maciej Gołaszewski 7 years ago
parent
commit
af3d56f57b
1 changed files with 23 additions and 0 deletions
  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>]'
 				'[<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>'
+			);
+		} );
 	} );
 	} );
 } );
 } );