summaryrefslogtreecommitdiff
path: root/web/src/grid.test.ts
diff options
context:
space:
mode:
authorJosh Kingsley <josh@joshkingsley.me>2025-11-23 19:27:57 +0200
committerJosh Kingsley <josh@joshkingsley.me>2025-11-23 19:27:57 +0200
commit602145c956bb594ca0d0e10601cc4ad1a71cf70d (patch)
treed9f9980bd2054cff5819d01379f5c1c55f8eb66d /web/src/grid.test.ts
parentc2a6efb1b761014a90d90373cad47a14054af40b (diff)
feat: integrate web and doc packages
Diffstat (limited to 'web/src/grid.test.ts')
-rw-r--r--web/src/grid.test.ts45
1 files changed, 0 insertions, 45 deletions
diff --git a/web/src/grid.test.ts b/web/src/grid.test.ts
deleted file mode 100644
index 50c0626..0000000
--- a/web/src/grid.test.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { expect, test } from "vitest";
-import defaultDoc from "./defaultDoc";
-import renderGrid from "./components/grid/renderGrid";
-import { changeSelectedSubdivisions } from "./grid";
-import { GridSelection } from "./components/grid/selection";
-
-test("foo", () => {
- const doc = defaultDoc();
- const grid = doc.grids[1];
-
- const selection: GridSelection = {
- activeCellRef: { partIndex: 0, rowIndex: 0, cellIndex: 0 },
- range: [
- { partIndex: 0, rowIndex: 0, cellIndex: 0 },
- { partIndex: 0, rowIndex: 0, cellIndex: 3 },
- ],
- };
-
- const newGrid = changeSelectedSubdivisions(grid, selection, 3);
- const renderedGrid = renderGrid(newGrid);
-
- expect(
- renderedGrid.renderedRows.map((row) => row.renderedCells.length),
- ).toStrictEqual([15, 16, 16, 16]);
-
- expect(
- newGrid.parts[0].rows[0].cells.map((cell) => cell.widthRatio.toData()),
- ).toStrictEqual([
- [1, 12],
- [1, 12],
- [1, 12],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- [1, 16],
- ]);
-});