|
|
@@ -105,6 +105,33 @@ describe( 'RemoveRowCommand', () => {
|
|
|
|
|
|
expect( command.isEnabled ).to.be.false;
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should be false if all the rows are selected - table with more than 10 rows (array sort bug)', () => {
|
|
|
+ setData( model, modelTable( [
|
|
|
+ [ '0' ],
|
|
|
+ [ '1' ],
|
|
|
+ [ '2' ],
|
|
|
+ [ '3' ],
|
|
|
+ [ '4' ],
|
|
|
+ [ '5' ],
|
|
|
+ [ '6' ],
|
|
|
+ [ '7' ],
|
|
|
+ [ '8' ],
|
|
|
+ [ '9' ],
|
|
|
+ [ '10' ],
|
|
|
+ [ '11' ],
|
|
|
+ [ '12' ]
|
|
|
+ ] ) );
|
|
|
+
|
|
|
+ const tableSelection = editor.plugins.get( TableSelection );
|
|
|
+ const modelRoot = model.document.getRoot();
|
|
|
+ tableSelection._setCellSelection(
|
|
|
+ modelRoot.getNodeByPath( [ 0, 0, 0 ] ),
|
|
|
+ modelRoot.getNodeByPath( [ 0, 12, 0 ] )
|
|
|
+ );
|
|
|
+
|
|
|
+ expect( command.isEnabled ).to.be.false;
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'execute()', () => {
|
|
|
@@ -339,6 +366,41 @@ describe( 'RemoveRowCommand', () => {
|
|
|
|
|
|
expect( createdBatches.size ).to.equal( 1 );
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should properly remove more than 10 rows selected (array sort bug)', () => {
|
|
|
+ setData( model, modelTable( [
|
|
|
+ [ '0' ],
|
|
|
+ [ '1' ],
|
|
|
+ [ '2' ],
|
|
|
+ [ '3' ],
|
|
|
+ [ '4' ],
|
|
|
+ [ '5' ],
|
|
|
+ [ '6' ],
|
|
|
+ [ '7' ],
|
|
|
+ [ '8' ],
|
|
|
+ [ '9' ],
|
|
|
+ [ '10' ],
|
|
|
+ [ '11' ],
|
|
|
+ [ '12' ],
|
|
|
+ [ '13' ],
|
|
|
+ [ '14' ]
|
|
|
+ ] ) );
|
|
|
+
|
|
|
+ const tableSelection = editor.plugins.get( TableSelection );
|
|
|
+ const modelRoot = model.document.getRoot();
|
|
|
+ tableSelection._setCellSelection(
|
|
|
+ modelRoot.getNodeByPath( [ 0, 1, 0 ] ),
|
|
|
+ modelRoot.getNodeByPath( [ 0, 12, 0 ] )
|
|
|
+ );
|
|
|
+
|
|
|
+ command.execute();
|
|
|
+
|
|
|
+ assertEqualMarkup( getData( model, { withoutSelection: true } ), modelTable( [
|
|
|
+ [ '0' ],
|
|
|
+ [ '13' ],
|
|
|
+ [ '14' ]
|
|
|
+ ] ) );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'with entire row selected', () => {
|