import { UnitTest } from '@ephox/bedrock-client'; import { Optional } from '@ephox/katamari'; import * as TableOperations from 'ephox/snooker/api/TableOperations'; import { TableSection } from 'ephox/snooker/api/TableSection'; import * as Assertions from 'ephox/snooker/test/Assertions'; import { generateTestTable } from 'ephox/snooker/test/CreateTableUtils'; UnitTest.test('HeaderOperationsTest', () => { const testSingleRowSection = () => { Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowBody, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.makeRowBody, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowBody, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 1, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowBody, 1, 0, 1 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1 ); Assertions.checkOld( 'TINY-6666: Convert body to header (section cells)', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1, TableSection.sectionCells() ); Assertions.checkOld( 'TINY-6666: Convert body to header (section)', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 0, TableSection.section() ); Assertions.checkOld( 'TINY-6666: Convert body to footer (section)', Optional.some({ section: 1, row: 0, column: 1 }), '' + '' + '' + '
A2B2C2D2
A1B1C1D1
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowFooter, 0, 0, 1, TableSection.section() ); Assertions.checkOld( 'TINY-6666: Convert header to footer (section cells)', Optional.some({ section: 1, row: 0, column: 1 }), '' + '' + '' + '
A2B2C2D2
A1B1C1D1
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowFooter, 0, 0, 1, TableSection.sectionCells() ); Assertions.checkOld( 'TINY-7709: Convert single row with colspan to header', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1C1D1
A2B2C2D2
', '' + '' + '' + '
A1C1D1
A2B2C2D2
', TableOperations.makeRowHeader, 0, 0, 1 ); }; const testMultipleRowSection = () => { Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsBody, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.makeRowsBody, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsBody, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 1, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsBody, [{ section: 1, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [{ section: 0, row: 0, column: 1 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsBody, [ { section: 0, row: 0, column: 1 }, { section: 0, row: 1, column: 1 } ] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [ { section: 0, row: 0, column: 1 }, { section: 0, row: 1, column: 1 } ] ); Assertions.checkOldMultiple( 'TINY-6666: Footer rows to header rows (section cells)', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsHeader, [ { section: 0, row: 0, column: 1 }, { section: 0, row: 1, column: 1 } ], TableSection.sectionCells() ); Assertions.checkOldMultiple( 'TINY-6666: Body rows to footer rows (section)', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeRowsFooter, [ { section: 0, row: 0, column: 1 }, { section: 0, row: 1, column: 1 } ], TableSection.section() ); Assertions.checkOldMultiple( 'TINY-6666: Header rows to footer rows (section cells)', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2D2
', '' + '' + '' + '
A1B1C1D1
A2B2D2
', TableOperations.makeRowsFooter, [ { section: 0, row: 0, column: 1 }, { section: 0, row: 1, column: 1 } ], TableSection.sectionCells() ); }; const testSingleColumnHeader = () => { Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeColumnHeader, 0, 1, 0 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.makeColumnHeader, 0, 1, 0 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnHeader, 0, 1, 0 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnHeader, 0, 1, 0 ); Assertions.checkOld( 'TBA', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeColumnHeader, 0, 0, 0 ); Assertions.checkOld( 'TBA', Optional.some({ section: 1, row: 0, column: 0 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnHeader, 1, 0, 0 ); Assertions.checkOld( 'Check that locked column is not converted to a header column', Optional.none(), generateTestTable( [ 'A1B1', 'A2B2' ], [], [], { numCols: 2, colgroup: false, lockedColumns: [ 0 ] } ), generateTestTable( [ 'A1B1', 'A2B2' ], [], [], { numCols: 2, colgroup: false, lockedColumns: [ 0 ] } ), TableOperations.makeColumnHeader, 0, 0, 0 ); Assertions.checkOld( 'TINY-6765: Check that locked header column is not converted to a normal column', Optional.none(), generateTestTable( [ 'A1B1', 'A2B2' ], [], [], { numCols: 2, colgroup: false, lockedColumns: [ 0 ] } ), generateTestTable( [ 'A1B1', 'A2B2' ], [], [], { numCols: 2, colgroup: false, lockedColumns: [ 0 ] } ), TableOperations.unmakeColumnHeader, 0, 0, 0 ); Assertions.checkOld( 'TINY-7709: Convert single column with rowspan to header', Optional.some({ section: 0, row: 2, column: 0 }), '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
A3B3C3D3
', TableOperations.makeColumnHeader, 0, 2, 0 ); }; const testMultipleColumnHeader = () => { Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeColumnsHeader, [{ section: 0, row: 1, column: 0 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.makeColumnsHeader, [{ section: 0, row: 1, column: 0 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnsHeader, [{ section: 0, row: 1, column: 0 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 1, column: 0 }), '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnsHeader, [{ section: 0, row: 1, column: 0 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeColumnsHeader, [{ section: 0, row: 0, column: 0 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 1, row: 0, column: 0 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnsHeader, [{ section: 1, row: 0, column: 0 }] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 1, row: 0, column: 0 }), '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeColumnsHeader, [ { section: 1, row: 0, column: 0 }, { section: 1, row: 0, column: 1 } ] ); Assertions.checkOldMultiple( 'TBA', Optional.some({ section: 1, row: 0, column: 0 }), '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeColumnsHeader, [ { section: 1, row: 0, column: 0 }, { section: 1, row: 0, column: 1 } ] ); Assertions.checkOldMultiple( 'TINY-6765: Check that locked columns in the selection are not converted to header columns', Optional.some({ section: 0, row: 1, column: 0 }), generateTestTable( [ 'A1B1C1D1', 'A2B2C2D2' ], [], [], { numCols: 4, colgroup: false, lockedColumns: [ 1, 3 ] } ), generateTestTable( [ 'A1B1C1D1', 'A2B2C2D2' ], [], [], { numCols: 4, colgroup: false, lockedColumns: [ 1, 3 ] } ), TableOperations.makeColumnsHeader, [ { section: 0, row: 1, column: 0 }, { section: 0, row: 1, column: 1 }, { section: 0, row: 1, column: 2 }, { section: 0, row: 1, column: 3 } ] ); Assertions.checkOldMultiple( 'TINY-6765: Check that locked header columns are not converted to normal columns', Optional.some({ section: 0, row: 1, column: 0 }), generateTestTable( [ 'A1B1C1D1', 'A2B2C2D2' ], [], [], { numCols: 4, colgroup: false, lockedColumns: [ 1, 3 ] } ), generateTestTable( [ 'A1B1C1D1', 'A2B2C2D2' ], [], [], { numCols: 4, colgroup: false, lockedColumns: [ 1, 3 ] } ), TableOperations.unmakeColumnsHeader, [ { section: 0, row: 1, column: 0 }, { section: 0, row: 1, column: 1 }, { section: 0, row: 1, column: 2 }, { section: 0, row: 1, column: 3 } ] ); }; const testSingleCellHeader = () => { Assertions.checkOld( 'Convert single regular cell to header cell', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeCellHeader, 0, 0, 1 ); Assertions.checkOld( 'Convert single regular cell with colspan to header cell', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1D1
A2B2C2D2
', '' + '' + '' + '
A1B1D1
A2B2C2D2
', TableOperations.makeCellHeader, 0, 0, 1 ); Assertions.checkOld( 'Convert single header cell to regular cell', Optional.some({ section: 1, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeCellHeader, 1, 0, 1 ); Assertions.checkOld( 'Convert single header cell with scope to regular cell', Optional.some({ section: 1, row: 0, column: 1 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeCellHeader, 1, 0, 1 ); }; const testMultipleCellHeader = () => { Assertions.checkOldMultiple( 'Convert multiple regular cells to header cells', Optional.some({ section: 0, row: 0, column: 1 }), '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.makeCellsHeader, [ { section: 0, row: 0, column: 1 }, { section: 0, row: 0, column: 2 }, { section: 0, row: 0, column: 3 } ] ); Assertions.checkOldMultiple( 'Convert multiple header cells to regular cells', Optional.some({ section: 0, row: 0, column: 2 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeCellsHeader, [ { section: 0, row: 0, column: 2 }, { section: 0, row: 0, column: 3 } ] ); Assertions.checkOldMultiple( 'Convert multiple header cells with scope to regular cell', Optional.some({ section: 1, row: 0, column: 0 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
', TableOperations.unmakeCellsHeader, [ { section: 1, row: 0, column: 0 }, { section: 1, row: 0, column: 1 } ] ); }; const testMixedHeaders = () => { Assertions.checkOldMultiple( 'TINY-7709: Convert regular column to header column with an existing header row', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', TableOperations.makeColumnsHeader, [ { section: 0, row: 0, column: 0 }, { section: 0, row: 1, column: 0 }, { section: 0, row: 2, column: 0 } ] ); Assertions.checkOldMultiple( 'TINY-7709: Convert header column to regular column with an existing header row', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', TableOperations.unmakeColumnsHeader, [ { section: 0, row: 0, column: 0 }, { section: 0, row: 1, column: 0 }, { section: 0, row: 2, column: 0 } ] ); Assertions.checkOldMultiple( 'TINY-7709: Convert header column to regular column with an existing thead section header row', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', TableOperations.unmakeColumnsHeader, [ { section: 0, row: 0, column: 0 }, { section: 1, row: 0, column: 0 }, { section: 1, row: 1, column: 0 } ] ); Assertions.checkOldMultiple( 'TINY-7709: Convert regular row to header row with an existing header column', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', TableOperations.makeRowsHeader, [ { section: 0, row: 0, column: 0 }, { section: 0, row: 0, column: 1 }, { section: 0, row: 0, column: 2 }, { section: 0, row: 0, column: 3 } ] ); Assertions.checkOldMultiple( 'TINY-7709: Convert header row to regular row with an existing header column', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
A2B2C2D2
A3B3C3D3
', TableOperations.makeRowsBody, [ { section: 0, row: 0, column: 0 }, { section: 0, row: 0, column: 1 }, { section: 0, row: 0, column: 2 }, { section: 0, row: 0, column: 3 } ] ); Assertions.checkOldMultiple( 'TINY-7709: Convert header row with rowspan to regular row with an existing header column', Optional.some({ section: 0, row: 0, column: 0 }), '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
A3B3C3D3
', TableOperations.makeRowsBody, [ { section: 0, row: 0, column: 0 }, { section: 0, row: 0, column: 1 }, { section: 0, row: 0, column: 2 }, { section: 0, row: 0, column: 3 } ] ); }; testSingleRowSection(); testMultipleRowSection(); testSingleColumnHeader(); testMultipleColumnHeader(); testSingleCellHeader(); testMultipleCellHeader(); testMixedHeaders(); });