Skip to content

Commit

Permalink
[FIX] tests: remove WAIT funtion
Browse files Browse the repository at this point in the history
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.

closes #5170

Task: 4306250
X-original-commit: 262b1bc
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
  • Loading branch information
LucasLefevre committed Nov 7, 2024
1 parent 0513a21 commit 0d66793
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
61 changes: 33 additions & 28 deletions tests/xlsx/__snapshots__/xlsx_export.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29024,10 +29024,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = `
</cols>
<sheetData>
<row r="1">
<c r="A1" t="s">
<v>
0
</v>
<c r="A1">
</c>
</row>
<row r="2">
Expand All @@ -29038,9 +29035,12 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = `
</c>
</row>
<row r="3">
<c r="A3" t="s">
<c r="A3" t="n">
<f>
SUM(A1,ABS(100))
</f>
<v>
1
100
</v>
</c>
<c r="B3">
Expand Down Expand Up @@ -29221,12 +29221,12 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = `
</c>
</row>
<row r="22">
<c r="A22" t="str">
<c r="A22" t="n">
<f>
SUM(A3:Z3)
</f>
<v>
#NAME?
100
</v>
</c>
</row>
Expand All @@ -29236,7 +29236,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = `
SUM(A3:A100)
</f>
<v>
#NAME?
#CYCLE
</v>
</c>
</row>
Expand Down Expand Up @@ -29601,17 +29601,7 @@ exports[`Test XLSX export formulas All non-exportable formulas 1`] = `
"path": "xl/styles.xml",
},
{
"content": "<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="2" uniqueCount="2">
<si>
<t>
=WAIT(100)
</t>
</si>
<si>
<t>
=sum(A1,wait(100))
</t>
</si>
"content": "<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="0" uniqueCount="0">
</sst>",
"contentType": "sharedStrings",
"path": "xl/sharedStrings.xml",
Expand Down Expand Up @@ -29716,6 +29706,13 @@ exports[`Test XLSX export formulas Multi-Sheet export functions with cross refer
</v>
</c>
</row>
<row r="2">
<c r="A2">
<v>
2
</v>
</c>
</row>
</sheetData>
</worksheet>",
"contentType": "sheet",
Expand Down Expand Up @@ -29764,6 +29761,16 @@ exports[`Test XLSX export formulas Multi-Sheet export functions with cross refer
</v>
</c>
</row>
<row r="2">
<c r="A2" t="n">
<f>
SUM(Sheet1!A2)
</f>
<v>
2
</v>
</c>
</row>
</sheetData>
</worksheet>",
"contentType": "sheet",
Expand Down Expand Up @@ -31964,9 +31971,12 @@ exports[`Test XLSX export formulas Multi-Sheets exportable functions 1`] = `
</cols>
<sheetData>
<row r="1">
<c r="A1" t="s">
<c r="A1" t="n">
<f>
ABS(10)
</f>
<v>
20
10
</v>
</c>
</row>
Expand Down Expand Up @@ -32018,7 +32028,7 @@ exports[`Test XLSX export formulas Multi-Sheets exportable functions 1`] = `
"path": "xl/styles.xml",
},
{
"content": "<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="21" uniqueCount="21">
"content": "<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="20" uniqueCount="20">
<si>
<t>
evaluation
Expand Down Expand Up @@ -32119,11 +32129,6 @@ exports[`Test XLSX export formulas Multi-Sheets exportable functions 1`] = `
&gt;25
</t>
</si>
<si>
<t>
=wait(10)
</t>
</si>
</sst>",
"contentType": "sharedStrings",
"path": "xl/sharedStrings.xml",
Expand Down
9 changes: 4 additions & 5 deletions tests/xlsx/xlsx_export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)" },
Expand Down Expand Up @@ -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();
});
Expand All @@ -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)" } },
},
],
});
Expand Down

0 comments on commit 0d66793

Please sign in to comment.