@@ -1251,39 +1251,47 @@ describe("WebRTCAdaptor", function() {
12511251 describe ( "turnOffLocalCamera" , ( ) => {
12521252 let adaptor ;
12531253 let mockMediaManager ;
1254+ let turnOffEffectCameraFake ;
12541255
12551256 beforeEach ( function ( ) {
12561257 mockMediaManager = {
12571258 turnOffLocalCamera : sinon . fake ( )
12581259 } ;
12591260
1261+ turnOffEffectCameraFake = sinon . fake ( ) ;
1262+
12601263 adaptor = new WebRTCAdaptor ( {
12611264 websocketURL : "ws://example.com" ,
12621265 isPlayMode : true ,
1263- mediaManager : mockMediaManager ,
1264- initializeComponents : false
1266+ mediaManager : mockMediaManager ,
1267+ initializeComponents : false
12651268 } ) ;
1269+ adaptor . turnOffEffectCamera = turnOffEffectCameraFake ;
12661270 } ) ;
12671271
12681272 it ( "should call turnOffLocalCamera on mediaManager with correct streamId" , function ( ) {
12691273 const streamId = "testStreamId" ;
12701274 let result = adaptor . turnOffLocalCamera ( streamId ) ;
12711275 assert . notEqual ( result , undefined ) ;
1276+ assert ( turnOffEffectCameraFake . calledOnceWithExactly ( streamId ) ) ;
12721277 } ) ;
12731278
12741279 it ( "should handle undefined streamId" , function ( ) {
12751280 let result = adaptor . turnOffLocalCamera ( undefined ) ;
12761281 assert . notEqual ( result , undefined ) ;
1282+ assert ( turnOffEffectCameraFake . calledOnceWithExactly ( undefined ) ) ;
12771283 } ) ;
12781284
12791285 it ( "should handle null streamId" , function ( ) {
12801286 let result = adaptor . turnOffLocalCamera ( null ) ;
12811287 assert . notEqual ( result , undefined ) ;
1288+ assert ( turnOffEffectCameraFake . calledOnceWithExactly ( null ) ) ;
12821289 } ) ;
12831290
12841291 it ( "should handle empty string streamId" , function ( ) {
12851292 let result = adaptor . turnOffLocalCamera ( "" ) ;
12861293 assert . notEqual ( result , undefined ) ;
1294+ assert ( turnOffEffectCameraFake . calledOnceWithExactly ( "" ) ) ;
12871295 } ) ;
12881296 } ) ;
12891297
0 commit comments