@webex/plugin-meetings 3.0.0-beta.140 → 3.0.0-beta.142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,8 @@ import {assert} from '@webex/test-helper-chai';
5
5
  import {getMaxFs} from '@webex/plugin-meetings/src/multistream/remoteMedia';
6
6
  import FakeTimers from '@sinonjs/fake-timers';
7
7
  import * as mediaCore from '@webex/internal-media-core';
8
+ import { assertFunction } from '@babel/types';
9
+ import { expect } from 'chai';
8
10
 
9
11
  type ExpectedActiveSpeaker = {
10
12
  policy: 'active-speaker';
@@ -79,7 +81,7 @@ describe('MediaRequestManager', () => {
79
81
  });
80
82
 
81
83
  // helper function for adding an active speaker request
82
- const addActiveSpeakerRequest = (priority, receiveSlots, maxFs, commit = false) =>
84
+ const addActiveSpeakerRequest = (priority, receiveSlots, maxFs, commit = false) =>
83
85
  mediaRequestManager.addRequest(
84
86
  {
85
87
  policyInfo: {
@@ -381,6 +383,26 @@ describe('MediaRequestManager', () => {
381
383
  ]);
382
384
  });
383
385
 
386
+ it('removes the events maxFsUpdate and sourceUpdate when cancelRequest() is called', async () => {
387
+
388
+ const requestId = addActiveSpeakerRequest(255, [fakeReceiveSlots[2], fakeReceiveSlots[3]], MAX_FS_720p);
389
+
390
+ mediaRequestManager.cancelRequest(requestId, true);
391
+
392
+ const sourceUpdateHandler = fakeReceiveSlots[2].off.getCall(0);
393
+
394
+ const maxFsHandlerCall = fakeReceiveSlots[2].off.getCall(1);
395
+
396
+ const maxFsEventName = maxFsHandlerCall.args[0];
397
+ const sourceUpdateEventName = sourceUpdateHandler.args[0];
398
+
399
+ expect(sourceUpdateHandler.args[1]).to.be.a('function');
400
+ expect(maxFsHandlerCall.args[1]).to.be.a('function');
401
+
402
+ assert.equal(maxFsEventName, 'maxFsUpdate')
403
+ assert.equal(sourceUpdateEventName, 'sourceUpdate')
404
+ });
405
+
384
406
  it('cancels the requests correctly when cancelRequest() is called with commit=true', () => {
385
407
  const requestIds = [
386
408
  addActiveSpeakerRequest(255, [fakeReceiveSlots[0], fakeReceiveSlots[1]], MAX_FS_720p),
@@ -1058,3 +1080,7 @@ describe('MediaRequestManager', () => {
1058
1080
  });
1059
1081
  });
1060
1082
  });
1083
+ function assertEqual(arg0: any, arg1: string) {
1084
+ throw new Error('Function not implemented.');
1085
+ }
1086
+