@@ -93,6 +93,46 @@ describe( 'MergeCellCommand', () => {
9393
9494 expect ( command . isEnabled ) . to . be . false ;
9595 } ) ;
96+
97+ it ( 'should be false if mergeable cell is in other table section then current cell' , ( ) => {
98+ setData ( model , modelTable ( [
99+ [ '00[]' , '01' ]
100+ ] , { headingColumns : 1 } ) ) ;
101+
102+ expect ( command . isEnabled ) . to . be . false ;
103+ } ) ;
104+
105+ it ( 'should be false if merged cell would cross heading section (mergeable cell with colspan)' , ( ) => {
106+ setData ( model , modelTable ( [
107+ [ '00[]' , { colspan : 2 , contents : '01' } , '02' , '03' ]
108+ ] , { headingColumns : 2 } ) ) ;
109+
110+ expect ( command . isEnabled ) . to . be . false ;
111+ } ) ;
112+
113+ it ( 'should be true if merged cell would not cross heading section (mergeable cell with colspan)' , ( ) => {
114+ setData ( model , modelTable ( [
115+ [ '00[]' , { colspan : 2 , contents : '01' } , '02' , '03' ]
116+ ] , { headingColumns : 3 } ) ) ;
117+
118+ expect ( command . isEnabled ) . to . be . true ;
119+ } ) ;
120+
121+ it ( 'should be false if merged cell would cross heading section (current cell with colspan)' , ( ) => {
122+ setData ( model , modelTable ( [
123+ [ { colspan : 2 , contents : '00[]' } , '01' , '02' , '03' ]
124+ ] , { headingColumns : 2 } ) ) ;
125+
126+ expect ( command . isEnabled ) . to . be . false ;
127+ } ) ;
128+
129+ it ( 'should be true if merged cell would not cross heading section (current cell with colspan)' , ( ) => {
130+ setData ( model , modelTable ( [
131+ [ { colspan : 2 , contents : '00[]' } , '01' , '02' , '03' ]
132+ ] , { headingColumns : 3 } ) ) ;
133+
134+ expect ( command . isEnabled ) . to . be . true ;
135+ } ) ;
96136 } ) ;
97137
98138 describe ( 'value' , ( ) => {
@@ -273,6 +313,22 @@ describe( 'MergeCellCommand', () => {
273313
274314 expect ( command . isEnabled ) . to . be . false ;
275315 } ) ;
316+
317+ it ( 'should be false if mergeable cell is in other table section then current cell' , ( ) => {
318+ setData ( model , modelTable ( [
319+ [ '00' , '01[]' ] ,
320+ ] , { headingColumns : 1 } ) ) ;
321+
322+ expect ( command . isEnabled ) . to . be . false ;
323+ } ) ;
324+
325+ it ( 'should be false if merged cell would cross heading section (mergeable cell with colspan)' , ( ) => {
326+ setData ( model , modelTable ( [
327+ [ { colspan : 2 , contents : '00' } , '02[]' , '03' ]
328+ ] , { headingColumns : 2 } ) ) ;
329+
330+ expect ( command . isEnabled ) . to . be . false ;
331+ } ) ;
276332 } ) ;
277333
278334 describe ( 'value' , ( ) => {
0 commit comments