Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Apr 25, 2024
1 parent ea5758d commit 25a659f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/runed/src/lib/functions/box/box.test.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,16 @@ describe("box.readonly", () => {

expect(setReadOnlyCount).toThrow();
});

test("box.readonly returned box should update with original box", () => {
const count = box(0);
const readonlyCount = box.readonly(count);

expect(readonlyCount.value).toBe(0);
count.value = 1;
expect(readonlyCount.value).toBe(1);

count.value = 2;
expect(readonlyCount.value).toBe(2);
});
});

0 comments on commit 25a659f

Please sign in to comment.