Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add unit test for moveColumns with tight maxColumns limit #1189

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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