Skip to content

Commit 842a582

Browse files
test(document): stabilize immutable acl assertion
1 parent 346db2e commit 842a582

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/programs/data/document/document/test/index.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5997,7 +5997,20 @@ describe("index", () => {
59975997
});
59985998

59995999
await store1.docs.put(doc1);
6000-
await store2.docs.put(new Document({ id: doc1.id, number: 2n }));
6000+
6001+
// Make immutable behavior deterministic: ensure store2 has observed the
6002+
// first write before attempting an overwrite of the same id.
6003+
await waitForResolved(async () => {
6004+
const synced = await store2.docs.get(doc1.id, {
6005+
local: true,
6006+
remote: false,
6007+
});
6008+
expect(synced?.number).to.equal(1n);
6009+
});
6010+
6011+
await expect(
6012+
store2.docs.put(new Document({ id: doc1.id, number: 2n })),
6013+
).to.be.rejectedWith("Not allowed to append");
60016014

60026015
/* TODO force test env to make sure remote queries are performed
60036016

0 commit comments

Comments
 (0)