UPDATE: Adds web app (#79)
Things missing: * Browse mode * Front end tests * Storybook
This commit is contained in:
committed by
GitHub
parent
083548608e
commit
dc23a7f29c
13
webapp/src/components/tests/model.test.ts
Normal file
13
webapp/src/components/tests/model.test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { Model, initSync } from "@ironcalc/wasm";
|
||||
import { expect, test } from "vitest";
|
||||
|
||||
// This is a simple test that showcases how to load the wasm module in the tests
|
||||
|
||||
test("simple calculation", async () => {
|
||||
const buffer = await readFile("node_modules/@ironcalc/wasm/wasm_bg.wasm");
|
||||
initSync(buffer);
|
||||
const model = new Model("en", "UTC");
|
||||
model.setUserInput(0, 1, 1, "=21*2");
|
||||
expect(model.getFormattedCellValue(0, 1, 1)).toBe("42");
|
||||
});
|
||||
7
webapp/src/components/tests/util.test.ts
Normal file
7
webapp/src/components/tests/util.test.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { expect, test } from "vitest";
|
||||
import { isNavigationKey } from "../util";
|
||||
|
||||
test("checks arrow left is a navigation key", () => {
|
||||
expect(isNavigationKey("ArrowLeft")).toBe(true);
|
||||
expect(isNavigationKey("Arrow")).toBe(false);
|
||||
});
|
||||
Reference in New Issue
Block a user