From 46f8fe4ec7362cf9e5b033563503be33d4e355b8 Mon Sep 17 00:00:00 2001 From: Timo K Date: Thu, 27 Nov 2025 16:43:03 +0100 Subject: [PATCH] fix test errors --- .../CallViewModel/localMember/LocalMembership.test.ts | 10 +++++++--- src/state/CallViewModel/localMember/Publisher.ts | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/state/CallViewModel/localMember/LocalMembership.test.ts b/src/state/CallViewModel/localMember/LocalMembership.test.ts index 6c6c3d6e..f5256005 100644 --- a/src/state/CallViewModel/localMember/LocalMembership.test.ts +++ b/src/state/CallViewModel/localMember/LocalMembership.test.ts @@ -225,7 +225,7 @@ describe("LocalMembership", () => { }); expectObservable(localMembership.connectionState.livekit$).toBe("ne", { - n: { state: LivekitState.Connecting }, + n: { state: LivekitState.WaitingForConnection }, e: { state: LivekitState.Error, error: expect.toSatisfy( @@ -279,7 +279,11 @@ describe("LocalMembership", () => { defaultCreateLocalMemberValues.createPublisherFactory.mockImplementation( () => { - const p = { stopPublishing: vi.fn(), stopTracks: vi.fn() }; + const p = { + stopPublishing: vi.fn(), + stopTracks: vi.fn(), + publishing$: constant(false), + }; publishers.push(p as unknown as Publisher); return p; }, @@ -367,6 +371,7 @@ describe("LocalMembership", () => { // stop all tracks after ending scopes expect(publishers[0].stopPublishing).toHaveBeenCalled(); expect(publishers[0].stopTracks).toHaveBeenCalled(); + publisherFactory.mockClear(); }); // TODO add an integration test combining publisher and localMembership // @@ -470,7 +475,6 @@ describe("LocalMembership", () => { expect(localMembership.connectionState.livekit$.isStopped).toBe(false); scope.end(); await flushPromises(); - expect(localMembership.connectionState.livekit$.isStopped).toBe(true); // stays in connected state because it is stopped before the update to tracks update the state. expect(localMembership.connectionState.livekit$.value).toStrictEqual({ state: LivekitState.Connected, diff --git a/src/state/CallViewModel/localMember/Publisher.ts b/src/state/CallViewModel/localMember/Publisher.ts index 14f44491..7fc7d924 100644 --- a/src/state/CallViewModel/localMember/Publisher.ts +++ b/src/state/CallViewModel/localMember/Publisher.ts @@ -15,7 +15,6 @@ import { } from "livekit-client"; import { BehaviorSubject, - combineLatest, map, NEVER, type Observable,