|
|
@@ -43,7 +43,8 @@ describe( 'RemoveRowCommand', () => {
|
|
|
it( 'should be true if selection contains multiple cells', () => {
|
|
|
setData( model, modelTable( [
|
|
|
[ '00', '01' ],
|
|
|
- [ '10', '11' ]
|
|
|
+ [ '10', '11' ],
|
|
|
+ [ '20', '21' ]
|
|
|
] ) );
|
|
|
|
|
|
const tableSelection = editor.plugins.get( TableSelection );
|
|
|
@@ -64,6 +65,22 @@ describe( 'RemoveRowCommand', () => {
|
|
|
expect( command.isEnabled ).to.be.false;
|
|
|
} );
|
|
|
|
|
|
+ it( 'should be false if all the rows are selected', () => {
|
|
|
+ setData( model, modelTable( [
|
|
|
+ [ '00', '01' ],
|
|
|
+ [ '10', '11' ]
|
|
|
+ ] ) );
|
|
|
+
|
|
|
+ const tableSelection = editor.plugins.get( TableSelection );
|
|
|
+ const modelRoot = model.document.getRoot();
|
|
|
+ tableSelection._setCellSelection(
|
|
|
+ modelRoot.getNodeByPath( [ 0, 0, 0 ] ),
|
|
|
+ modelRoot.getNodeByPath( [ 0, 1, 0 ] )
|
|
|
+ );
|
|
|
+
|
|
|
+ expect( command.isEnabled ).to.be.false;
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should be false if selection is outside a table', () => {
|
|
|
setData( model, '<paragraph>11[]</paragraph>' );
|
|
|
|