fix test errors

This commit is contained in:
Timo K
2025-11-27 16:43:03 +01:00
parent 4b0f6e76c4
commit 46f8fe4ec7
2 changed files with 7 additions and 4 deletions

View File

@@ -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,

View File

@@ -15,7 +15,6 @@ import {
} from "livekit-client";
import {
BehaviorSubject,
combineLatest,
map,
NEVER,
type Observable,