File tree Expand file tree Collapse file tree
packages/query-db-collection/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -431,7 +431,9 @@ describe(`QueryCollection`, () => {
431431 } )
432432
433433 // Verify queryFn was called with the correct context, including the meta object
434- expect ( queryFn ) . toHaveBeenCalledWith ( expect . objectContaining ( { meta } ) )
434+ expect ( queryFn ) . toHaveBeenCalledWith (
435+ expect . objectContaining ( { meta : { ...meta , tsDb : { } } } )
436+ )
435437 } )
436438
437439 describe ( `Select method testing` , ( ) => {
@@ -696,6 +698,20 @@ describe(`QueryCollection`, () => {
696698
697699 // Test case 1: Default behavior (undefined return) should trigger refetch
698700 const optionsDefault = queryCollectionOptions ( configDefault )
701+
702+ // Call sync to force the query to be created
703+ optionsDefault . sync . sync ( {
704+ begin : ( ) => { } ,
705+ write : ( ) => { } ,
706+ commit : ( ) => { } ,
707+ collection : {
708+ subscriberCount : 1 ,
709+ on : ( ) => {
710+ return ( ) => { }
711+ } ,
712+ } ,
713+ } as any )
714+
699715 await optionsDefault . onInsert ! ( insertMockParams )
700716
701717 // Verify handler was called and refetch was triggered
You can’t perform that action at this time.
0 commit comments