File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/programs/data/document/document/test Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments