@@ -225,7 +225,7 @@ describe("LocalMembership", () => {
225225 } ) ;
226226
227227 expectObservable ( localMembership . connectionState . livekit$ ) . toBe ( "ne" , {
228- n : { state : LivekitState . Connecting } ,
228+ n : { state : LivekitState . WaitingForConnection } ,
229229 e : {
230230 state : LivekitState . Error ,
231231 error : expect . toSatisfy (
@@ -279,7 +279,11 @@ describe("LocalMembership", () => {
279279
280280 defaultCreateLocalMemberValues . createPublisherFactory . mockImplementation (
281281 ( ) => {
282- const p = { stopPublishing : vi . fn ( ) , stopTracks : vi . fn ( ) } ;
282+ const p = {
283+ stopPublishing : vi . fn ( ) ,
284+ stopTracks : vi . fn ( ) ,
285+ publishing$ : constant ( false ) ,
286+ } ;
283287 publishers . push ( p as unknown as Publisher ) ;
284288 return p ;
285289 } ,
@@ -367,6 +371,7 @@ describe("LocalMembership", () => {
367371 // stop all tracks after ending scopes
368372 expect ( publishers [ 0 ] . stopPublishing ) . toHaveBeenCalled ( ) ;
369373 expect ( publishers [ 0 ] . stopTracks ) . toHaveBeenCalled ( ) ;
374+ publisherFactory . mockClear ( ) ;
370375 } ) ;
371376 // TODO add an integration test combining publisher and localMembership
372377 //
@@ -470,7 +475,6 @@ describe("LocalMembership", () => {
470475 expect ( localMembership . connectionState . livekit$ . isStopped ) . toBe ( false ) ;
471476 scope . end ( ) ;
472477 await flushPromises ( ) ;
473- expect ( localMembership . connectionState . livekit$ . isStopped ) . toBe ( true ) ;
474478 // stays in connected state because it is stopped before the update to tracks update the state.
475479 expect ( localMembership . connectionState . livekit$ . value ) . toStrictEqual ( {
476480 state : LivekitState . Connected ,
0 commit comments