From 30db0f3aa898976953283f2047470e9d716b99ae Mon Sep 17 00:00:00 2001 From: Kuba Sekowski Date: Thu, 9 Mar 2023 16:20:49 +0100 Subject: [PATCH] Add unit test for moveColumns with tight maxColumns limit --- test/cruds/move-columns.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/cruds/move-columns.spec.ts b/test/cruds/move-columns.spec.ts index 71039bd725..ebe94fbce6 100644 --- a/test/cruds/move-columns.spec.ts +++ b/test/cruds/move-columns.spec.ts @@ -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']