Kaynağa Gözat

Add stub test for non-rectangular selection is pasted.

Maciej Gołaszewski 5 yıl önce
ebeveyn
işleme
de13de5c96
1 değiştirilmiş dosya ile 24 ekleme ve 0 silme
  1. 24 0
      packages/ckeditor5-table/tests/tableclipboard.js

+ 24 - 0
packages/ckeditor5-table/tests/tableclipboard.js

@@ -452,6 +452,30 @@ describe( 'table clipboard', () => {
 				] ) );
 			} );
 
+			it( 'should block non-rectangular selection', () => {
+				setModelData( model, modelTable( [
+					[ { contents: '00', colspan: 3 } ],
+					[ '10', '11', '12' ],
+					[ '20', '21', '22' ]
+				] ) );
+
+				tableSelection.setCellSelection(
+					modelRoot.getNodeByPath( [ 0, 0, 0 ] ),
+					modelRoot.getNodeByPath( [ 0, 1, 1 ] )
+				);
+
+				pasteTable( [
+					[ 'aa', 'ab' ],
+					[ 'ba', 'bb' ]
+				] );
+
+				assertEqualMarkup( getModelData( model, { withoutSelection: true } ), modelTable( [
+					[ { contents: '00', colspan: 3 } ],
+					[ '10', '11', '12' ],
+					[ '20', '21', '22' ]
+				] ) );
+			} );
+
 			describe( 'pasted table is equal to the selected area', () => {
 				describe( 'no spans', () => {
 					it( 'handles simple table paste to a simple table fragment - at the beginning of a table', () => {