Skip to content

Commit

Permalink
Add unit test for moveColumns with tight maxColumns limit
Browse files Browse the repository at this point in the history
  • Loading branch information
sequba committed Mar 9, 2023
1 parent 36731f4 commit 30db0f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/cruds/move-columns.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ describe('Move columns', () => {
expect(engine.getCellValue(adr('D1'))).toEqual(4)
})

it('should work when maxColumns limit is set tightly', () => {
const engine = HyperFormula.buildFromArray([
['1', '2', '3', '4']
], { maxColumns: 4 })

engine.moveColumns(0, 0, 1, 2)

expect(engine.getCellValue(adr('A1'))).toEqual(2)
expect(engine.getCellValue(adr('B1'))).toEqual(1)
expect(engine.getCellValue(adr('C1'))).toEqual(3)
expect(engine.getCellValue(adr('D1'))).toEqual(4)
})

it('should move column when moving to left', () => {
const engine = HyperFormula.buildFromArray([
['1', '2', '3', '4']
Expand Down

0 comments on commit 30db0f3

Please # to comment.