From 450e72aa8659bfb31a5c6c908fbfefd598d083e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre=20=28lul=29?= Date: Tue, 29 Oct 2024 10:40:28 +0000 Subject: [PATCH 1/3] [FIX] tests: remove async function export test We no longer have async functions since at least 3 years and the `WAIT` function was removed when we removed async function support. This commit removes the test. The following commit adapts other tests using the `wait` function. Task: 4306250 X-original-commit: ec41486b927d75115332f30c8e28591d486d36e3 --- .../__snapshots__/xlsx_export.test.ts.snap | 193 ------------------ tests/xlsx/xlsx_export.test.ts | 14 -- 2 files changed, 207 deletions(-) diff --git a/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap b/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap index 1cd5172a37..8a63f4f1f6 100644 --- a/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap +++ b/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap @@ -29662,199 +29662,6 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` } `; -exports[`Test XLSX export formulas Multi-Sheet export async functions without cross references across sheets 1`] = ` -{ - "files": [ - { - "content": " - - - - -", - "contentType": "workbook", - "path": "xl/workbook.xml", - }, - { - "content": " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", - "contentType": "sheet", - "path": "xl/worksheets/sheet0.xml", - }, - { - "content": " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - -", - "contentType": "sheet", - "path": "xl/worksheets/sheet1.xml", - }, - { - "content": " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -", - "contentType": "styles", - "path": "xl/styles.xml", - }, - { - "content": " -", - "contentType": "sharedStrings", - "path": "xl/sharedStrings.xml", - }, - { - "content": " - - - - -", - "contentType": undefined, - "path": "xl/_rels/workbook.xml.rels", - }, - { - "content": " - - - - - - - - - - - - - - - -", - "contentType": undefined, - "path": "[Content_Types].xml", - }, - { - "content": " - -", - "contentType": undefined, - "path": "_rels/.rels", - }, - ], - "name": "my_spreadsheet.xlsx", -} -`; - exports[`Test XLSX export formulas Multi-Sheet export functions with cross references across sheets 1`] = ` { "files": [ diff --git a/tests/xlsx/xlsx_export.test.ts b/tests/xlsx/xlsx_export.test.ts index fee4552da8..74bcf03f67 100644 --- a/tests/xlsx/xlsx_export.test.ts +++ b/tests/xlsx/xlsx_export.test.ts @@ -900,20 +900,6 @@ describe("Test XLSX export", () => { expect(await exportPrettifiedXlsx(model)).toMatchSnapshot(); }); - test("Multi-Sheet export async functions without cross references across sheets", async () => { - const model = new Model({ - sheets: [ - { id: "s1" }, - { - id: "s2", - name: "Sheet2", - cells: { A1: { content: "5", A2: { content: "=wait(A1)" } } }, - }, - ], - }); - expect(await exportPrettifiedXlsx(model)).toMatchSnapshot(); - }); - test("Multi-Sheet export functions with cross references across sheets", async () => { const model = new Model({ sheets: [ From dc9cedf9dd2fdb333d7dccca7c61d4ed5295f9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre=20=28lul=29?= Date: Tue, 29 Oct 2024 10:59:07 +0000 Subject: [PATCH 2/3] [FIX] tests: bad separator in xlsx export ";" isn't a valid separator. Task: 4306250 X-original-commit: 70f58fa2d1a112656ef706cf6592d34b468b69c0 --- tests/xlsx/__snapshots__/xlsx_export.test.ts.snap | 11 +++-------- tests/xlsx/xlsx_export.test.ts | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap b/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap index 8a63f4f1f6..89c9dbf872 100644 --- a/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap +++ b/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap @@ -29130,9 +29130,9 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` - + - 2 + 1 @@ -29601,7 +29601,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` "path": "xl/styles.xml", }, { - "content": " + "content": " =WAIT(100) @@ -29612,11 +29612,6 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` =sum(A1,wait(100)) - - - =LT(4;42) - - ", "contentType": "sharedStrings", "path": "xl/sharedStrings.xml", diff --git a/tests/xlsx/xlsx_export.test.ts b/tests/xlsx/xlsx_export.test.ts index 74bcf03f67..8d335a7574 100644 --- a/tests/xlsx/xlsx_export.test.ts +++ b/tests/xlsx/xlsx_export.test.ts @@ -396,7 +396,7 @@ const allNonExportableFormulasData = { A6: { content: "=EQ(42,42)" }, A7: { content: "=GT(42,4)" }, A8: { content: "=GTE(4,4)" }, - A9: { content: "=LT(4;42)" }, + A9: { content: "=LT(4,42)" }, A10: { content: "=LTE(6,6)" }, A11: { content: "=MINUS(42,24)" }, A12: { content: "=MULTIPLY(42,2)" }, From 679c60ad8c8c26e6a142d31d6a38a74ec1a89d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre=20=28lul=29?= Date: Tue, 29 Oct 2024 10:55:29 +0000 Subject: [PATCH 3/3] [FIX] tests: remove WAIT funtion The `WAIT` function no longer exists. It has been removed several years ago when async function support was removed. This commit adapts the tests using to use other functions. Note that 2 tests had their data wrongly defined where the `A2` was a child of the `A1` object instead of being its neighbour. Task: 4306250 X-original-commit: 262b1bc2aa14cbfcba87ae8360aa965da76eb806 --- .../__snapshots__/xlsx_export.test.ts.snap | 61 ++++++++++--------- tests/xlsx/xlsx_export.test.ts | 9 ++- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap b/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap index 89c9dbf872..5e2cb71b03 100644 --- a/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap +++ b/tests/xlsx/__snapshots__/xlsx_export.test.ts.snap @@ -29024,10 +29024,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` - - - 0 - + @@ -29038,9 +29035,12 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` - + + + SUM(A1,ABS(100)) + - 1 + 100 @@ -29221,12 +29221,12 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` - + SUM(A3:Z3) - #NAME? + 100 @@ -29236,7 +29236,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` SUM(A3:A100) - #NAME? + #CYCLE @@ -29601,17 +29601,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = ` "path": "xl/styles.xml", }, { - "content": " - - - =WAIT(100) - - - - - =sum(A1,wait(100)) - - + "content": " ", "contentType": "sharedStrings", "path": "xl/sharedStrings.xml", @@ -29716,6 +29706,13 @@ exports[`Test XLSX export formulas Multi-Sheet export functions with cross refer + + + + 2 + + + ", "contentType": "sheet", @@ -29764,6 +29761,16 @@ exports[`Test XLSX export formulas Multi-Sheet export functions with cross refer + + + + SUM(Sheet1!A2) + + + 2 + + + ", "contentType": "sheet", @@ -31964,9 +31971,12 @@ exports[`Test XLSX export formulas Multi-Sheets exportable functions 1`] = ` - + + + ABS(10) + - 20 + 10 @@ -32018,7 +32028,7 @@ exports[`Test XLSX export formulas Multi-Sheets exportable functions 1`] = ` "path": "xl/styles.xml", }, { - "content": " + "content": " evaluation @@ -32119,11 +32129,6 @@ exports[`Test XLSX export formulas Multi-Sheets exportable functions 1`] = ` >25 - - - =wait(10) - - ", "contentType": "sharedStrings", "path": "xl/sharedStrings.xml", diff --git a/tests/xlsx/xlsx_export.test.ts b/tests/xlsx/xlsx_export.test.ts index 8d335a7574..00cb600df3 100644 --- a/tests/xlsx/xlsx_export.test.ts +++ b/tests/xlsx/xlsx_export.test.ts @@ -388,9 +388,8 @@ const allNonExportableFormulasData = { sheets: [ { cells: { - A1: { content: "=WAIT(100)" }, A2: { content: "=COUNTUNIQUE(1,A24,3,2,4)" }, - A3: { content: "=sum(A1,wait(100))" }, + A3: { content: "=sum(A1,ABS(100))" }, A4: { content: "=ADD(42,24)" }, A5: { content: "=DIVIDE(84,42)" }, A6: { content: "=EQ(42,42)" }, @@ -895,7 +894,7 @@ describe("Test XLSX export", () => { test("Multi-Sheets exportable functions", async () => { const model = new Model({ - sheets: [allExportableFormulasData.sheets[0], { cells: { A1: { content: "=wait(10)" } } }], + sheets: [allExportableFormulasData.sheets[0], { cells: { A1: { content: "=abs(10)" } } }], }); expect(await exportPrettifiedXlsx(model)).toMatchSnapshot(); }); @@ -906,12 +905,12 @@ describe("Test XLSX export", () => { { id: "s1", name: "Sheet1", - cells: { A1: { content: "=sum(Sheet2!A1)", A2: { content: "2" } } }, + cells: { A1: { content: "=sum(Sheet2!A1)" }, A2: { content: "2" } }, }, { id: "s2", name: "Sheet2", - cells: { A1: { content: "5", A2: { content: "=wait(Sheet1!A2)" } } }, + cells: { A1: { content: "5" }, A2: { content: "=sum(Sheet1!A2)" } }, }, ], });