@@ -41,16 +41,20 @@ describe("run_function_when_microservices_connected", () => {
4141 await viewerStore . $patch ( { status : Status . NOT_CONNECTED } )
4242 } )
4343
44- test ( "microservices connected" , async ( ) => {
44+ test ( "microservices not connected" , async ( ) => {
4545 const geodeStore = useGeodeStore ( )
4646 const viewerStore = useViewerStore ( )
47+ const infraStore = useInfraStore ( )
4748 const spy = vi . spyOn ( dumb_obj , "dumb_method" )
4849 run_function_when_microservices_connected ( dumb_obj . dumb_method )
49- await geodeStore . $patch ( { status : Status . CONNECTED } )
50- await viewerStore . $patch ( { status : Status . CONNECTED } )
51- expect ( spy ) . toHaveBeenCalled ( )
52- } )
50+ await geodeStore . $patch ( { status : Status . NOT_CONNECTED } )
51+ await viewerStore . $patch ( { status : Status . NOT_CONNECTED } )
52+ console . log ( "geodeStore" , geodeStore . status )
53+ console . log ( "viewerStore" , viewerStore . status )
5354
55+ console . log ( "microservices_connected" , infraStore . microservices_connected )
56+ expect ( spy ) . not . toHaveBeenCalled ( )
57+ } )
5458 test ( "microservices not connected" , async ( ) => {
5559 const geodeStore = useGeodeStore ( )
5660 const viewerStore = useViewerStore ( )
@@ -65,4 +69,14 @@ describe("run_function_when_microservices_connected", () => {
6569 console . log ( "microservices_connected" , infraStore . microservices_connected )
6670 expect ( spy ) . not . toHaveBeenCalled ( )
6771 } )
72+
73+ test ( "microservices connected" , async ( ) => {
74+ const geodeStore = useGeodeStore ( )
75+ const viewerStore = useViewerStore ( )
76+ const spy = vi . spyOn ( dumb_obj , "dumb_method" )
77+ run_function_when_microservices_connected ( dumb_obj . dumb_method )
78+ await geodeStore . $patch ( { status : Status . CONNECTED } )
79+ await viewerStore . $patch ( { status : Status . CONNECTED } )
80+ expect ( spy ) . toHaveBeenCalled ( )
81+ } )
6882} )
0 commit comments