@@ -88,6 +88,7 @@ describe("actions", () => {
8888 roomName : null ,
8989 roomUrl : null ,
9090 userAgent : `core:${ coreVersion } ` ,
91+ remoteMediaOptions : { receiveAudio : true , receiveVideo : true } ,
9192 } ,
9293 } ,
9394 } ) ;
@@ -109,6 +110,46 @@ describe("actions", () => {
109110 } ) ;
110111 } ) ;
111112 } ) ;
113+
114+ describe ( "when remoteMediaOptions is set" , ( ) => {
115+ it ( "initializes the RtcManagerDispatcher with that feature" , ( ) => {
116+ const store = createStore ( {
117+ withSignalConnection : true ,
118+ initialState : {
119+ app : {
120+ displayName : null ,
121+ externalId : null ,
122+ ignoreBreakoutGroups : false ,
123+ isActive : false ,
124+ isAssistant : false ,
125+ isAudioRecorder : false ,
126+ isDialIn : false ,
127+ isNodeSdk : false ,
128+ roomName : null ,
129+ roomUrl : null ,
130+ userAgent : `core:${ coreVersion } ` ,
131+ remoteMediaOptions : { receiveAudio : true , receiveVideo : false } ,
132+ } ,
133+ } ,
134+ } ) ;
135+ const before = store . getState ( ) . rtcConnection ;
136+
137+ store . dispatch ( doConnectRtc ( ) ) ;
138+
139+ const after = store . getState ( ) . rtcConnection ;
140+
141+ expect ( RtcManagerDispatcher ) . toHaveBeenCalledTimes ( 1 ) ;
142+ expect ( RtcManagerDispatcher ) . toHaveBeenCalledWith (
143+ expect . objectContaining ( {
144+ features : expect . objectContaining ( { shouldReceiveMedia : { audio : true , video : false } } ) ,
145+ } ) ,
146+ ) ;
147+ expect ( diff ( before , after ) ) . toEqual ( {
148+ dispatcherCreated : true ,
149+ rtcManagerDispatcher : expect . any ( RtcManagerDispatcher ) ,
150+ } ) ;
151+ } ) ;
152+ } ) ;
112153 } ) ;
113154
114155 it ( "doDisconnectRtc" , ( ) => {
@@ -164,7 +205,12 @@ describe("actions", () => {
164205 store . dispatch ( doRtcManagerInitialize ( ) ) ;
165206
166207 expect ( mockRtcManager . addNewStream ) . toHaveBeenCalledTimes ( 1 ) ;
167- expect ( mockRtcManager . addNewStream ) . toHaveBeenCalledWith ( CAMERA_STREAM_ID , store . getState ( ) . localMedia . stream , true , true ) ;
208+ expect ( mockRtcManager . addNewStream ) . toHaveBeenCalledWith (
209+ CAMERA_STREAM_ID ,
210+ store . getState ( ) . localMedia . stream ,
211+ true ,
212+ true ,
213+ ) ;
168214 expect ( store . getState ( ) . rtcConnection . rtcManagerInitialized ) . toBe ( true ) ;
169215 } ) ;
170216} ) ;
0 commit comments