diff --git a/src/AppBar.tsx b/src/AppBar.tsx index ba41629f..6135a3a8 100644 --- a/src/AppBar.tsx +++ b/src/AppBar.tsx @@ -71,8 +71,8 @@ export const AppBar: FC = ({ children }) => { > - - + + diff --git a/src/button/Button.tsx b/src/button/Button.tsx index 1ad5b124..9dec7d9c 100644 --- a/src/button/Button.tsx +++ b/src/button/Button.tsx @@ -193,7 +193,7 @@ export const SettingsIconButton: FC = ({ className={classNamesForScrrenWidth(className, showForScreenWidth)} {...props} > - + ); diff --git a/src/room/CallEventAudioRenderer.test.tsx b/src/room/CallEventAudioRenderer.test.tsx index 5d3eff5e..9ab64dfd 100644 --- a/src/room/CallEventAudioRenderer.test.tsx +++ b/src/room/CallEventAudioRenderer.test.tsx @@ -123,6 +123,7 @@ test("does not play a sound before the call is successful", () => { const { vm, rtcMemberships$ } = getBasicCallViewModelEnvironment( [local, alice], [localRtcMember], + undefined, { waitForCallPickup: true }, ); render(); diff --git a/src/room/InCallView.test.tsx b/src/room/InCallView.test.tsx index 50f586ab..692b920c 100644 --- a/src/room/InCallView.test.tsx +++ b/src/room/InCallView.test.tsx @@ -109,6 +109,7 @@ interface CreateInCallViewArgs { function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & { rtcSession: MockRTCSession; } { + const mediaDevices = args.mediaDevices ?? mockMediaDevices({}); const muteState = mockMuteStates(); const livekitRoom = mockLivekitRoom( { @@ -121,10 +122,8 @@ function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & { const { vm, rtcSession } = getBasicCallViewModelEnvironment( [local, alice], undefined, - { - toggleScreensharing: () => {}, - ...args.callViewModelOptions, - }, + mediaDevices, + {}, ); rtcSession.joined = true; @@ -166,7 +165,7 @@ function createInCallView(args: CreateInCallViewArgs = {}): RenderResult & { const renderResult = render( - + { }, }); - const { getByRole } = createInCallView({ - callViewModelOptions: { mediaDeviceOverride: mediaDevices }, - }); + const { getByRole } = createInCallView({ mediaDevices }); // The button should be visible. When current output is "speaker", // the switcher targets "earpiece", so the tooltip label is "Handset". const audioOutputBtn = getByRole("switch", { name: "Handset" }); diff --git a/src/state/CallViewModel/CallViewModel.ts b/src/state/CallViewModel/CallViewModel.ts index 410ec922..7bfe4630 100644 --- a/src/state/CallViewModel/CallViewModel.ts +++ b/src/state/CallViewModel/CallViewModel.ts @@ -175,7 +175,6 @@ export interface CallViewModelOptions { matrixRTCMode$?: Behavior; /** Optional behavior overriding for the screensharing, for testing */ toggleScreensharing?: () => void; - mediaDeviceOverride?: MediaDevices; } // Do not play any sounds if the participant count has exceeded this diff --git a/src/utils/test-viewmodel.ts b/src/utils/test-viewmodel.ts index 6d77a802..b5438371 100644 --- a/src/utils/test-viewmodel.ts +++ b/src/utils/test-viewmodel.ts @@ -34,6 +34,7 @@ import { MockRTCSession, testScope, } from "./test"; +import { type MediaDevices } from "../state/MediaDevices"; import { aliceRtcMember, localRtcMember } from "./test-fixtures"; import { type RaisedHandInfo, type ReactionInfo } from "../reactions"; import { constant } from "../state/Behavior"; @@ -131,6 +132,7 @@ export function getBasicRTCSession( export function getBasicCallViewModelEnvironment( members: RoomMember[], initialRtcMemberships: CallMembership[] = [localRtcMember, aliceRtcMember], + mediaDevicesOverride?: MediaDevices, callViewModelOptions: Partial = {}, ): { vm: CallViewModel; @@ -146,13 +148,11 @@ export function getBasicCallViewModelEnvironment( const handRaisedSubject$ = new BehaviorSubject({}); const reactionsSubject$ = new BehaviorSubject({}); - // const remoteParticipants$ = of([aliceParticipant]); - const vm = createCallViewModel$( testScope(), rtcSession.asMockedSession(), matrixRoom, - callViewModelOptions.mediaDeviceOverride ?? mockMediaDevices({}), + mediaDevicesOverride ?? mockMediaDevices({}), mockMuteStates(), { encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },