浏览代码

Fix tables used in tests.

Maciej Gołaszewski 5 年之前
父节点
当前提交
e48d63df38

+ 16 - 16
packages/ckeditor5-table/tests/commands/removecolumncommand.js

@@ -367,21 +367,21 @@ describe( 'RemoveColumnCommand', () => {
 
 		it( 'should decrease colspan of table cells from previous column', () => {
 			setData( model, modelTable( [
-				[ { colspan: 4, contents: '00' }, '03' ],
-				[ { colspan: 3, contents: '10' }, '13' ],
-				[ { colspan: 2, contents: '20' }, '22[]', '23' ],
-				[ '30', { colspan: 2, contents: '31' }, '33' ],
-				[ '40', '41', '42', '43' ]
+				[ { colspan: 4, contents: '00' }, '04' ],
+				[ { colspan: 3, contents: '10' }, '14' ],
+				[ { colspan: 2, contents: '20' }, '22[]', '23', '24' ],
+				[ '30', { colspan: 2, contents: '31' }, '33', '34' ],
+				[ '40', '41', '42', '43', '44' ]
 			] ) );
 
 			command.execute();
 
 			assertEqualMarkup( getData( model ), modelTable( [
-				[ { colspan: 3, contents: '00' }, '03' ],
-				[ { colspan: 2, contents: '10' }, '13' ],
-				[ { colspan: 2, contents: '20' }, '[]23' ],
-				[ '30', '31', '33' ],
-				[ '40', '41', '43' ]
+				[ { colspan: 3, contents: '00' }, '04' ],
+				[ { colspan: 2, contents: '10' }, '14' ],
+				[ { colspan: 2, contents: '20' }, '[]23', '24' ],
+				[ '30', '31', '33', '34' ],
+				[ '40', '41', '43', '44' ]
 
 			] ) );
 		} );
@@ -389,7 +389,7 @@ describe( 'RemoveColumnCommand', () => {
 		it( 'should decrease colspan of cells that are on removed column', () => {
 			setData( model, modelTable( [
 				[ { colspan: 3, contents: '[]00' }, '03' ],
-				[ { colspan: 2, contents: '10' }, '13' ],
+				[ { colspan: 2, contents: '10' }, '12', '13' ],
 				[ '20', '21', '22', '23' ]
 			] ) );
 
@@ -397,7 +397,7 @@ describe( 'RemoveColumnCommand', () => {
 
 			assertEqualMarkup( getData( model ), modelTable( [
 				[ { colspan: 2, contents: '[]00' }, '03' ],
-				[ '10', '13' ],
+				[ '10', '12', '13' ],
 				[ '21', '22', '23' ]
 			] ) );
 		} );
@@ -421,7 +421,7 @@ describe( 'RemoveColumnCommand', () => {
 		it( 'should work property if the rowspan is in the first column (the other cell in row is selected)', () => {
 			setData( model, modelTable( [
 				[ { rowspan: 2, contents: '00' }, '[]01' ],
-				[ '10' ]
+				[ '11' ]
 			] ) );
 
 			command.execute();
@@ -434,7 +434,7 @@ describe( 'RemoveColumnCommand', () => {
 		it( 'should work property if the rowspan is in the first column (the cell in row below is selected)', () => {
 			setData( model, modelTable( [
 				[ { rowspan: 2, contents: '00' }, '01' ],
-				[ '[]10' ]
+				[ '[]11' ]
 			] ) );
 
 			command.execute();
@@ -447,14 +447,14 @@ describe( 'RemoveColumnCommand', () => {
 		it( 'should work property if the rowspan is in the first column (the cell with rowspan is selected)', () => {
 			setData( model, modelTable( [
 				[ { rowspan: 2, contents: '00[]' }, '01' ],
-				[ '10' ]
+				[ '11' ]
 			] ) );
 
 			command.execute();
 
 			assertEqualMarkup( getData( model ), modelTable( [
 				[ '[]01' ],
-				[ '10' ]
+				[ '11' ]
 			] ) );
 		} );
 

+ 14 - 14
packages/ckeditor5-table/tests/tableutils.js

@@ -1013,21 +1013,21 @@ describe( 'TableUtils', () => {
 
 			it( 'should decrease colspan of table cells from previous column', () => {
 				setData( model, modelTable( [
-					[ { colspan: 4, contents: '00' }, '03' ],
-					[ { colspan: 3, contents: '10' }, '13' ],
-					[ { colspan: 2, contents: '20' }, '22', '23' ],
-					[ '30', { colspan: 2, contents: '31' }, '33' ],
-					[ '40', '41', '42', '43' ]
+					[ { colspan: 4, contents: '00' }, '04' ],
+					[ { colspan: 3, contents: '10' }, '14' ],
+					[ { colspan: 2, contents: '20' }, '22', '23', '24' ],
+					[ '30', { colspan: 2, contents: '31' }, '33', '34' ],
+					[ '40', '41', '42', '43', '44' ]
 				] ) );
 
 				tableUtils.removeColumns( root.getNodeByPath( [ 0 ] ), { at: 2 } );
 
 				assertEqualMarkup( getData( model, { withoutSelection: true } ), modelTable( [
-					[ { colspan: 3, contents: '00' }, '03' ],
-					[ { colspan: 2, contents: '10' }, '13' ],
-					[ { colspan: 2, contents: '20' }, '23' ],
-					[ '30', '31', '33' ],
-					[ '40', '41', '43' ]
+					[ { colspan: 3, contents: '00' }, '04' ],
+					[ { colspan: 2, contents: '10' }, '14' ],
+					[ { colspan: 2, contents: '20' }, '23', '24' ],
+					[ '30', '31', '33', '34' ],
+					[ '40', '41', '43', '44' ]
 
 				] ) );
 			} );
@@ -1035,7 +1035,7 @@ describe( 'TableUtils', () => {
 			it( 'should decrease colspan of cells that are on removed column', () => {
 				setData( model, modelTable( [
 					[ { colspan: 3, contents: '00' }, '03' ],
-					[ { colspan: 2, contents: '10' }, '13' ],
+					[ { colspan: 2, contents: '10' }, '12', '13' ],
 					[ '20', '21', '22', '23' ]
 				] ) );
 
@@ -1043,7 +1043,7 @@ describe( 'TableUtils', () => {
 
 				assertEqualMarkup( getData( model, { withoutSelection: true } ), modelTable( [
 					[ { colspan: 2, contents: '00' }, '03' ],
-					[ '10', '13' ],
+					[ '10', '12', '13' ],
 					[ '21', '22', '23' ]
 				] ) );
 			} );
@@ -1051,14 +1051,14 @@ describe( 'TableUtils', () => {
 			it( 'should remove column with rowspan (first column)', () => {
 				setData( model, modelTable( [
 					[ { rowspan: 2, contents: '00' }, '01' ],
-					[ '10' ]
+					[ '11' ]
 				] ) );
 
 				tableUtils.removeColumns( root.getNodeByPath( [ 0 ] ), { at: 0 } );
 
 				assertEqualMarkup( getData( model, { withoutSelection: true } ), modelTable( [
 					[ '01' ],
-					[ '10' ]
+					[ '11' ]
 				] ) );
 			} );