@webex/plugin-meetings 3.7.0 → 3.8.0
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.
- package/dist/annotation/annotation.types.d.ts +42 -0
- package/dist/annotation/constants.d.ts +31 -0
- package/dist/annotation/index.d.ts +117 -0
- package/dist/annotation/index.js +17 -0
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.d.ts +8 -0
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/collection.d.ts +5 -0
- package/dist/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/breakouts/events.d.ts +8 -0
- package/dist/breakouts/index.d.ts +5 -0
- package/dist/breakouts/index.js +1 -1
- package/dist/breakouts/request.d.ts +22 -0
- package/dist/breakouts/utils.d.ts +15 -0
- package/dist/common/browser-detection.d.ts +9 -0
- package/dist/common/collection.d.ts +48 -0
- package/dist/common/config.d.ts +2 -0
- package/dist/common/errors/captcha-error.d.ts +15 -0
- package/dist/common/errors/intent-to-join.d.ts +16 -0
- package/dist/common/errors/join-forbidden-error.js +52 -0
- package/dist/common/errors/join-forbidden-error.js.map +1 -0
- package/dist/common/errors/join-meeting.d.ts +17 -0
- package/dist/common/errors/{webinar-registration-error.js → join-webinar-error.js} +12 -12
- package/dist/common/errors/join-webinar-error.js.map +1 -0
- package/dist/common/errors/media.d.ts +15 -0
- package/dist/common/errors/multistream-not-supported-error.js +53 -0
- package/dist/common/errors/multistream-not-supported-error.js.map +1 -0
- package/dist/common/errors/no-meeting-info.d.ts +14 -0
- package/dist/common/errors/parameter.d.ts +15 -0
- package/dist/common/errors/password-error.d.ts +15 -0
- package/dist/common/errors/permission.d.ts +14 -0
- package/dist/common/errors/reclaim-host-role-error.js +149 -0
- package/dist/common/errors/reclaim-host-role-error.js.map +1 -0
- package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
- package/dist/common/errors/reconnection-in-progress.d.ts +9 -0
- package/dist/common/errors/reconnection-in-progress.js +33 -0
- package/dist/common/errors/reconnection-in-progress.js.map +1 -0
- package/dist/common/errors/reconnection.d.ts +15 -0
- package/dist/common/errors/stats.d.ts +15 -0
- package/dist/common/errors/webex-errors.d.ts +93 -0
- package/dist/common/errors/webex-meetings-error.d.ts +20 -0
- package/dist/common/events/events-scope.d.ts +17 -0
- package/dist/common/events/events.d.ts +12 -0
- package/dist/common/events/trigger-proxy.d.ts +2 -0
- package/dist/common/events/util.d.ts +2 -0
- package/dist/common/logs/logger-config.d.ts +2 -0
- package/dist/common/logs/logger-proxy.d.ts +2 -0
- package/dist/common/logs/request.d.ts +36 -0
- package/dist/common/queue.d.ts +34 -0
- package/dist/config.d.ts +72 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +1088 -0
- package/dist/constants.js +68 -6
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.d.ts +4 -0
- package/dist/controls-options-manager/enums.d.ts +15 -0
- package/dist/controls-options-manager/index.d.ts +136 -0
- package/dist/controls-options-manager/types.d.ts +43 -0
- package/dist/controls-options-manager/util.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.d.ts +2 -0
- package/dist/interceptors/locusRetry.d.ts +27 -0
- package/dist/interpretation/collection.d.ts +5 -0
- package/dist/interpretation/index.d.ts +5 -0
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.d.ts +5 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.d.ts +2 -0
- package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
- package/dist/locus-info/fullState.d.ts +2 -0
- package/dist/locus-info/hostUtils.d.ts +2 -0
- package/dist/locus-info/index.d.ts +322 -0
- package/dist/locus-info/index.js +14 -3
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.d.ts +2 -0
- package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
- package/dist/locus-info/parser.d.ts +272 -0
- package/dist/locus-info/selfUtils.d.ts +2 -0
- package/dist/locus-info/selfUtils.js +35 -17
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +1 -0
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.d.ts +34 -0
- package/dist/media/properties.d.ts +93 -0
- package/dist/media/properties.js +30 -16
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.d.ts +2 -0
- package/dist/mediaQualityMetrics/config.d.ts +241 -0
- package/dist/mediaQualityMetrics/config.js +502 -0
- package/dist/mediaQualityMetrics/config.js.map +1 -0
- package/dist/meeting/brbState.js +167 -0
- package/dist/meeting/brbState.js.map +1 -0
- package/dist/meeting/effectsState.js +260 -0
- package/dist/meeting/effectsState.js.map +1 -0
- package/dist/meeting/in-meeting-actions.d.ts +167 -0
- package/dist/meeting/in-meeting-actions.js +13 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.d.ts +1825 -0
- package/dist/meeting/index.js +1331 -1051
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.d.ts +74 -0
- package/dist/meeting/locusMediaRequest.js +11 -6
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.d.ts +178 -0
- package/dist/meeting/muteState.js +1 -6
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.d.ts +295 -0
- package/dist/meeting/request.js +51 -29
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.d.ts +11 -0
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/state.d.ts +9 -0
- package/dist/meeting/util.d.ts +119 -0
- package/dist/meeting/util.js +103 -67
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.d.ts +16 -0
- package/dist/meeting-info/collection.d.ts +20 -0
- package/dist/meeting-info/index.d.ts +69 -0
- package/dist/meeting-info/meeting-info-v2.d.ts +123 -0
- package/dist/meeting-info/meeting-info-v2.js +115 -45
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.d.ts +22 -0
- package/dist/meeting-info/util.d.ts +2 -0
- package/dist/meeting-info/utilv2.d.ts +2 -0
- package/dist/meeting-info/utilv2.js +6 -2
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.d.ts +40 -0
- package/dist/meetings/index.d.ts +390 -0
- package/dist/meetings/index.js +107 -55
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.d.ts +4 -0
- package/dist/meetings/meetings.types.js +2 -0
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.d.ts +27 -0
- package/dist/meetings/util.d.ts +18 -0
- package/dist/meetings/util.js +1 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.d.ts +160 -0
- package/dist/member/index.js +9 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/member.types.js +17 -0
- package/dist/member/member.types.js.map +1 -0
- package/dist/member/types.d.ts +32 -0
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.d.ts +2 -0
- package/dist/member/util.js +39 -28
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.d.ts +29 -0
- package/dist/members/index.d.ts +353 -0
- package/dist/members/request.d.ts +114 -0
- package/dist/members/types.d.ts +25 -0
- package/dist/members/util.d.ts +215 -0
- package/dist/members/util.js +4 -2
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +276 -0
- package/dist/metrics/config.js.map +1 -0
- package/dist/metrics/constants.d.ts +70 -0
- package/dist/metrics/constants.js +6 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.d.ts +45 -0
- package/dist/multistream/mediaRequestManager.d.ts +119 -0
- package/dist/multistream/receiveSlot.d.ts +68 -0
- package/dist/multistream/receiveSlotManager.d.ts +56 -0
- package/dist/multistream/remoteMedia.d.ts +72 -0
- package/dist/multistream/remoteMedia.js +30 -15
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.d.ts +49 -0
- package/dist/multistream/remoteMediaManager.d.ts +300 -0
- package/dist/multistream/sendSlotManager.d.ts +69 -0
- package/dist/multistream/sendSlotManager.js +24 -0
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.d.ts +70 -0
- package/dist/networkQualityMonitor/index.js +13 -19
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +671 -0
- package/dist/peer-connection-manager/index.js.map +1 -0
- package/dist/peer-connection-manager/util.js +109 -0
- package/dist/peer-connection-manager/util.js.map +1 -0
- package/dist/personal-meeting-room/index.d.ts +47 -0
- package/dist/personal-meeting-room/request.d.ts +14 -0
- package/dist/personal-meeting-room/util.d.ts +2 -0
- package/dist/reachability/clusterReachability.d.ts +109 -0
- package/dist/reachability/clusterReachability.js +12 -15
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.d.ts +105 -0
- package/dist/reachability/index.js +461 -136
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +7 -0
- package/dist/reachability/reachability.types.js.map +1 -0
- package/dist/reachability/request.d.ts +39 -0
- package/dist/reachability/request.js +21 -8
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.d.ts +8 -0
- package/dist/reactions/constants.d.ts +3 -0
- package/dist/reactions/reactions.d.ts +4 -0
- package/dist/reactions/reactions.type.d.ts +52 -0
- package/dist/reconnection-manager/index.d.ts +136 -0
- package/dist/recording-controller/enums.d.ts +7 -0
- package/dist/recording-controller/enums.js +8 -4
- package/dist/recording-controller/enums.js.map +1 -1
- package/dist/recording-controller/index.d.ts +207 -0
- package/dist/recording-controller/index.js +18 -9
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.d.ts +14 -0
- package/dist/recording-controller/util.js +13 -9
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/collection.js +62 -0
- package/dist/roap/collection.js.map +1 -0
- package/dist/roap/handler.js +275 -0
- package/dist/roap/handler.js.map +1 -0
- package/dist/roap/index.d.ts +86 -0
- package/dist/roap/index.js +15 -15
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.d.ts +39 -0
- package/dist/roap/request.js +45 -79
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js +126 -0
- package/dist/roap/state.js.map +1 -0
- package/dist/roap/turnDiscovery.d.ts +155 -0
- package/dist/roap/turnDiscovery.js +3 -6
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js +75 -0
- package/dist/roap/util.js.map +1 -0
- package/dist/rtcMetrics/constants.d.ts +4 -0
- package/dist/rtcMetrics/index.d.ts +61 -0
- package/dist/statsAnalyzer/global.d.ts +36 -0
- package/dist/statsAnalyzer/global.js +126 -0
- package/dist/statsAnalyzer/global.js.map +1 -0
- package/dist/statsAnalyzer/index.d.ts +217 -0
- package/dist/statsAnalyzer/index.js +1013 -0
- package/dist/statsAnalyzer/index.js.map +1 -0
- package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
- package/dist/statsAnalyzer/mqaUtil.js +179 -0
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -0
- package/dist/transcription/index.d.ts +64 -0
- package/dist/types/annotation/index.d.ts +5 -0
- package/dist/types/common/errors/join-forbidden-error.d.ts +15 -0
- package/dist/types/common/errors/{webinar-registration-error.d.ts → join-webinar-error.d.ts} +2 -2
- package/dist/types/common/errors/multistream-not-supported-error.d.ts +17 -0
- package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +53 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/locus-info/index.d.ts +2 -1
- package/dist/types/mediaQualityMetrics/config.d.ts +241 -0
- package/dist/types/meeting/brbState.d.ts +54 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +12 -0
- package/dist/types/meeting/index.d.ts +64 -14
- package/dist/types/meeting/locusMediaRequest.d.ts +6 -3
- package/dist/types/meeting/request.d.ts +14 -3
- package/dist/types/meeting/request.type.d.ts +6 -0
- package/dist/types/meeting/util.d.ts +3 -3
- package/dist/types/meeting-info/meeting-info-v2.d.ts +30 -5
- package/dist/types/meetings/index.d.ts +20 -2
- package/dist/types/meetings/meetings.types.d.ts +8 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +7 -0
- package/dist/types/members/util.d.ts +2 -0
- package/dist/types/metrics/constants.d.ts +6 -1
- package/dist/types/multistream/sendSlotManager.d.ts +8 -1
- package/dist/types/reachability/clusterReachability.d.ts +1 -10
- package/dist/types/reachability/index.d.ts +83 -36
- package/dist/types/reachability/reachability.types.d.ts +64 -0
- package/dist/types/reachability/request.d.ts +5 -1
- package/dist/types/recording-controller/enums.d.ts +5 -2
- package/dist/types/recording-controller/index.d.ts +1 -0
- package/dist/types/recording-controller/util.d.ts +2 -1
- package/dist/types/roap/request.d.ts +1 -13
- package/dist/types/statsAnalyzer/global.d.ts +36 -0
- package/dist/types/statsAnalyzer/index.d.ts +217 -0
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
- package/dist/webinar/collection.d.ts +16 -0
- package/dist/webinar/index.d.ts +5 -0
- package/dist/webinar/index.js +390 -7
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -22
- package/src/annotation/index.ts +16 -0
- package/src/common/errors/join-forbidden-error.ts +26 -0
- package/src/common/errors/join-webinar-error.ts +24 -0
- package/src/common/errors/multistream-not-supported-error.ts +30 -0
- package/src/config.ts +1 -0
- package/src/constants.ts +61 -3
- package/src/index.ts +5 -3
- package/src/locus-info/index.ts +20 -3
- package/src/locus-info/selfUtils.ts +24 -6
- package/src/media/MediaConnectionAwaiter.ts +2 -0
- package/src/media/properties.ts +34 -13
- package/src/meeting/brbState.ts +169 -0
- package/src/meeting/in-meeting-actions.ts +25 -0
- package/src/meeting/index.ts +443 -87
- package/src/meeting/locusMediaRequest.ts +11 -8
- package/src/meeting/muteState.ts +1 -6
- package/src/meeting/request.ts +30 -12
- package/src/meeting/request.type.ts +7 -0
- package/src/meeting/util.ts +32 -13
- package/src/meeting-info/meeting-info-v2.ts +83 -12
- package/src/meeting-info/utilv2.ts +17 -3
- package/src/meetings/index.ts +79 -20
- package/src/meetings/meetings.types.ts +10 -0
- package/src/meetings/util.ts +2 -1
- package/src/member/index.ts +9 -0
- package/src/member/types.ts +8 -0
- package/src/member/util.ts +34 -24
- package/src/members/util.ts +1 -0
- package/src/metrics/constants.ts +6 -1
- package/src/multistream/remoteMedia.ts +28 -15
- package/src/multistream/sendSlotManager.ts +31 -0
- package/src/reachability/clusterReachability.ts +5 -15
- package/src/reachability/index.ts +311 -75
- package/src/reachability/reachability.types.ts +85 -0
- package/src/reachability/request.ts +55 -31
- package/src/recording-controller/enums.ts +5 -2
- package/src/recording-controller/index.ts +17 -4
- package/src/recording-controller/util.ts +20 -5
- package/src/roap/index.ts +14 -13
- package/src/roap/request.ts +30 -44
- package/src/roap/turnDiscovery.ts +2 -4
- package/src/webinar/index.ts +235 -9
- package/test/unit/spec/annotation/index.ts +46 -1
- package/test/unit/spec/locus-info/index.js +292 -60
- package/test/unit/spec/locus-info/selfConstant.js +7 -0
- package/test/unit/spec/locus-info/selfUtils.js +101 -1
- package/test/unit/spec/media/properties.ts +15 -0
- package/test/unit/spec/meeting/brbState.ts +114 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +15 -1
- package/test/unit/spec/meeting/index.js +851 -107
- package/test/unit/spec/meeting/locusMediaRequest.ts +18 -11
- package/test/unit/spec/meeting/muteState.js +0 -24
- package/test/unit/spec/meeting/request.js +3 -26
- package/test/unit/spec/meeting/utils.js +73 -28
- package/test/unit/spec/meeting-info/meetinginfov2.js +46 -4
- package/test/unit/spec/meeting-info/utilv2.js +26 -0
- package/test/unit/spec/meetings/index.js +159 -18
- package/test/unit/spec/meetings/utils.js +10 -0
- package/test/unit/spec/member/util.js +52 -11
- package/test/unit/spec/members/utils.js +95 -0
- package/test/unit/spec/multistream/remoteMedia.ts +11 -7
- package/test/unit/spec/reachability/clusterReachability.ts +7 -0
- package/test/unit/spec/reachability/index.ts +383 -9
- package/test/unit/spec/reachability/request.js +48 -12
- package/test/unit/spec/recording-controller/index.js +61 -5
- package/test/unit/spec/recording-controller/util.js +39 -3
- package/test/unit/spec/roap/index.ts +48 -1
- package/test/unit/spec/roap/request.ts +51 -109
- package/test/unit/spec/roap/turnDiscovery.ts +202 -147
- package/test/unit/spec/webinar/index.ts +504 -0
- package/dist/common/errors/webinar-registration-error.js.map +0 -1
- package/src/common/errors/webinar-registration-error.ts +0 -27
@@ -1,6 +1,6 @@
|
|
1
1
|
import 'jsdom-global/register';
|
2
2
|
import sinon from 'sinon';
|
3
|
-
import {cloneDeep} from 'lodash';
|
3
|
+
import {cloneDeep, forEach} from 'lodash';
|
4
4
|
import {assert} from '@webex/test-helper-chai';
|
5
5
|
import MockWebex from '@webex/test-helper-mock-webex';
|
6
6
|
import testUtils from '../../../utils/testUtils';
|
@@ -9,6 +9,7 @@ import LocusInfo from '@webex/plugin-meetings/src/locus-info';
|
|
9
9
|
import SelfUtils from '@webex/plugin-meetings/src/locus-info/selfUtils';
|
10
10
|
import InfoUtils from '@webex/plugin-meetings/src/locus-info/infoUtils';
|
11
11
|
import EmbeddedAppsUtils from '@webex/plugin-meetings/src/locus-info/embeddedAppsUtils';
|
12
|
+
import MediaSharesUtils from '@webex/plugin-meetings/src/locus-info//mediaSharesUtils';
|
12
13
|
import LocusDeltaParser from '@webex/plugin-meetings/src/locus-info/parser';
|
13
14
|
import Metrics from '@webex/plugin-meetings/src/metrics';
|
14
15
|
|
@@ -22,6 +23,8 @@ import {
|
|
22
23
|
LOCUS,
|
23
24
|
MEETING_STATE,
|
24
25
|
_MEETING_,
|
26
|
+
_SIP_BRIDGE_,
|
27
|
+
_SPACE_SHARE_,
|
25
28
|
} from '../../../../src/constants';
|
26
29
|
|
27
30
|
import {self, selfWithInactivity} from './selfConstant';
|
@@ -101,7 +104,11 @@ describe('plugin-meetings', () => {
|
|
101
104
|
},
|
102
105
|
entryExitTone: {enabled: true, mode: 'foo'},
|
103
106
|
video: {enabled: true},
|
104
|
-
videoLayout: {
|
107
|
+
videoLayout: {
|
108
|
+
overrideDefault: true,
|
109
|
+
lockAttendeeViewOnStageOnly: false,
|
110
|
+
stageParameters: {},
|
111
|
+
},
|
105
112
|
webcastControl: {streaming: false},
|
106
113
|
practiceSession: {enabled: true},
|
107
114
|
};
|
@@ -528,7 +535,7 @@ describe('plugin-meetings', () => {
|
|
528
535
|
manualCaptionControl: {enabled: false},
|
529
536
|
};
|
530
537
|
|
531
|
-
locusInfo.updateControls({manualCaptionControl: {
|
538
|
+
locusInfo.updateControls({manualCaptionControl: {enabled: true}});
|
532
539
|
|
533
540
|
assert.calledWith(
|
534
541
|
locusInfo.emitScoped,
|
@@ -793,6 +800,75 @@ describe('plugin-meetings', () => {
|
|
793
800
|
});
|
794
801
|
|
795
802
|
describe('#updateSelf', () => {
|
803
|
+
it('should trigger SELF_MEETING_BRB_CHANGED when brb state changed', () => {
|
804
|
+
locusInfo.self = undefined;
|
805
|
+
|
806
|
+
const assertBrb = (enabled) => {
|
807
|
+
const selfWithBrbChanged = cloneDeep(self);
|
808
|
+
selfWithBrbChanged.controls.brb = enabled;
|
809
|
+
|
810
|
+
locusInfo.emitScoped = sinon.stub();
|
811
|
+
locusInfo.updateSelf(selfWithBrbChanged, []);
|
812
|
+
|
813
|
+
assert.calledWith(
|
814
|
+
locusInfo.emitScoped,
|
815
|
+
{file: 'locus-info', function: 'updateSelf'},
|
816
|
+
LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
|
817
|
+
{brb: enabled}
|
818
|
+
);
|
819
|
+
};
|
820
|
+
|
821
|
+
assertBrb(true);
|
822
|
+
assertBrb(false);
|
823
|
+
});
|
824
|
+
|
825
|
+
it('should not trigger SELF_MEETING_BRB_CHANGED when brb state did not change', () => {
|
826
|
+
const assertBrbUnchanged = (value) => {
|
827
|
+
locusInfo.self = undefined;
|
828
|
+
|
829
|
+
const selfWithBrbChanged = cloneDeep(self);
|
830
|
+
selfWithBrbChanged.controls.brb = value;
|
831
|
+
locusInfo.self = selfWithBrbChanged;
|
832
|
+
|
833
|
+
locusInfo.emitScoped = sinon.stub();
|
834
|
+
|
835
|
+
const newSelf = cloneDeep(self);
|
836
|
+
newSelf.controls.brb = value;
|
837
|
+
|
838
|
+
locusInfo.updateSelf(newSelf, []);
|
839
|
+
|
840
|
+
assert.neverCalledWith(
|
841
|
+
locusInfo.emitScoped,
|
842
|
+
{file: 'locus-info', function: 'updateSelf'},
|
843
|
+
LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
|
844
|
+
{brb: value}
|
845
|
+
);
|
846
|
+
};
|
847
|
+
|
848
|
+
assertBrbUnchanged(true);
|
849
|
+
assertBrbUnchanged(false);
|
850
|
+
});
|
851
|
+
|
852
|
+
it('should not trigger SELF_MEETING_BRB_CHANGED when brb state is undefined', () => {
|
853
|
+
const selfWithBrbChanged = cloneDeep(self);
|
854
|
+
selfWithBrbChanged.controls.brb = false;
|
855
|
+
locusInfo.self = selfWithBrbChanged;
|
856
|
+
|
857
|
+
locusInfo.emitScoped = sinon.stub();
|
858
|
+
|
859
|
+
const newSelf = cloneDeep(self);
|
860
|
+
newSelf.controls.brb = undefined;
|
861
|
+
|
862
|
+
locusInfo.updateSelf(newSelf, []);
|
863
|
+
|
864
|
+
assert.neverCalledWith(
|
865
|
+
locusInfo.emitScoped,
|
866
|
+
{file: 'locus-info', function: 'updateSelf'},
|
867
|
+
LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
|
868
|
+
{brb: undefined}
|
869
|
+
);
|
870
|
+
});
|
871
|
+
|
796
872
|
it('should trigger CONTROLS_MEETING_LAYOUT_UPDATED when the meeting layout controls change', () => {
|
797
873
|
const layoutType = 'EXAMPLE TYPE';
|
798
874
|
|
@@ -1388,6 +1464,30 @@ describe('plugin-meetings', () => {
|
|
1388
1464
|
}
|
1389
1465
|
);
|
1390
1466
|
});
|
1467
|
+
|
1468
|
+
it('should not trigger any events if controls is undefined', () => {
|
1469
|
+
locusInfo.self = self;
|
1470
|
+
locusInfo.emitScoped = sinon.stub();
|
1471
|
+
const newSelf = cloneDeep(self);
|
1472
|
+
newSelf.controls = undefined;
|
1473
|
+
|
1474
|
+
locusInfo.updateSelf(newSelf, []);
|
1475
|
+
|
1476
|
+
const eventsSet = new Set([
|
1477
|
+
LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED,
|
1478
|
+
LOCUSINFO.EVENTS.SELF_MEETING_BREAKOUTS_CHANGED,
|
1479
|
+
LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
|
1480
|
+
LOCUSINFO.EVENTS.SELF_MEETING_INTERPRETATION_CHANGED,
|
1481
|
+
LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUIRED,
|
1482
|
+
LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED,
|
1483
|
+
]);
|
1484
|
+
|
1485
|
+
// check all events that contain logic on controls existence
|
1486
|
+
locusInfo.emitScoped.getCalls().forEach((call) => {
|
1487
|
+
const eventName = call.args[1];
|
1488
|
+
assert.isFalse(eventsSet.has(eventName));
|
1489
|
+
});
|
1490
|
+
});
|
1391
1491
|
});
|
1392
1492
|
|
1393
1493
|
describe('#updateMeetingInfo', () => {
|
@@ -1637,6 +1737,134 @@ describe('plugin-meetings', () => {
|
|
1637
1737
|
});
|
1638
1738
|
});
|
1639
1739
|
|
1740
|
+
describe('#updateMediaShares', () => {
|
1741
|
+
let getMediaSharesSpy;
|
1742
|
+
|
1743
|
+
beforeEach(() => {
|
1744
|
+
// Spy on MediaSharesUtils.getMediaShares
|
1745
|
+
getMediaSharesSpy = sinon.stub(MediaSharesUtils, 'getMediaShares');
|
1746
|
+
|
1747
|
+
// Stub the emitScoped method to monitor its calls
|
1748
|
+
sinon.stub(locusInfo, 'emitScoped');
|
1749
|
+
});
|
1750
|
+
|
1751
|
+
afterEach(() => {
|
1752
|
+
getMediaSharesSpy.restore();
|
1753
|
+
locusInfo.emitScoped.restore();
|
1754
|
+
});
|
1755
|
+
|
1756
|
+
it('should update media shares and emit LOCUS_INFO_UPDATE_MEDIA_SHARES when mediaShares change', () => {
|
1757
|
+
const initialMediaShares = { audio: true, video: false };
|
1758
|
+
const newMediaShares = { audio: false, video: true };
|
1759
|
+
|
1760
|
+
locusInfo.mediaShares = initialMediaShares;
|
1761
|
+
locusInfo.parsedLocus = { mediaShares: null };
|
1762
|
+
|
1763
|
+
const parsedMediaShares = {
|
1764
|
+
current: newMediaShares,
|
1765
|
+
previous: initialMediaShares,
|
1766
|
+
};
|
1767
|
+
|
1768
|
+
// Stub MediaSharesUtils.getMediaShares to return the expected parsedMediaShares
|
1769
|
+
getMediaSharesSpy.returns(parsedMediaShares);
|
1770
|
+
|
1771
|
+
// Call the function
|
1772
|
+
locusInfo.updateMediaShares(newMediaShares);
|
1773
|
+
|
1774
|
+
// Assert that MediaSharesUtils.getMediaShares was called with correct arguments
|
1775
|
+
assert.calledWith(getMediaSharesSpy, initialMediaShares, newMediaShares);
|
1776
|
+
|
1777
|
+
// Assert that updateMeeting was called with the parsed current media shares
|
1778
|
+
assert.deepEqual(locusInfo.parsedLocus.mediaShares, newMediaShares);
|
1779
|
+
assert.deepEqual(locusInfo.mediaShares, newMediaShares);
|
1780
|
+
|
1781
|
+
// Assert that emitScoped was called with the correct event
|
1782
|
+
assert.calledWith(
|
1783
|
+
locusInfo.emitScoped,
|
1784
|
+
{
|
1785
|
+
file: 'locus-info',
|
1786
|
+
function: 'updateMediaShares',
|
1787
|
+
},
|
1788
|
+
EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES,
|
1789
|
+
{
|
1790
|
+
current: newMediaShares,
|
1791
|
+
previous: initialMediaShares,
|
1792
|
+
forceUpdate: false,
|
1793
|
+
}
|
1794
|
+
);
|
1795
|
+
});
|
1796
|
+
|
1797
|
+
it('should force update media shares and emit LOCUS_INFO_UPDATE_MEDIA_SHARES even if shares are the same', () => {
|
1798
|
+
const initialMediaShares = { audio: true, video: false };
|
1799
|
+
locusInfo.mediaShares = initialMediaShares;
|
1800
|
+
locusInfo.parsedLocus = { mediaShares: null };
|
1801
|
+
|
1802
|
+
const parsedMediaShares = {
|
1803
|
+
current: initialMediaShares,
|
1804
|
+
previous: initialMediaShares,
|
1805
|
+
};
|
1806
|
+
|
1807
|
+
getMediaSharesSpy.returns(parsedMediaShares);
|
1808
|
+
|
1809
|
+
// Call the function with forceUpdate = true
|
1810
|
+
locusInfo.updateMediaShares(initialMediaShares, true);
|
1811
|
+
|
1812
|
+
// Assert that MediaSharesUtils.getMediaShares was called
|
1813
|
+
assert.calledWith(getMediaSharesSpy, initialMediaShares, initialMediaShares);
|
1814
|
+
|
1815
|
+
// Assert that emitScoped was called with the correct event
|
1816
|
+
assert.calledWith(
|
1817
|
+
locusInfo.emitScoped,
|
1818
|
+
{
|
1819
|
+
file: 'locus-info',
|
1820
|
+
function: 'updateMediaShares',
|
1821
|
+
},
|
1822
|
+
EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES,
|
1823
|
+
{
|
1824
|
+
current: initialMediaShares,
|
1825
|
+
previous: initialMediaShares,
|
1826
|
+
forceUpdate: true,
|
1827
|
+
}
|
1828
|
+
);
|
1829
|
+
});
|
1830
|
+
|
1831
|
+
it('should not emit LOCUS_INFO_UPDATE_MEDIA_SHARES if mediaShares do not change and forceUpdate is false', () => {
|
1832
|
+
const initialMediaShares = { audio: true, video: false };
|
1833
|
+
locusInfo.mediaShares = initialMediaShares;
|
1834
|
+
|
1835
|
+
// Call the function with the same mediaShares and forceUpdate = false
|
1836
|
+
locusInfo.updateMediaShares(initialMediaShares);
|
1837
|
+
|
1838
|
+
// Assert that MediaSharesUtils.getMediaShares was not called
|
1839
|
+
assert.notCalled(getMediaSharesSpy);
|
1840
|
+
|
1841
|
+
// Assert that emitScoped was not called
|
1842
|
+
assert.notCalled(locusInfo.emitScoped);
|
1843
|
+
});
|
1844
|
+
|
1845
|
+
it('should update internal state correctly when mediaShares are updated', () => {
|
1846
|
+
const initialMediaShares = { audio: true, video: false };
|
1847
|
+
const newMediaShares = { audio: false, video: true };
|
1848
|
+
|
1849
|
+
locusInfo.mediaShares = initialMediaShares;
|
1850
|
+
locusInfo.parsedLocus = { mediaShares: null };
|
1851
|
+
|
1852
|
+
const parsedMediaShares = {
|
1853
|
+
current: newMediaShares,
|
1854
|
+
previous: initialMediaShares,
|
1855
|
+
};
|
1856
|
+
|
1857
|
+
getMediaSharesSpy.returns(parsedMediaShares);
|
1858
|
+
|
1859
|
+
// Call the function
|
1860
|
+
locusInfo.updateMediaShares(newMediaShares);
|
1861
|
+
|
1862
|
+
// Assert that the internal state was updated correctly
|
1863
|
+
assert.deepEqual(locusInfo.parsedLocus.mediaShares, newMediaShares);
|
1864
|
+
assert.deepEqual(locusInfo.mediaShares, newMediaShares);
|
1865
|
+
});
|
1866
|
+
});
|
1867
|
+
|
1640
1868
|
describe('#updateEmbeddedApps()', () => {
|
1641
1869
|
const newEmbeddedApps = [
|
1642
1870
|
{
|
@@ -2414,65 +2642,69 @@ describe('plugin-meetings', () => {
|
|
2414
2642
|
});
|
2415
2643
|
|
2416
2644
|
describe('#isMeetingActive', () => {
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2438
|
-
|
2439
|
-
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
|
2440
|
-
locusInfo.parsedLocus = {
|
2441
|
-
fullState: {
|
2442
|
-
type: _CALL_,
|
2443
|
-
},
|
2444
|
-
self: {
|
2445
|
-
state: MEETING_STATE.STATES.DECLINED,
|
2446
|
-
},
|
2447
|
-
};
|
2448
|
-
locusInfo.isMeetingActive();
|
2449
|
-
|
2450
|
-
assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
|
2451
|
-
name: 'client.call.remote-ended',
|
2452
|
-
options: {
|
2453
|
-
meetingId: locusInfo.meetingId,
|
2454
|
-
},
|
2455
|
-
});
|
2456
|
-
});
|
2457
|
-
|
2458
|
-
it('sends client event correctly for state = SELF_LEFT', () => {
|
2459
|
-
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
|
2460
|
-
locusInfo.parsedLocus = {
|
2461
|
-
fullState: {
|
2462
|
-
type: _CALL_,
|
2463
|
-
},
|
2464
|
-
self: {
|
2465
|
-
state: MEETING_STATE.STATES.LEFT,
|
2466
|
-
},
|
2467
|
-
};
|
2645
|
+
forEach([_CALL_, _SIP_BRIDGE_, _SPACE_SHARE_], (type) => {
|
2646
|
+
describe(`type = ${type}`, () => {
|
2647
|
+
it('sends client event correctly for state = inactive', () => {
|
2648
|
+
locusInfo.parsedLocus = {
|
2649
|
+
fullState: {
|
2650
|
+
type: type,
|
2651
|
+
},
|
2652
|
+
};
|
2653
|
+
|
2654
|
+
locusInfo.fullState = {
|
2655
|
+
state: LOCUS.STATE.INACTIVE,
|
2656
|
+
};
|
2657
|
+
|
2658
|
+
locusInfo.isMeetingActive();
|
2659
|
+
|
2660
|
+
assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
|
2661
|
+
name: 'client.call.remote-ended',
|
2662
|
+
options: {
|
2663
|
+
meetingId: locusInfo.meetingId,
|
2664
|
+
},
|
2665
|
+
});
|
2666
|
+
});
|
2468
2667
|
|
2469
|
-
|
2668
|
+
it('sends client event correctly for state = PARTNER_LEFT', () => {
|
2669
|
+
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
|
2670
|
+
locusInfo.parsedLocus = {
|
2671
|
+
fullState: {
|
2672
|
+
type: type,
|
2673
|
+
},
|
2674
|
+
self: {
|
2675
|
+
state: MEETING_STATE.STATES.DECLINED,
|
2676
|
+
},
|
2677
|
+
};
|
2678
|
+
locusInfo.isMeetingActive();
|
2679
|
+
|
2680
|
+
assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
|
2681
|
+
name: 'client.call.remote-ended',
|
2682
|
+
options: {
|
2683
|
+
meetingId: locusInfo.meetingId,
|
2684
|
+
},
|
2685
|
+
});
|
2686
|
+
});
|
2470
2687
|
|
2471
|
-
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2688
|
+
it('sends client event correctly for state = SELF_LEFT', () => {
|
2689
|
+
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
|
2690
|
+
locusInfo.parsedLocus = {
|
2691
|
+
fullState: {
|
2692
|
+
type: type,
|
2693
|
+
},
|
2694
|
+
self: {
|
2695
|
+
state: MEETING_STATE.STATES.LEFT,
|
2696
|
+
},
|
2697
|
+
};
|
2698
|
+
|
2699
|
+
locusInfo.isMeetingActive();
|
2700
|
+
|
2701
|
+
assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
|
2702
|
+
name: 'client.call.remote-ended',
|
2703
|
+
options: {
|
2704
|
+
meetingId: locusInfo.meetingId,
|
2705
|
+
},
|
2706
|
+
});
|
2707
|
+
});
|
2476
2708
|
});
|
2477
2709
|
});
|
2478
2710
|
|
@@ -304,6 +304,13 @@ export const selfWithInactivity = {
|
|
304
304
|
localRecord: {
|
305
305
|
recording: false,
|
306
306
|
},
|
307
|
+
brb: {
|
308
|
+
enabled: true,
|
309
|
+
meta: {
|
310
|
+
lastModified: '2024-10-24T14:05:58.526Z',
|
311
|
+
modifiedBy: '70978427-8238-4ffc-9227-8baf4b80b831',
|
312
|
+
},
|
313
|
+
},
|
307
314
|
layouts: [
|
308
315
|
{
|
309
316
|
type: 'activePresence',
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
2
2
|
import Sinon from 'sinon';
|
3
|
-
import {cloneDeep} from 'lodash';
|
3
|
+
import {cloneDeep, defaultsDeep} from 'lodash';
|
4
4
|
import SelfUtils from '@webex/plugin-meetings/src/locus-info/selfUtils';
|
5
5
|
|
6
6
|
import {self} from './selfConstant';
|
7
|
+
import {_IDLE_, _WAIT_} from '@webex/plugin-meetings/src/constants';
|
7
8
|
|
8
9
|
describe('plugin-meetings', () => {
|
9
10
|
describe('selfUtils', () => {
|
@@ -60,6 +61,14 @@ describe('plugin-meetings', () => {
|
|
60
61
|
assert.calledWith(spy, self);
|
61
62
|
assert.deepEqual(parsedSelf.layout, self.controls.layouts[0].type);
|
62
63
|
});
|
64
|
+
|
65
|
+
it('calls getBrb and returns the resulting brb value', () => {
|
66
|
+
const spy = Sinon.spy(SelfUtils, 'getBrb');
|
67
|
+
const parsedSelf = SelfUtils.parse(self);
|
68
|
+
|
69
|
+
assert.calledWith(spy, self);
|
70
|
+
assert.deepEqual(parsedSelf.brb, self.controls.brb);
|
71
|
+
});
|
63
72
|
});
|
64
73
|
|
65
74
|
describe('getLayout', () => {
|
@@ -170,6 +179,37 @@ describe('plugin-meetings', () => {
|
|
170
179
|
});
|
171
180
|
});
|
172
181
|
|
182
|
+
describe('brbChanged', () => {
|
183
|
+
it('should return true if brb have changed', () => {
|
184
|
+
const current = {
|
185
|
+
brb: {enabled: true},
|
186
|
+
};
|
187
|
+
const previous = {
|
188
|
+
brb: {enabled: false},
|
189
|
+
};
|
190
|
+
|
191
|
+
assert.isTrue(SelfUtils.brbChanged(previous, current));
|
192
|
+
});
|
193
|
+
|
194
|
+
it('should return false if brb have not changed', () => {
|
195
|
+
const current = {
|
196
|
+
brb: {enabled: true},
|
197
|
+
};
|
198
|
+
const previous = {
|
199
|
+
brb: {enabled: true},
|
200
|
+
};
|
201
|
+
|
202
|
+
assert.isFalse(SelfUtils.brbChanged(previous, current));
|
203
|
+
});
|
204
|
+
|
205
|
+
it('should return false if brb in current is undefined', () => {
|
206
|
+
const current = {};
|
207
|
+
const previous = {brb: {enabled: true}};
|
208
|
+
|
209
|
+
assert.isFalse(SelfUtils.brbChanged(previous, current));
|
210
|
+
});
|
211
|
+
});
|
212
|
+
|
173
213
|
describe('canNotViewTheParticipantList', () => {
|
174
214
|
it('should return the correct value', () => {
|
175
215
|
assert.equal(
|
@@ -299,6 +339,56 @@ describe('plugin-meetings', () => {
|
|
299
339
|
assert.equal(updates.localAudioUnmuteRequestedByServer, false);
|
300
340
|
});
|
301
341
|
});
|
342
|
+
|
343
|
+
describe('updates.isUserUnadmitted', () => {
|
344
|
+
const testIsUserUnadmitted = (previousObjectDelta, currentObjectDelta, expected) => function () {
|
345
|
+
const previous =
|
346
|
+
previousObjectDelta === undefined ? undefined : defaultsDeep(previousObjectDelta, self);
|
347
|
+
const current = defaultsDeep(currentObjectDelta, self);
|
348
|
+
|
349
|
+
const {updates} = SelfUtils.getSelves(previous, current, self.devices[0].url);
|
350
|
+
|
351
|
+
assert.equal(updates.isUserUnadmitted, expected);
|
352
|
+
};
|
353
|
+
|
354
|
+
it(
|
355
|
+
'should return true when previous is undefined and current is in lobby',
|
356
|
+
testIsUserUnadmitted(
|
357
|
+
undefined,
|
358
|
+
{devices: [{intent: {type: _WAIT_}}], state: _IDLE_},
|
359
|
+
true
|
360
|
+
)
|
361
|
+
);
|
362
|
+
|
363
|
+
it(
|
364
|
+
'should return false when previous is undefined and user is not in meeting',
|
365
|
+
testIsUserUnadmitted(undefined, {devices: [], state: _IDLE_}, false)
|
366
|
+
);
|
367
|
+
|
368
|
+
it(
|
369
|
+
'should return false when previous is undefined and current is in meeting',
|
370
|
+
testIsUserUnadmitted(undefined, {}, false)
|
371
|
+
);
|
372
|
+
|
373
|
+
it(
|
374
|
+
'should return false when previous is in lobby and current is in lobby',
|
375
|
+
testIsUserUnadmitted(
|
376
|
+
{devices: [{intent: {type: _WAIT_}}], state: _IDLE_},
|
377
|
+
{devices: [{intent: {type: _WAIT_}}], state: _IDLE_},
|
378
|
+
false
|
379
|
+
)
|
380
|
+
);
|
381
|
+
|
382
|
+
it(
|
383
|
+
'should return false when previous is in lobby and current is in meeting',
|
384
|
+
testIsUserUnadmitted({devices: [{intent: {type: _WAIT_}}], state: _IDLE_}, {}, false)
|
385
|
+
);
|
386
|
+
|
387
|
+
it(
|
388
|
+
'should return true when previous is in meeting and current is in lobby',
|
389
|
+
testIsUserUnadmitted({}, {devices: [{intent: {type: _WAIT_}}], state: _IDLE_}, true)
|
390
|
+
);
|
391
|
+
});
|
302
392
|
});
|
303
393
|
|
304
394
|
describe('isSharingBlocked', () => {
|
@@ -360,6 +450,16 @@ describe('plugin-meetings', () => {
|
|
360
450
|
assert.equal(SelfUtils.mutedByOthersChanged(null, {remoteMuted: true}), true);
|
361
451
|
});
|
362
452
|
|
453
|
+
it('should return false when selfIdentity and modifiedBy are the same', function () {
|
454
|
+
assert.equal(
|
455
|
+
SelfUtils.mutedByOthersChanged(
|
456
|
+
{remoteMuted: false},
|
457
|
+
{remoteMuted: true, selfIdentity: 'user1', modifiedBy: 'user1'}
|
458
|
+
),
|
459
|
+
false
|
460
|
+
);
|
461
|
+
});
|
462
|
+
|
363
463
|
it('should return true when remoteMuted values are different', function () {
|
364
464
|
assert.equal(
|
365
465
|
SelfUtils.mutedByOthersChanged(
|
@@ -66,6 +66,21 @@ describe('MediaProperties', () => {
|
|
66
66
|
assert.equal(numTransports, 0);
|
67
67
|
});
|
68
68
|
|
69
|
+
it('handles time out in the case when getStats() is not resolving', async () => {
|
70
|
+
// Promise that never resolves
|
71
|
+
mockMC.getStats = new Promise(() => {});
|
72
|
+
|
73
|
+
const promise = mediaProperties.getCurrentConnectionInfo();
|
74
|
+
|
75
|
+
await clock.tickAsync(1000);
|
76
|
+
|
77
|
+
const {connectionType, selectedCandidatePairChanges, numTransports} = await promise;
|
78
|
+
|
79
|
+
assert.equal(connectionType, 'unknown');
|
80
|
+
assert.equal(selectedCandidatePairChanges, -1);
|
81
|
+
assert.equal(numTransports, 0);
|
82
|
+
});
|
83
|
+
|
69
84
|
describe('selectedCandidatePairChanges and numTransports', () => {
|
70
85
|
it('returns correct values when getStats() returns no transport stats at all', async () => {
|
71
86
|
mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
|
@@ -0,0 +1,114 @@
|
|
1
|
+
import sinon from 'sinon';
|
2
|
+
import {assert} from '@webex/test-helper-chai';
|
3
|
+
|
4
|
+
import testUtils from '../../../utils/testUtils';
|
5
|
+
import {BrbState, createBrbState} from '@webex/plugin-meetings/src/meeting/brbState';
|
6
|
+
|
7
|
+
describe('plugin-meetings', () => {
|
8
|
+
let meeting: any;
|
9
|
+
let brbState: BrbState;
|
10
|
+
|
11
|
+
beforeEach(async () => {
|
12
|
+
meeting = {
|
13
|
+
isMultistream: true,
|
14
|
+
locusUrl: 'locus url',
|
15
|
+
deviceUrl: 'device url',
|
16
|
+
selfId: 'self id',
|
17
|
+
mediaProperties: {
|
18
|
+
webrtcMediaConnection: true,
|
19
|
+
},
|
20
|
+
sendSlotManager: {
|
21
|
+
setSourceStateOverride: sinon.stub(),
|
22
|
+
},
|
23
|
+
meetingRequest: {
|
24
|
+
setBrb: sinon.stub().resolves(),
|
25
|
+
},
|
26
|
+
};
|
27
|
+
|
28
|
+
brbState = new BrbState(meeting, false);
|
29
|
+
await testUtils.flushPromises();
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('brbState library', () => {
|
33
|
+
it('takes into account current status when instantiated', async () => {
|
34
|
+
// create a new BrbState instance
|
35
|
+
brbState = createBrbState(meeting, true);
|
36
|
+
await testUtils.flushPromises();
|
37
|
+
|
38
|
+
assert.isTrue(brbState.state.client.enabled);
|
39
|
+
|
40
|
+
// now check the opposite case
|
41
|
+
brbState = createBrbState(meeting, false);
|
42
|
+
await testUtils.flushPromises();
|
43
|
+
|
44
|
+
assert.isFalse(brbState.state.client.enabled);
|
45
|
+
});
|
46
|
+
|
47
|
+
it('can be enabled', async () => {
|
48
|
+
brbState.enable(true, meeting.sendSlotManager);
|
49
|
+
brbState.handleServerBrbUpdate(true);
|
50
|
+
await testUtils.flushPromises();
|
51
|
+
|
52
|
+
assert.isTrue(brbState.state.client.enabled);
|
53
|
+
assert.isTrue(brbState.state.server.enabled);
|
54
|
+
});
|
55
|
+
|
56
|
+
it('can be disabled', async () => {
|
57
|
+
brbState.enable(false, meeting.sendSlotManager);
|
58
|
+
brbState.handleServerBrbUpdate(false);
|
59
|
+
await testUtils.flushPromises();
|
60
|
+
|
61
|
+
assert.isFalse(brbState.state.client.enabled);
|
62
|
+
assert.isFalse(brbState.state.server.enabled);
|
63
|
+
});
|
64
|
+
|
65
|
+
it('does not send local brb state to server if it is not a multistream meeting', async () => {
|
66
|
+
meeting.isMultistream = false;
|
67
|
+
brbState.enable(true, meeting.sendSlotManager);
|
68
|
+
brbState.handleServerBrbUpdate(true);
|
69
|
+
await testUtils.flushPromises();
|
70
|
+
|
71
|
+
assert.isTrue(meeting.meetingRequest.setBrb.notCalled);
|
72
|
+
});
|
73
|
+
|
74
|
+
it('does not send local brb state to server if webrtc media connection is not defined', async () => {
|
75
|
+
meeting.mediaProperties.webrtcMediaConnection = undefined;
|
76
|
+
brbState.enable(true, meeting.sendSlotManager);
|
77
|
+
brbState.handleServerBrbUpdate(true);
|
78
|
+
await testUtils.flushPromises();
|
79
|
+
|
80
|
+
assert.isTrue(meeting.meetingRequest.setBrb.notCalled);
|
81
|
+
});
|
82
|
+
|
83
|
+
it('does not send request twice when in progress', async () => {
|
84
|
+
brbState.state.syncToServerInProgress = true;
|
85
|
+
brbState.enable(true, meeting.sendSlotManager);
|
86
|
+
await testUtils.flushPromises();
|
87
|
+
|
88
|
+
assert.isTrue(meeting.meetingRequest.setBrb.notCalled);
|
89
|
+
});
|
90
|
+
|
91
|
+
it('syncs with server when client state does not match server state', async () => {
|
92
|
+
brbState.enable(true, meeting.sendSlotManager);
|
93
|
+
brbState.handleServerBrbUpdate(true);
|
94
|
+
await testUtils.flushPromises();
|
95
|
+
|
96
|
+
assert.isTrue(meeting.meetingRequest.setBrb.calledOnce);
|
97
|
+
});
|
98
|
+
|
99
|
+
it('sets source state override when client state does not match server state', async () => {
|
100
|
+
brbState.enable(true, meeting.sendSlotManager);
|
101
|
+
brbState.handleServerBrbUpdate(true);
|
102
|
+
await testUtils.flushPromises();
|
103
|
+
|
104
|
+
assert.isTrue(meeting.sendSlotManager.setSourceStateOverride.calledOnce);
|
105
|
+
});
|
106
|
+
|
107
|
+
it('handles server update', async () => {
|
108
|
+
brbState.handleServerBrbUpdate(true);
|
109
|
+
await testUtils.flushPromises();
|
110
|
+
|
111
|
+
assert.isTrue(brbState.state.server.enabled);
|
112
|
+
});
|
113
|
+
});
|
114
|
+
});
|