updated util, added test
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
5ca15033f7
commit
f2757e7d76
@@ -1,6 +1,8 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { type SelectedView, initSync } from "@ironcalc/wasm";
|
||||
import { expect, test } from "vitest";
|
||||
import { decreaseDecimalPlaces, increaseDecimalPlaces } from "../formatUtil";
|
||||
import { isNavigationKey } from "../util";
|
||||
import { getFullRangeToString, isNavigationKey } from "../util";
|
||||
|
||||
test("checks arrow left is a navigation key", () => {
|
||||
expect(isNavigationKey("ArrowLeft")).toBe(true);
|
||||
@@ -24,3 +26,20 @@ test("decrease decimals", () => {
|
||||
'dddd"," mmmm dd"," yyyy',
|
||||
);
|
||||
});
|
||||
|
||||
test("format range to get the full formula", async () => {
|
||||
const buffer = await readFile("node_modules/@ironcalc/wasm/wasm_bg.wasm");
|
||||
initSync(buffer);
|
||||
|
||||
const selectedView: SelectedView = {
|
||||
sheet: 0,
|
||||
row: 1,
|
||||
column: 8,
|
||||
range: [1, 8, 1, 8],
|
||||
top_row: 1,
|
||||
left_column: 8,
|
||||
};
|
||||
const worksheetNames = ["Sheet1", "Notes"];
|
||||
|
||||
expect(getFullRangeToString(selectedView, worksheetNames)).toBe("Sheet1!H1");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user