@webex/plugin-meetings 2.36.1 → 2.37.1
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/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/common/browser-detection.js +1 -20
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +5 -20
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +0 -7
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -26
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -26
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -27
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -26
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -33
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -26
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -25
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js +0 -17
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -26
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -26
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +7 -46
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +1 -24
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +0 -22
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +0 -23
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +0 -12
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +0 -15
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +0 -4
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -8
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +35 -61
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +4 -14
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/constants.js +46 -42
- package/dist/constants.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +10 -28
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -26
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +0 -15
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +4 -12
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +101 -193
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +0 -37
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +12 -38
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +87 -123
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +16 -81
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +74 -137
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +64 -110
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +3 -17
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +10 -12
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +120 -192
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +0 -13
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +812 -1487
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +31 -78
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +157 -227
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js +21 -31
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +25 -169
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +3 -25
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +10 -33
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +179 -268
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -16
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +98 -183
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +137 -228
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +3 -21
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +451 -570
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +7 -30
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +94 -148
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +49 -89
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +17 -68
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +2 -12
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +68 -184
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +21 -56
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +9 -38
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +0 -2
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js +1 -2
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +48 -136
- package/dist/metrics/index.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +28 -57
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +60 -190
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/peer-connection-manager/util.js +10 -24
- package/dist/peer-connection-manager/util.js.map +1 -1
- package/dist/personal-meeting-room/index.js +10 -45
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -33
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +0 -13
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +100 -166
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +2 -18
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js +0 -2
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +0 -5
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +294 -468
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/collection.js +1 -12
- package/dist/roap/collection.js.map +1 -1
- package/dist/roap/handler.js +15 -85
- package/dist/roap/handler.js.map +1 -1
- package/dist/roap/index.js +42 -94
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +81 -148
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js +2 -39
- package/dist/roap/state.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -52
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js +0 -26
- package/dist/roap/util.js.map +1 -1
- package/dist/statsAnalyzer/global.js +0 -2
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +68 -168
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +54 -53
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +13 -45
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +17 -17
- package/src/common/browser-detection.ts +9 -6
- package/src/common/collection.ts +3 -1
- package/src/common/errors/captcha-error.ts +6 -6
- package/src/common/errors/intent-to-join.ts +6 -6
- package/src/common/errors/join-meeting.ts +12 -8
- package/src/common/errors/media.ts +6 -6
- package/src/common/errors/parameter.ts +9 -6
- package/src/common/errors/password-error.ts +6 -6
- package/src/common/errors/permission.ts +5 -5
- package/src/common/errors/reconnection.ts +6 -6
- package/src/common/errors/stats.ts +6 -6
- package/src/common/errors/webex-errors.ts +7 -5
- package/src/common/errors/webex-meetings-error.ts +1 -1
- package/src/common/events/events-scope.ts +5 -1
- package/src/common/events/events.ts +5 -1
- package/src/common/events/trigger-proxy.ts +8 -3
- package/src/common/events/util.ts +1 -2
- package/src/common/logs/logger-proxy.ts +21 -10
- package/src/common/logs/request.ts +11 -8
- package/src/config.ts +11 -11
- package/src/constants.ts +138 -119
- package/src/index.js +1 -1
- package/src/locus-info/controlsUtils.ts +34 -24
- package/src/locus-info/fullState.ts +15 -11
- package/src/locus-info/hostUtils.ts +4 -3
- package/src/locus-info/index.ts +25 -34
- package/src/locus-info/infoUtils.ts +12 -4
- package/src/locus-info/mediaSharesUtils.ts +4 -4
- package/src/locus-info/parser.ts +45 -68
- package/src/locus-info/selfUtils.ts +106 -57
- package/src/media/index.ts +118 -109
- package/src/media/properties.ts +26 -20
- package/src/media/util.ts +2 -2
- package/src/mediaQualityMetrics/config.ts +46 -46
- package/src/meeting/effectsState.ts +35 -35
- package/src/meeting/in-meeting-actions.ts +7 -3
- package/src/meeting/index.ts +1435 -1210
- package/src/meeting/muteState.ts +62 -31
- package/src/meeting/request.ts +160 -113
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +131 -90
- package/src/meeting-info/collection.ts +2 -1
- package/src/meeting-info/index.ts +32 -30
- package/src/meeting-info/meeting-info-v2.ts +106 -108
- package/src/meeting-info/request.ts +9 -3
- package/src/meeting-info/util.ts +54 -46
- package/src/meeting-info/utilv2.ts +59 -53
- package/src/meetings/collection.ts +1 -1
- package/src/meetings/index.ts +513 -441
- package/src/meetings/request.ts +26 -24
- package/src/meetings/util.ts +26 -23
- package/src/member/index.ts +55 -49
- package/src/member/util.ts +26 -13
- package/src/members/collection.ts +0 -1
- package/src/members/index.ts +172 -121
- package/src/members/request.ts +46 -14
- package/src/members/util.ts +44 -42
- package/src/metrics/config.ts +254 -81
- package/src/metrics/constants.ts +0 -2
- package/src/metrics/index.ts +84 -71
- package/src/networkQualityMonitor/index.ts +20 -23
- package/src/peer-connection-manager/index.ts +321 -241
- package/src/peer-connection-manager/util.ts +4 -2
- package/src/personal-meeting-room/index.ts +12 -16
- package/src/personal-meeting-room/request.ts +10 -3
- package/src/personal-meeting-room/util.ts +3 -3
- package/src/reachability/index.ts +61 -59
- package/src/reachability/request.ts +36 -32
- package/src/reactions/reactions.ts +4 -4
- package/src/reactions/reactions.type.ts +2 -3
- package/src/reconnection-manager/index.ts +159 -98
- package/src/roap/collection.ts +2 -4
- package/src/roap/handler.ts +63 -32
- package/src/roap/index.ts +78 -58
- package/src/roap/request.ts +69 -54
- package/src/roap/state.ts +17 -11
- package/src/roap/turnDiscovery.ts +60 -31
- package/src/roap/util.ts +39 -31
- package/src/statsAnalyzer/global.ts +30 -33
- package/src/statsAnalyzer/index.ts +397 -169
- package/src/statsAnalyzer/mqaUtil.ts +178 -72
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/journey.js +666 -462
- package/test/integration/spec/space-meeting.js +318 -203
- package/test/integration/spec/transcription.js +6 -7
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/fixture/locus.js +92 -90
- package/test/unit/spec/locus-info/controlsUtils.js +5 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +24 -31
- package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
- package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus-info/parser.js +3 -9
- package/test/unit/spec/locus-info/selfConstant.js +72 -103
- package/test/unit/spec/locus-info/selfUtils.js +21 -12
- package/test/unit/spec/meeting/effectsState.js +33 -45
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
- package/test/unit/spec/meeting/index.js +1141 -649
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +56 -45
- package/test/unit/spec/meeting/utils.js +66 -49
- package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
- package/test/unit/spec/meeting-info/request.js +7 -9
- package/test/unit/spec/meeting-info/util.js +11 -12
- package/test/unit/spec/meeting-info/utilv2.js +110 -74
- package/test/unit/spec/meetings/collection.js +1 -1
- package/test/unit/spec/meetings/index.js +438 -257
- package/test/unit/spec/meetings/utils.js +14 -12
- package/test/unit/spec/member/index.js +0 -1
- package/test/unit/spec/member/util.js +5 -6
- package/test/unit/spec/members/index.js +84 -35
- package/test/unit/spec/members/request.js +29 -20
- package/test/unit/spec/members/utils.js +8 -5
- package/test/unit/spec/metrics/index.js +16 -21
- package/test/unit/spec/networkQualityMonitor/index.js +21 -15
- package/test/unit/spec/peerconnection-manager/index.js +88 -58
- package/test/unit/spec/peerconnection-manager/utils.js +5 -4
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +7 -8
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +9 -11
- package/test/unit/spec/reconnection-manager/index.js +14 -17
- package/test/unit/spec/roap/index.ts +18 -8
- package/test/unit/spec/roap/turnDiscovery.ts +22 -19
- package/test/unit/spec/roap/util.js +3 -3
- package/test/unit/spec/stats-analyzer/index.js +29 -24
- package/test/utils/cmr.js +44 -42
- package/test/utils/testUtils.js +83 -74
- package/test/utils/webex-config.js +18 -18
- package/test/utils/webex-test-users.js +53 -50
|
@@ -19,17 +19,17 @@ describe('plugin-meetings', () => {
|
|
|
19
19
|
meeting = {
|
|
20
20
|
mediaProperties: {
|
|
21
21
|
audioTrack: 'fake audio track',
|
|
22
|
-
videoTrack: 'fake video track'
|
|
22
|
+
videoTrack: 'fake video track',
|
|
23
23
|
},
|
|
24
24
|
remoteMuted: false,
|
|
25
25
|
unmuteAllowed: true,
|
|
26
26
|
locusInfo: {
|
|
27
|
-
onFullLocus: sinon.stub()
|
|
27
|
+
onFullLocus: sinon.stub(),
|
|
28
28
|
},
|
|
29
29
|
members: {
|
|
30
30
|
selfId: 'fake self id',
|
|
31
|
-
muteMember: sinon.stub().resolves()
|
|
32
|
-
}
|
|
31
|
+
muteMember: sinon.stub().resolves(),
|
|
32
|
+
},
|
|
33
33
|
};
|
|
34
34
|
audio = createMuteState(AUDIO, meeting, {sendAudio: true});
|
|
35
35
|
video = createMuteState(VIDEO, meeting, {sendVideo: true});
|
|
@@ -121,11 +121,14 @@ describe('plugin-meetings', () => {
|
|
|
121
121
|
// first we need to mute and make that request last forever
|
|
122
122
|
let serverResponseResolve;
|
|
123
123
|
|
|
124
|
-
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
125
|
+
new Promise((resolve) => {
|
|
126
|
+
serverResponseResolve = resolve;
|
|
127
|
+
})
|
|
128
|
+
);
|
|
127
129
|
|
|
128
|
-
audio
|
|
130
|
+
audio
|
|
131
|
+
.handleClientRequest(meeting, true)
|
|
129
132
|
.then(() => {
|
|
130
133
|
clientPromiseResolved = true;
|
|
131
134
|
})
|
|
@@ -229,14 +232,15 @@ describe('plugin-meetings', () => {
|
|
|
229
232
|
|
|
230
233
|
let serverResponseResolve;
|
|
231
234
|
|
|
232
|
-
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
236
|
+
new Promise((resolve) => {
|
|
237
|
+
serverResponseResolve = resolve;
|
|
238
|
+
})
|
|
239
|
+
);
|
|
235
240
|
|
|
236
|
-
audio.handleClientRequest(meeting, true)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
});
|
|
241
|
+
audio.handleClientRequest(meeting, true).then(() => {
|
|
242
|
+
clientPromiseResolved = true;
|
|
243
|
+
});
|
|
240
244
|
|
|
241
245
|
// do a small delay to make sure that the client promise doesn't resolve in that time
|
|
242
246
|
await testUtils.waitUntil(200);
|
|
@@ -250,9 +254,11 @@ describe('plugin-meetings', () => {
|
|
|
250
254
|
});
|
|
251
255
|
|
|
252
256
|
it('rejects client request promise if server request for local mute fails', async () => {
|
|
253
|
-
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
254
|
-
reject
|
|
255
|
-
|
|
257
|
+
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
258
|
+
new Promise((resolve, reject) => {
|
|
259
|
+
reject();
|
|
260
|
+
})
|
|
261
|
+
);
|
|
256
262
|
|
|
257
263
|
assert.isRejected(audio.handleClientRequest(meeting, true));
|
|
258
264
|
});
|
|
@@ -275,9 +281,11 @@ describe('plugin-meetings', () => {
|
|
|
275
281
|
it('does not send a server request if client state matches the server', async () => {
|
|
276
282
|
let serverResponseResolve;
|
|
277
283
|
|
|
278
|
-
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
279
|
-
|
|
280
|
-
|
|
284
|
+
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
285
|
+
new Promise((resolve) => {
|
|
286
|
+
serverResponseResolve = resolve;
|
|
287
|
+
})
|
|
288
|
+
);
|
|
281
289
|
|
|
282
290
|
// simulate many client requests, with the last one matching the initial one
|
|
283
291
|
audio.handleClientRequest(meeting, true);
|
|
@@ -302,22 +310,22 @@ describe('plugin-meetings', () => {
|
|
|
302
310
|
it('queues up server requests when multiple client requests are received', async () => {
|
|
303
311
|
let serverResponseResolve;
|
|
304
312
|
|
|
305
|
-
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
306
|
-
|
|
307
|
-
|
|
313
|
+
MeetingUtil.remoteUpdateAudioVideo = sinon.stub().returns(
|
|
314
|
+
new Promise((resolve) => {
|
|
315
|
+
serverResponseResolve = resolve;
|
|
316
|
+
})
|
|
317
|
+
);
|
|
308
318
|
|
|
309
319
|
let firstClientPromiseResolved = false;
|
|
310
320
|
let secondClientPromiseResolved = false;
|
|
311
321
|
|
|
312
322
|
// 2 client requests, one after another without waiting for first one to resolve
|
|
313
|
-
audio.handleClientRequest(meeting, true)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
secondClientPromiseResolved = true;
|
|
320
|
-
});
|
|
323
|
+
audio.handleClientRequest(meeting, true).then(() => {
|
|
324
|
+
firstClientPromiseResolved = true;
|
|
325
|
+
});
|
|
326
|
+
audio.handleClientRequest(meeting, false).then(() => {
|
|
327
|
+
secondClientPromiseResolved = true;
|
|
328
|
+
});
|
|
321
329
|
|
|
322
330
|
await testUtils.flushPromises();
|
|
323
331
|
|
|
@@ -344,7 +352,8 @@ describe('plugin-meetings', () => {
|
|
|
344
352
|
it('rejects client request to unmute if hard mute is used', (done) => {
|
|
345
353
|
audio.handleServerRemoteMuteUpdate(true, false);
|
|
346
354
|
|
|
347
|
-
audio
|
|
355
|
+
audio
|
|
356
|
+
.handleClientRequest(meeting, false)
|
|
348
357
|
.then(() => {
|
|
349
358
|
done(new Error('expected handleClientRequest to fail, but it did not!'));
|
|
350
359
|
})
|
|
@@ -10,26 +10,28 @@ describe('plugin-meetings', () => {
|
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
const webex = new MockWebex({
|
|
12
12
|
children: {
|
|
13
|
-
meetings: Meetings
|
|
14
|
-
}
|
|
13
|
+
meetings: Meetings,
|
|
14
|
+
},
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
webex.meetings.clientRegion = {
|
|
18
18
|
countryCode: 'US',
|
|
19
|
-
regionCode: 'WEST-COAST'
|
|
19
|
+
regionCode: 'WEST-COAST',
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
webex.internal = {
|
|
23
23
|
services: {
|
|
24
24
|
get: sinon.mock().returns('locusUrl'),
|
|
25
|
-
waitForCatalog: sinon.mock().returns(Promise.resolve({}))
|
|
26
|
-
}
|
|
25
|
+
waitForCatalog: sinon.mock().returns(Promise.resolve({})),
|
|
26
|
+
},
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
meetingsRequest = new MeetingRequest(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
meetingsRequest = new MeetingRequest(
|
|
30
|
+
{},
|
|
31
|
+
{
|
|
32
|
+
parent: webex,
|
|
33
|
+
}
|
|
34
|
+
);
|
|
33
35
|
|
|
34
36
|
meetingsRequest.request = sinon.mock().returns(Promise.resolve({}));
|
|
35
37
|
});
|
|
@@ -44,7 +46,7 @@ describe('plugin-meetings', () => {
|
|
|
44
46
|
await meetingsRequest.sendDTMF({
|
|
45
47
|
locusUrl,
|
|
46
48
|
deviceUrl,
|
|
47
|
-
tones
|
|
49
|
+
tones,
|
|
48
50
|
});
|
|
49
51
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
50
52
|
|
|
@@ -66,7 +68,7 @@ describe('plugin-meetings', () => {
|
|
|
66
68
|
deviceUrl,
|
|
67
69
|
layoutType,
|
|
68
70
|
main: {width: 640, height: 480},
|
|
69
|
-
content: {width: 1280, height: 720}
|
|
71
|
+
content: {width: 1280, height: 720},
|
|
70
72
|
});
|
|
71
73
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
72
74
|
|
|
@@ -74,43 +76,53 @@ describe('plugin-meetings', () => {
|
|
|
74
76
|
assert.equal(requestParams.uri, `${locusUrl}/controls`);
|
|
75
77
|
assert.equal(requestParams.body.layout.type, layoutType);
|
|
76
78
|
assert.equal(requestParams.body.layout.deviceUrl, deviceUrl);
|
|
77
|
-
assert.deepEqual(requestParams.body.layout.layoutParams, {
|
|
79
|
+
assert.deepEqual(requestParams.body.layout.layoutParams, {
|
|
80
|
+
renderInfo: {main: {width: 640, height: 480}, content: {width: 1280, height: 720}},
|
|
81
|
+
});
|
|
78
82
|
});
|
|
79
83
|
|
|
80
84
|
it('throws if width is missing for main', async () => {
|
|
81
|
-
await assert.isRejected(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
await assert.isRejected(
|
|
86
|
+
meetingsRequest.changeVideoLayout({
|
|
87
|
+
locusUrl,
|
|
88
|
+
deviceUrl,
|
|
89
|
+
layoutType,
|
|
90
|
+
main: {height: 100},
|
|
91
|
+
})
|
|
92
|
+
);
|
|
87
93
|
});
|
|
88
94
|
|
|
89
95
|
it('throws if height is missing for main', async () => {
|
|
90
|
-
await assert.isRejected(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
await assert.isRejected(
|
|
97
|
+
meetingsRequest.changeVideoLayout({
|
|
98
|
+
locusUrl,
|
|
99
|
+
deviceUrl,
|
|
100
|
+
layoutType,
|
|
101
|
+
main: {width: 100},
|
|
102
|
+
})
|
|
103
|
+
);
|
|
96
104
|
});
|
|
97
105
|
|
|
98
106
|
it('throws if width is missing for content', async () => {
|
|
99
|
-
await assert.isRejected(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
await assert.isRejected(
|
|
108
|
+
meetingsRequest.changeVideoLayout({
|
|
109
|
+
locusUrl,
|
|
110
|
+
deviceUrl,
|
|
111
|
+
layoutType,
|
|
112
|
+
content: {height: 100},
|
|
113
|
+
})
|
|
114
|
+
);
|
|
105
115
|
});
|
|
106
116
|
|
|
107
117
|
it('throws if height is missing for content', async () => {
|
|
108
|
-
await assert.isRejected(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
await assert.isRejected(
|
|
119
|
+
meetingsRequest.changeVideoLayout({
|
|
120
|
+
locusUrl,
|
|
121
|
+
deviceUrl,
|
|
122
|
+
layoutType,
|
|
123
|
+
content: {width: 100},
|
|
124
|
+
})
|
|
125
|
+
);
|
|
114
126
|
});
|
|
115
127
|
});
|
|
116
128
|
|
|
@@ -127,8 +139,7 @@ describe('plugin-meetings', () => {
|
|
|
127
139
|
deviceUrl,
|
|
128
140
|
correlationId,
|
|
129
141
|
roapMessage,
|
|
130
|
-
permissionToken
|
|
131
|
-
|
|
142
|
+
permissionToken,
|
|
132
143
|
});
|
|
133
144
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
134
145
|
|
|
@@ -150,7 +161,7 @@ describe('plugin-meetings', () => {
|
|
|
150
161
|
deviceUrl,
|
|
151
162
|
correlationId,
|
|
152
163
|
roapMessage,
|
|
153
|
-
meetingNumber
|
|
164
|
+
meetingNumber,
|
|
154
165
|
});
|
|
155
166
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
156
167
|
|
|
@@ -171,7 +182,7 @@ describe('plugin-meetings', () => {
|
|
|
171
182
|
correlationId,
|
|
172
183
|
roapMessage,
|
|
173
184
|
meetingNumber,
|
|
174
|
-
inviteeAddress
|
|
185
|
+
inviteeAddress,
|
|
175
186
|
});
|
|
176
187
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
177
188
|
|
|
@@ -192,7 +203,7 @@ describe('plugin-meetings', () => {
|
|
|
192
203
|
locusUrl,
|
|
193
204
|
clientUrl,
|
|
194
205
|
correlationId,
|
|
195
|
-
dialInUrl
|
|
206
|
+
dialInUrl,
|
|
196
207
|
});
|
|
197
208
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
198
209
|
|
|
@@ -216,7 +227,7 @@ describe('plugin-meetings', () => {
|
|
|
216
227
|
clientUrl,
|
|
217
228
|
correlationId,
|
|
218
229
|
dialOutUrl,
|
|
219
|
-
phoneNumber
|
|
230
|
+
phoneNumber,
|
|
220
231
|
});
|
|
221
232
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
222
233
|
|
|
@@ -239,7 +250,7 @@ describe('plugin-meetings', () => {
|
|
|
239
250
|
locusUrl,
|
|
240
251
|
selfId,
|
|
241
252
|
correlationId,
|
|
242
|
-
phoneUrl
|
|
253
|
+
phoneUrl,
|
|
243
254
|
});
|
|
244
255
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
245
256
|
|
|
@@ -286,13 +297,13 @@ describe('plugin-meetings', () => {
|
|
|
286
297
|
type: 'thumb_down',
|
|
287
298
|
codepoints: '1F44E',
|
|
288
299
|
shortcodes: ':thumbsdown:',
|
|
289
|
-
tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''}
|
|
300
|
+
tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''},
|
|
290
301
|
};
|
|
291
302
|
|
|
292
303
|
await meetingsRequest.sendReaction({
|
|
293
304
|
reactionChannelUrl,
|
|
294
305
|
reaction,
|
|
295
|
-
participantId
|
|
306
|
+
participantId,
|
|
296
307
|
});
|
|
297
308
|
const requestParams = meetingsRequest.request.getCall(0).args[0];
|
|
298
309
|
|
|
@@ -2,11 +2,9 @@ import sinon from 'sinon';
|
|
|
2
2
|
import {assert} from '@webex/test-helper-chai';
|
|
3
3
|
import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
|
|
4
4
|
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
5
|
-
import LoggerConfig
|
|
6
|
-
from '@webex/plugin-meetings/src/common/logs/logger-config';
|
|
5
|
+
import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
|
|
7
6
|
import Metrics from '@webex/plugin-meetings/src/metrics/index';
|
|
8
7
|
|
|
9
|
-
|
|
10
8
|
describe('plugin-meetings', () => {
|
|
11
9
|
describe('Meeting utils function', () => {
|
|
12
10
|
const sandbox = sinon.createSandbox();
|
|
@@ -18,23 +16,19 @@ describe('plugin-meetings', () => {
|
|
|
18
16
|
info: sandbox.stub(),
|
|
19
17
|
log: sandbox.stub(),
|
|
20
18
|
error: sandbox.stub(),
|
|
21
|
-
warn: sandbox.stub()
|
|
19
|
+
warn: sandbox.stub(),
|
|
22
20
|
};
|
|
23
21
|
|
|
24
22
|
LoggerConfig.set({
|
|
25
23
|
verboseEvents: true,
|
|
26
|
-
enable: true
|
|
24
|
+
enable: true,
|
|
27
25
|
});
|
|
28
26
|
LoggerProxy.set(logger);
|
|
29
27
|
|
|
30
|
-
meeting.closeLocalStream = sinon.stub()
|
|
31
|
-
|
|
32
|
-
meeting.
|
|
33
|
-
|
|
34
|
-
meeting.closeRemoteTracks = sinon.stub()
|
|
35
|
-
.returns(Promise.resolve());
|
|
36
|
-
meeting.closePeerConnections = sinon.stub()
|
|
37
|
-
.returns(Promise.resolve());
|
|
28
|
+
meeting.closeLocalStream = sinon.stub().returns(Promise.resolve());
|
|
29
|
+
meeting.closeLocalShare = sinon.stub().returns(Promise.resolve());
|
|
30
|
+
meeting.closeRemoteTracks = sinon.stub().returns(Promise.resolve());
|
|
31
|
+
meeting.closePeerConnections = sinon.stub().returns(Promise.resolve());
|
|
38
32
|
|
|
39
33
|
meeting.unsetLocalVideoTrack = sinon.stub();
|
|
40
34
|
meeting.unsetLocalShareTrack = sinon.stub();
|
|
@@ -70,11 +64,11 @@ describe('plugin-meetings', () => {
|
|
|
70
64
|
|
|
71
65
|
describe('logging', () => {
|
|
72
66
|
const fakeDevice = sinon.fake.returns({
|
|
73
|
-
deviceId: 'device-1'
|
|
67
|
+
deviceId: 'device-1',
|
|
74
68
|
});
|
|
75
69
|
|
|
76
70
|
const mockTrack = {
|
|
77
|
-
getSettings: fakeDevice
|
|
71
|
+
getSettings: fakeDevice,
|
|
78
72
|
};
|
|
79
73
|
|
|
80
74
|
it('#log - should log [info, warn, error, log] to console', () => {
|
|
@@ -124,10 +118,7 @@ describe('plugin-meetings', () => {
|
|
|
124
118
|
});
|
|
125
119
|
|
|
126
120
|
it('should log device settings', () => {
|
|
127
|
-
const mockDevices = [
|
|
128
|
-
{deviceId: 'device-1'},
|
|
129
|
-
{deviceId: 'device-2'}
|
|
130
|
-
];
|
|
121
|
+
const mockDevices = [{deviceId: 'device-1'}, {deviceId: 'device-2'}];
|
|
131
122
|
|
|
132
123
|
assert(MeetingUtil.handleDeviceLogging, 'is defined');
|
|
133
124
|
MeetingUtil.handleDeviceLogging(mockDevices);
|
|
@@ -138,7 +129,13 @@ describe('plugin-meetings', () => {
|
|
|
138
129
|
|
|
139
130
|
describe('joinMeeting', () => {
|
|
140
131
|
it('#Should call `meetingRequest.joinMeeting', async () => {
|
|
141
|
-
const meeting = {
|
|
132
|
+
const meeting = {
|
|
133
|
+
meetingJoinUrl: 'meetingJoinUrl',
|
|
134
|
+
locusUrl: 'locusUrl',
|
|
135
|
+
meetingRequest: {
|
|
136
|
+
joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}})),
|
|
137
|
+
},
|
|
138
|
+
};
|
|
142
139
|
|
|
143
140
|
MeetingUtil.parseLocusJoin = sinon.stub();
|
|
144
141
|
await MeetingUtil.joinMeeting(meeting, {});
|
|
@@ -150,7 +147,13 @@ describe('plugin-meetings', () => {
|
|
|
150
147
|
});
|
|
151
148
|
|
|
152
149
|
it('#Should fallback sipUrl if meetingJoinUrl does not exists', async () => {
|
|
153
|
-
const meeting = {
|
|
150
|
+
const meeting = {
|
|
151
|
+
sipUri: 'sipUri',
|
|
152
|
+
locusUrl: 'locusUrl',
|
|
153
|
+
meetingRequest: {
|
|
154
|
+
joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}})),
|
|
155
|
+
},
|
|
156
|
+
};
|
|
154
157
|
|
|
155
158
|
MeetingUtil.parseLocusJoin = sinon.stub();
|
|
156
159
|
await MeetingUtil.joinMeeting(meeting, {});
|
|
@@ -162,7 +165,13 @@ describe('plugin-meetings', () => {
|
|
|
162
165
|
});
|
|
163
166
|
|
|
164
167
|
it('#Should fallback to meetingNumber if meetingJoinUrl/sipUrl does not exists', async () => {
|
|
165
|
-
const meeting = {
|
|
168
|
+
const meeting = {
|
|
169
|
+
meetingNumber: 'meetingNumber',
|
|
170
|
+
locusUrl: 'locusUrl',
|
|
171
|
+
meetingRequest: {
|
|
172
|
+
joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}})),
|
|
173
|
+
},
|
|
174
|
+
};
|
|
166
175
|
|
|
167
176
|
MeetingUtil.parseLocusJoin = sinon.stub();
|
|
168
177
|
await MeetingUtil.joinMeeting(meeting, {});
|
|
@@ -179,15 +188,9 @@ describe('plugin-meetings', () => {
|
|
|
179
188
|
it('returns display hints', () => {
|
|
180
189
|
assert.deepEqual(MeetingUtil.getUserDisplayHintsFromLocusInfo(), []);
|
|
181
190
|
|
|
182
|
-
assert.deepEqual(
|
|
183
|
-
MeetingUtil.getUserDisplayHintsFromLocusInfo({}),
|
|
184
|
-
[]
|
|
185
|
-
);
|
|
191
|
+
assert.deepEqual(MeetingUtil.getUserDisplayHintsFromLocusInfo({}), []);
|
|
186
192
|
|
|
187
|
-
assert.deepEqual(
|
|
188
|
-
MeetingUtil.getUserDisplayHintsFromLocusInfo({parsedLocus: {}}),
|
|
189
|
-
[]
|
|
190
|
-
);
|
|
193
|
+
assert.deepEqual(MeetingUtil.getUserDisplayHintsFromLocusInfo({parsedLocus: {}}), []);
|
|
191
194
|
|
|
192
195
|
assert.deepEqual(
|
|
193
196
|
MeetingUtil.getUserDisplayHintsFromLocusInfo({parsedLocus: {info: {}}}),
|
|
@@ -195,7 +198,9 @@ describe('plugin-meetings', () => {
|
|
|
195
198
|
);
|
|
196
199
|
|
|
197
200
|
assert.deepEqual(
|
|
198
|
-
MeetingUtil.getUserDisplayHintsFromLocusInfo({
|
|
201
|
+
MeetingUtil.getUserDisplayHintsFromLocusInfo({
|
|
202
|
+
parsedLocus: {info: {userDisplayHints: []}},
|
|
203
|
+
}),
|
|
199
204
|
[]
|
|
200
205
|
);
|
|
201
206
|
|
|
@@ -203,11 +208,9 @@ describe('plugin-meetings', () => {
|
|
|
203
208
|
MeetingUtil.getUserDisplayHintsFromLocusInfo({
|
|
204
209
|
parsedLocus: {
|
|
205
210
|
info: {
|
|
206
|
-
userDisplayHints: [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
+
userDisplayHints: ['HINT_1'],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
211
214
|
}),
|
|
212
215
|
['HINT_1']
|
|
213
216
|
);
|
|
@@ -244,23 +247,38 @@ describe('plugin-meetings', () => {
|
|
|
244
247
|
|
|
245
248
|
describe('canUserLowerSomeoneElsesHand', () => {
|
|
246
249
|
it('works as expected', () => {
|
|
247
|
-
assert.deepEqual(
|
|
250
|
+
assert.deepEqual(
|
|
251
|
+
MeetingUtil.canUserLowerSomeoneElsesHand(['LOWER_SOMEONE_ELSES_HAND']),
|
|
252
|
+
true
|
|
253
|
+
);
|
|
248
254
|
assert.deepEqual(MeetingUtil.canUserLowerSomeoneElsesHand([]), false);
|
|
249
255
|
});
|
|
250
256
|
});
|
|
251
257
|
|
|
252
258
|
describe('bothLeaveAndEndMeetingAvailable', () => {
|
|
253
259
|
it('works as expected', () => {
|
|
254
|
-
assert.deepEqual(
|
|
260
|
+
assert.deepEqual(
|
|
261
|
+
MeetingUtil.bothLeaveAndEndMeetingAvailable(['LEAVE_TRANSFER_HOST_END_MEETING']),
|
|
262
|
+
true
|
|
263
|
+
);
|
|
255
264
|
assert.deepEqual(MeetingUtil.bothLeaveAndEndMeetingAvailable(['LEAVE_END_MEETING']), true);
|
|
256
|
-
assert.deepEqual(
|
|
265
|
+
assert.deepEqual(
|
|
266
|
+
MeetingUtil.bothLeaveAndEndMeetingAvailable([
|
|
267
|
+
'LEAVE_TRANSFER_HOST_END_MEETING',
|
|
268
|
+
'LEAVE_END_MEETING',
|
|
269
|
+
]),
|
|
270
|
+
true
|
|
271
|
+
);
|
|
257
272
|
assert.deepEqual(MeetingUtil.bothLeaveAndEndMeetingAvailable([]), false);
|
|
258
273
|
});
|
|
259
274
|
});
|
|
260
275
|
|
|
261
276
|
describe('canUserLock', () => {
|
|
262
277
|
it('works as expected', () => {
|
|
263
|
-
assert.deepEqual(
|
|
278
|
+
assert.deepEqual(
|
|
279
|
+
MeetingUtil.canUserLock(['LOCK_CONTROL_LOCK', 'LOCK_STATUS_UNLOCKED']),
|
|
280
|
+
true
|
|
281
|
+
);
|
|
264
282
|
assert.deepEqual(MeetingUtil.canUserLock(['LOCK_CONTROL_LOCK']), false);
|
|
265
283
|
assert.deepEqual(MeetingUtil.canUserLock(['LOCK_STATUS_UNLOCKED']), false);
|
|
266
284
|
assert.deepEqual(MeetingUtil.canUserLock([]), false);
|
|
@@ -269,7 +287,10 @@ describe('plugin-meetings', () => {
|
|
|
269
287
|
|
|
270
288
|
describe('canUserUnlock', () => {
|
|
271
289
|
it('works as expected', () => {
|
|
272
|
-
assert.deepEqual(
|
|
290
|
+
assert.deepEqual(
|
|
291
|
+
MeetingUtil.canUserUnlock(['LOCK_CONTROL_UNLOCK', 'LOCK_STATUS_LOCKED']),
|
|
292
|
+
true
|
|
293
|
+
);
|
|
273
294
|
assert.deepEqual(MeetingUtil.canUserUnlock(['LOCK_CONTROL_UNLOCK']), false);
|
|
274
295
|
assert.deepEqual(MeetingUtil.canUserUnlock(['LOCK_STATUS_LOCKED']), false);
|
|
275
296
|
assert.deepEqual(MeetingUtil.canUserUnlock([]), false);
|
|
@@ -297,7 +318,6 @@ describe('plugin-meetings', () => {
|
|
|
297
318
|
});
|
|
298
319
|
});
|
|
299
320
|
|
|
300
|
-
|
|
301
321
|
describe('canUserStop', () => {
|
|
302
322
|
it('works as expected', () => {
|
|
303
323
|
assert.deepEqual(MeetingUtil.canUserStop(['RECORDING_CONTROL_STOP']), true);
|
|
@@ -324,7 +344,6 @@ describe('plugin-meetings', () => {
|
|
|
324
344
|
});
|
|
325
345
|
});
|
|
326
346
|
|
|
327
|
-
|
|
328
347
|
describe('recording tests', () => {
|
|
329
348
|
let request;
|
|
330
349
|
let locusInfo;
|
|
@@ -334,14 +353,12 @@ describe('plugin-meetings', () => {
|
|
|
334
353
|
locusInfo = {
|
|
335
354
|
parsedLocus: {
|
|
336
355
|
info: {
|
|
337
|
-
userDisplayHints: [
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
}
|
|
356
|
+
userDisplayHints: ['RECORDING_CONTROL_START'],
|
|
357
|
+
},
|
|
358
|
+
},
|
|
342
359
|
};
|
|
343
360
|
request = {
|
|
344
|
-
recordMeeting: sinon.stub().returns(Promise.resolve())
|
|
361
|
+
recordMeeting: sinon.stub().returns(Promise.resolve()),
|
|
345
362
|
};
|
|
346
363
|
});
|
|
347
364
|
|