Explorar el Código

Tests: Added unit test for https://github.com/ckeditor/ckeditor5-table/pull/261#issuecomment-597584310.

Marek Lewandowski hace 5 años
padre
commit
083c03721a
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  1. 22 0
      packages/ckeditor5-table/tests/commands/removerowcommand.js

+ 22 - 0
packages/ckeditor5-table/tests/commands/removerowcommand.js

@@ -266,6 +266,28 @@ describe( 'RemoveRowCommand', () => {
 			} );
 		} );
 
+		describe( 'with entire row selected', () => {
+			it( 'should properly remove row if reversed selection is made', () => {
+				setData( model, modelTable( [
+					[ '00', '01' ],
+					[ '10', '11' ]
+				] ) );
+
+				const tableSelection = editor.plugins.get( TableSelection );
+				const modelRoot = model.document.getRoot();
+				tableSelection._setCellSelection(
+					modelRoot.getNodeByPath( [ 0, 0, 1 ] ),
+					modelRoot.getNodeByPath( [ 0, 0, 0 ] )
+				);
+
+				command.execute();
+
+				assertEqualMarkup( getData( model ), modelTable( [
+					[ '10', '[]11' ]
+				] ) );
+			} );
+		} );
+
 		it( 'should remove a given row from a table start', () => {
 			setData( model, modelTable( [
 				[ '[]00', '01' ],