import { UnitTest } from '@ephox/bedrock-client'; import * as Assertions from 'ephox/snooker/test/Assertions'; UnitTest.test('UnmergeOperationsTest', () => { Assertions.checkUnmerge( 'TBA', '' + '' + '' + '' + '
A1B1C1D1
?B2C2D2
?B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TBA', '' + '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
?B2C2D2
?B3C3D3
', '' + '' + '' + '' + '
' + '' + '' + '' + '
1A1B
2A2B
' + 'A1
B1C1D1
B2C2D2
B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TBA', '' + '' + '' + '' + '
A1B1C1
B2C2?
B3??
', '' + '' + '' + '' + '
A1B1C1
B2C2
B3
', [ { section: 0, row: 1, column: 1 } ] ); Assertions.checkUnmerge( 'TBA', '' + '' + '' + '' + '' + '' + '
A1??D1
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '' + '' + '
A1D1
A2B2C2D2
A3B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TBA', '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2??D2
A3B3C3D3
', '' + '' + '' + '' + '' + '' + '
A1B1C1D1
A2D2
A3B3C3D3
', [ { section: 1, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TINY-6484: rowgroup-scoped cell split into cells results in all generated spells having scope row', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
?B2C2D2
?B3C3D3
', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TINY-6484: colgroup-scoped cell split into cells results in all generated spells having scope col', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1???
A2B2C2D2
A3B3C3D3
', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
A1
A2B2C2D2
A3B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TINY-6765 - unmerging rowpsan cells with locked column in selection should be noop', '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TINY-6765 - unmerging rowspan cells with a locked column in the table but not selected should not affect unmerging', '' + '' + '' + '' + '
A1B1C1D1
?B2C2D2
?B3C3D3
', '' + '' + '' + '' + '
A1B1C1D1
B2C2D2
B3C3D3
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TINY-6765 - unmerging colspan cells where the first cell of the colspan is part of a locked column should be a noop', '' + '' + '' + '' + '' + '' + '
A1
B1C1D1
B2C2D2
', '' + '' + '' + '' + '' + '' + '
A1
B1C1D1
B2C2D2
', [ { section: 0, row: 0, column: 0 } ] ); Assertions.checkUnmerge( 'TINY-6765 - unmerging colspan cells where the first cell of the colspan is not part of a locked column should not affect unmerging', '' + '' + '' + '' + '' + '' + '
A1??
B1C1D1
B2C2D2
', '' + '' + '' + '' + '' + '' + '
A1
B1C1D1
B2C2D2
', [ { section: 0, row: 0, column: 0 } ] ); });