fixing some tests

This commit is contained in:
Timo
2025-06-23 19:02:36 +02:00
committed by Robin
parent b3863748dc
commit 434712ba17
2 changed files with 20 additions and 20 deletions

View File

@@ -401,7 +401,9 @@ export class CallViewModel extends ViewModel {
* The raw list of RemoteParticipants as reported by LiveKit * The raw list of RemoteParticipants as reported by LiveKit
*/ */
private readonly rawRemoteParticipants$: Observable<RemoteParticipant[]> = private readonly rawRemoteParticipants$: Observable<RemoteParticipant[]> =
connectedParticipantsObserver(this.livekitRoom).behavior(this.scope); connectedParticipantsObserver(this.livekitRoom)
.pipe(startWith([]))
.behavior(this.scope);
/** /**
* Lists of RemoteParticipants to "hold" on display, even if LiveKit claims that * Lists of RemoteParticipants to "hold" on display, even if LiveKit claims that
@@ -507,6 +509,21 @@ export class CallViewModel extends ViewModel {
) )
.behavior(this.scope); .behavior(this.scope);
public readonly handsRaised$ = this.handsRaisedSubject$.behavior(this.scope);
public readonly reactions$ = this.reactionsSubject$
.pipe(
map((v) =>
Object.fromEntries(
Object.entries(v).map(([a, { reactionOption }]) => [
a,
reactionOption,
]),
),
),
)
.behavior(this.scope);
/** /**
* List of MediaItems that we want to display * List of MediaItems that we want to display
*/ */
@@ -1313,21 +1330,6 @@ export class CallViewModel extends ViewModel {
}, },
).behavior(this.scope); ).behavior(this.scope);
public readonly reactions$ = this.reactionsSubject$
.pipe(
map((v) =>
Object.fromEntries(
Object.entries(v).map(([a, { reactionOption }]) => [
a,
reactionOption,
]),
),
),
)
.behavior(this.scope);
public readonly handsRaised$ = this.handsRaisedSubject$.behavior(this.scope);
/** /**
* Emits an array of reactions that should be visible on the screen. * Emits an array of reactions that should be visible on the screen.
*/ */

View File

@@ -26,11 +26,9 @@ test("muteAllAudio$", () => {
muteAllAudio.unsubscribe(); muteAllAudio.unsubscribe();
expect(valueMock).toHaveBeenCalledTimes(6); expect(valueMock).toHaveBeenCalledTimes(4);
expect(valueMock).toHaveBeenNthCalledWith(1, false); // startWith([false, muteAllAudioSetting.getValue()]); expect(valueMock).toHaveBeenNthCalledWith(1, false); // startWith([false, muteAllAudioSetting.getValue()]);
expect(valueMock).toHaveBeenNthCalledWith(2, true); // setAudioEnabled$.next(false); expect(valueMock).toHaveBeenNthCalledWith(2, true); // setAudioEnabled$.next(false);
expect(valueMock).toHaveBeenNthCalledWith(3, false); // setAudioEnabled$.next(true); expect(valueMock).toHaveBeenNthCalledWith(3, false); // setAudioEnabled$.next(true);
expect(valueMock).toHaveBeenNthCalledWith(4, false); // muteAllAudioSetting.setValue(false); expect(valueMock).toHaveBeenNthCalledWith(4, true); // muteAllAudioSetting.setValue(true);
expect(valueMock).toHaveBeenNthCalledWith(5, true); // muteAllAudioSetting.setValue(true);
expect(valueMock).toHaveBeenNthCalledWith(6, true); // setAudioEnabled$.next(false);
}); });