summaryrefslogtreecommitdiff
path: root/apps/web/src/doc/index.test.ts
diff options
context:
space:
mode:
authorJosh Kingsley <josh@joshkingsley.me>2025-11-24 15:46:22 +0200
committerJosh Kingsley <josh@joshkingsley.me>2025-11-24 15:46:22 +0200
commitd724cc0bf6ff6d351319e6fb00f5184a04e16ac0 (patch)
treecb43253479df5db8f4844e17e68a48ea5a212df4 /apps/web/src/doc/index.test.ts
parent7c966e105cd9f65853de1aba0ecce63aa56aca0b (diff)
chore: improve dev tasks
Diffstat (limited to 'apps/web/src/doc/index.test.ts')
-rw-r--r--apps/web/src/doc/index.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/web/src/doc/index.test.ts b/apps/web/src/doc/index.test.ts
new file mode 100644
index 0000000..5f61398
--- /dev/null
+++ b/apps/web/src/doc/index.test.ts
@@ -0,0 +1,16 @@
+import { expect, test } from "vitest";
+import { apply, defaultDoc, realizeGrids, subdivide } from ".";
+
+test(realizeGrids, () => {
+ const doc = defaultDoc();
+ const grids = realizeGrids(doc);
+
+ expect(grids.length).toBe(1);
+ expect(grids[0].rows.length).toBe(4);
+ expect(grids[0].rows[0].cells.length).toBe(16);
+
+ const doc2 = apply(doc, subdivide(grids[0].id, 0, 0, 3, 3));
+ const grids2 = realizeGrids(doc2);
+
+ expect(grids2[0].rows[0].cells.length).toBe(15);
+});