@webex/plugin-meetings 1.156.4 → 1.158.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/README.md +3 -3
- package/browsers.js +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/meeting/index.js +12 -1
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +12 -3
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +44 -0
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +2 -2
- package/dist/meetings/index.js.map +1 -1
- package/dist/metrics/index.js +8 -1
- package/dist/metrics/index.js.map +1 -1
- package/package.json +5 -5
- package/src/index.js +0 -1
- package/src/meeting/index.js +13 -0
- package/src/meeting-info/meeting-info-v2.js +8 -2
- package/src/meeting-info/utilv2.js +39 -0
- package/src/meetings/index.js +1 -2
- package/src/metrics/index.js +9 -1
- package/test/{unit/spec/transcription/index.js → integration/spec/transcription.js} +1 -1
- package/test/unit/spec/common/browser-detection.js +1 -0
- package/test/unit/spec/locus-info/index.js +1 -1
- package/test/unit/spec/meeting/index.js +49 -3
- package/test/unit/spec/meeting-info/utilv2.js +72 -0
- package/test/unit/spec/meetings/index.js +266 -74
- package/test/unit/spec/members/index.js +1 -0
- package/test/unit/spec/metrics/index.js +7 -26
- package/test/unit/spec/networkQualityMonitor/index.js +1 -0
- package/test/unit/spec/peerconnection-manager/index.js +11 -1
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +1 -0
- package/test/unit/spec/reconnection-manager/index.js +1 -0
- package/test/unit/spec/roap/util.js +1 -0
- package/test/unit/spec/stats-analyzer/index.js +1 -0
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
3
|
*/
|
|
4
|
+
import 'jsdom-global/register';
|
|
4
5
|
|
|
5
|
-
import {assert} from '@webex/test-helper-chai';
|
|
6
|
-
import sinon from 'sinon';
|
|
7
|
-
import MockWebex from '@webex/test-helper-mock-webex';
|
|
8
6
|
import Device from '@webex/internal-plugin-device';
|
|
9
7
|
import Mercury from '@webex/internal-plugin-mercury';
|
|
8
|
+
import StaticConfig from '@webex/plugin-meetings/src/common/config';
|
|
9
|
+
import TriggerProxy from '@webex/plugin-meetings/src/common/events/trigger-proxy';
|
|
10
|
+
import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
|
|
11
|
+
import MediaUtil from '@webex/plugin-meetings/src/media/util';
|
|
12
|
+
import Meeting from '@webex/plugin-meetings/src/meeting';
|
|
13
|
+
import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
|
|
10
14
|
import Meetings from '@webex/plugin-meetings/src/meetings';
|
|
11
|
-
import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
|
|
12
|
-
import Reachability from '@webex/plugin-meetings/src/reachability';
|
|
13
15
|
import MeetingCollection from '@webex/plugin-meetings/src/meetings/collection';
|
|
14
16
|
import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import TriggerProxy from '@webex/plugin-meetings/src/common/events/trigger-proxy';
|
|
17
|
+
import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
|
|
18
|
+
import Reachability from '@webex/plugin-meetings/src/reachability';
|
|
19
|
+
import {assert} from '@webex/test-helper-chai';
|
|
20
|
+
import MockWebex from '@webex/test-helper-mock-webex';
|
|
21
|
+
import sinon from 'sinon';
|
|
21
22
|
import uuid from 'uuid';
|
|
22
|
-
import {skipInBrowser} from '@webex/test-helper-mocha';
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
LOCUSEVENT,
|
|
26
|
-
|
|
26
|
+
OFFLINE,
|
|
27
27
|
ONLINE,
|
|
28
|
-
|
|
28
|
+
ROAP
|
|
29
29
|
} from '../../../../src/constants';
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
describe('plugin-meetings', () => {
|
|
32
33
|
const logger = {
|
|
33
34
|
log: () => {},
|
|
34
35
|
info: () => {},
|
|
@@ -39,9 +40,14 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
beforeEach(() => {
|
|
42
|
-
StaticConfig.set({
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
StaticConfig.set({
|
|
44
|
+
bandwidth: {
|
|
45
|
+
audio: 50, video: 500
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
LoggerConfig.set({
|
|
49
|
+
verboseEvents: true, enable: false
|
|
50
|
+
});
|
|
45
51
|
TriggerProxy.trigger = sinon.stub().returns(true);
|
|
46
52
|
});
|
|
47
53
|
|
|
@@ -54,7 +60,7 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
54
60
|
|
|
55
61
|
describe('meetings index', () => {
|
|
56
62
|
beforeEach(() => {
|
|
57
|
-
MeetingsUtil.
|
|
63
|
+
MeetingsUtil.checkH264Support = sinon.stub();
|
|
58
64
|
uuid1 = uuid.v4();
|
|
59
65
|
url1 = `https://example.com/${uuid.v4()}`;
|
|
60
66
|
uri1 = `test-${uuid.v4()}@example.com`;
|
|
@@ -69,11 +75,26 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
69
75
|
});
|
|
70
76
|
|
|
71
77
|
Object.assign(webex.meetings.config, {
|
|
78
|
+
bandwidth: {
|
|
79
|
+
// please note, these are the maximum bandwidth values
|
|
80
|
+
// the server supports, minimums have to be tested
|
|
81
|
+
audio: 64000,
|
|
82
|
+
video: 4000000,
|
|
83
|
+
startBitrate: 2000
|
|
84
|
+
},
|
|
72
85
|
experimental: {
|
|
73
86
|
enableUnifiedMeetings: true
|
|
87
|
+
},
|
|
88
|
+
logging: {
|
|
89
|
+
enable: false,
|
|
90
|
+
verboseEvents: true
|
|
74
91
|
}
|
|
75
92
|
});
|
|
76
93
|
|
|
94
|
+
Object.assign(webex, {
|
|
95
|
+
logger
|
|
96
|
+
});
|
|
97
|
+
|
|
77
98
|
Object.assign(webex.internal, {
|
|
78
99
|
device: {
|
|
79
100
|
deviceType: 'FAKE_DEVICE',
|
|
@@ -85,8 +106,23 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
85
106
|
disconnect: sinon.stub().returns(Promise.resolve()),
|
|
86
107
|
on: () => {},
|
|
87
108
|
off: () => {}
|
|
109
|
+
},
|
|
110
|
+
services: {
|
|
111
|
+
fetchLoginUserInformation: sinon.stub().returns(Promise.resolve({
|
|
112
|
+
userPreferences: [
|
|
113
|
+
'SparkTOSAccept',
|
|
114
|
+
// eslint-disable-next-line no-useless-escape
|
|
115
|
+
'\"preferredWebExSite\":"\go.webex.com\"'
|
|
116
|
+
]
|
|
117
|
+
})),
|
|
118
|
+
fetchClientRegionInfo: sinon.stub().returns(Promise.resolve())
|
|
119
|
+
},
|
|
120
|
+
metrics: {
|
|
121
|
+
submitClientMetrics: sinon.stub().returns(Promise.resolve())
|
|
88
122
|
}
|
|
123
|
+
|
|
89
124
|
});
|
|
125
|
+
webex.emit('ready');
|
|
90
126
|
});
|
|
91
127
|
|
|
92
128
|
it('has a webex instance with a meetings property', () => {
|
|
@@ -95,12 +131,12 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
95
131
|
});
|
|
96
132
|
|
|
97
133
|
it('has set up the static config copy', () => {
|
|
98
|
-
assert.equal(StaticConfig.meetings.bandwidth.audio,
|
|
99
|
-
assert.equal(StaticConfig.meetings.bandwidth.video,
|
|
134
|
+
assert.equal(StaticConfig.meetings.bandwidth.audio, 64000);
|
|
135
|
+
assert.equal(StaticConfig.meetings.bandwidth.video, 4000000);
|
|
100
136
|
});
|
|
101
137
|
|
|
102
138
|
it('Should trigger h264 download', () => {
|
|
103
|
-
assert.calledOnce(MeetingsUtil.
|
|
139
|
+
assert.calledOnce(MeetingsUtil.checkH264Support);
|
|
104
140
|
});
|
|
105
141
|
|
|
106
142
|
describe('#_toggleUnifiedMeetings', () => {
|
|
@@ -131,7 +167,9 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
131
167
|
it('emits an event and resolves when register succeeds', (done) => {
|
|
132
168
|
webex.canAuthorize = true;
|
|
133
169
|
webex.meetings.register().then(() => {
|
|
134
|
-
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
170
|
+
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
171
|
+
file: 'meetings', function: 'register'
|
|
172
|
+
}, 'meetings:registered');
|
|
135
173
|
assert.isTrue(webex.meetings.registered);
|
|
136
174
|
done();
|
|
137
175
|
});
|
|
@@ -170,7 +208,9 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
170
208
|
it('emits an event and resolves when unregister succeeds', (done) => {
|
|
171
209
|
webex.meetings.registered = true;
|
|
172
210
|
webex.meetings.unregister().then(() => {
|
|
173
|
-
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
211
|
+
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
212
|
+
file: 'meetings', function: 'unregister'
|
|
213
|
+
}, 'meetings:unregistered');
|
|
174
214
|
assert.isFalse(webex.meetings.registered);
|
|
175
215
|
done();
|
|
176
216
|
});
|
|
@@ -262,9 +302,13 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
262
302
|
});
|
|
263
303
|
describe('#getAllMeetings', () => {
|
|
264
304
|
it('calls MeetingCollection to get all meetings with supplied options', () => {
|
|
265
|
-
webex.meetings.getAllMeetings({
|
|
305
|
+
webex.meetings.getAllMeetings({
|
|
306
|
+
test: test1
|
|
307
|
+
});
|
|
266
308
|
assert.calledOnce(webex.meetings.meetingCollection.getAll);
|
|
267
|
-
assert.calledWith(webex.meetings.meetingCollection.getAll, {
|
|
309
|
+
assert.calledWith(webex.meetings.meetingCollection.getAll, {
|
|
310
|
+
test: test1
|
|
311
|
+
});
|
|
268
312
|
});
|
|
269
313
|
});
|
|
270
314
|
});
|
|
@@ -276,14 +320,22 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
276
320
|
});
|
|
277
321
|
describe('succesful requests', () => {
|
|
278
322
|
beforeEach(() => {
|
|
279
|
-
webex.meetings.request.getActiveMeetings = sinon.stub().returns(Promise.resolve({
|
|
323
|
+
webex.meetings.request.getActiveMeetings = sinon.stub().returns(Promise.resolve({
|
|
324
|
+
loci: [{
|
|
325
|
+
url: url1
|
|
326
|
+
}]
|
|
327
|
+
}));
|
|
280
328
|
});
|
|
281
329
|
describe('when meeting is returned', () => {
|
|
282
330
|
let parse;
|
|
283
331
|
|
|
284
332
|
beforeEach(() => {
|
|
285
333
|
parse = sinon.stub().returns(true);
|
|
286
|
-
webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
|
|
334
|
+
webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
|
|
335
|
+
locusInfo: {
|
|
336
|
+
parse
|
|
337
|
+
}
|
|
338
|
+
});
|
|
287
339
|
});
|
|
288
340
|
it('tests the sync meeting calls for existing meeting', async () => {
|
|
289
341
|
await webex.meetings.syncMeetings();
|
|
@@ -299,7 +351,11 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
299
351
|
beforeEach(() => {
|
|
300
352
|
initialSetup = sinon.stub().returns(true);
|
|
301
353
|
webex.meetings.meetingCollection.getByKey = sinon.stub().returns(null);
|
|
302
|
-
webex.meetings.create = sinon.stub().returns(Promise.resolve({
|
|
354
|
+
webex.meetings.create = sinon.stub().returns(Promise.resolve({
|
|
355
|
+
locusInfo: {
|
|
356
|
+
initialSetup
|
|
357
|
+
}
|
|
358
|
+
}));
|
|
303
359
|
});
|
|
304
360
|
it('tests the sync meeting calls for not existing meeting', async () => {
|
|
305
361
|
await webex.meetings.syncMeetings();
|
|
@@ -309,29 +365,51 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
309
365
|
assert.calledOnce(webex.meetings.create);
|
|
310
366
|
assert.calledWith(webex.meetings.request.getActiveMeetings);
|
|
311
367
|
assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
|
|
312
|
-
assert.calledWith(webex.meetings.create, {
|
|
313
|
-
|
|
368
|
+
assert.calledWith(webex.meetings.create, {
|
|
369
|
+
url: url1
|
|
370
|
+
}, 'LOCUS_ID');
|
|
371
|
+
assert.calledWith(initialSetup, {
|
|
372
|
+
url: url1
|
|
373
|
+
});
|
|
314
374
|
});
|
|
315
375
|
});
|
|
316
376
|
describe('destory non active meeting', () => {
|
|
317
377
|
let initialSetup;
|
|
318
378
|
let parse;
|
|
379
|
+
let destroySpy;
|
|
319
380
|
|
|
320
381
|
beforeEach(() => {
|
|
382
|
+
destroySpy = sinon.spy(webex.meetings, 'destroy');
|
|
321
383
|
parse = sinon.stub().returns(true);
|
|
322
|
-
webex.meetings.destroy = sinon.stub();
|
|
323
384
|
initialSetup = sinon.stub().returns(true);
|
|
324
|
-
webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
385
|
+
webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
|
|
386
|
+
locusInfo: {
|
|
387
|
+
parse
|
|
388
|
+
},
|
|
389
|
+
sendCallAnalyzerMetrics: sinon.stub()
|
|
390
|
+
});
|
|
391
|
+
webex.meetings.meetingCollection.getAll = sinon.stub().returns({
|
|
392
|
+
meetingutk: {
|
|
393
|
+
locusUrl: 'fdfdjfdhj', sendCallAnalyzerMetrics: sinon.stub()
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
webex.meetings.create = sinon.stub().returns(Promise.resolve({
|
|
397
|
+
locusInfo: {
|
|
398
|
+
initialSetup
|
|
399
|
+
},
|
|
400
|
+
sendCallAnalyzerMetrics: sinon.stub()
|
|
401
|
+
}));
|
|
402
|
+
webex.meetings.request.getActiveMeetings = sinon.stub().returns(Promise.resolve({
|
|
403
|
+
loci: []
|
|
404
|
+
}));
|
|
405
|
+
MeetingUtil.cleanUp = sinon.stub().returns(Promise.resolve());
|
|
328
406
|
});
|
|
329
407
|
it('destroy non active meetings', async () => {
|
|
330
408
|
await webex.meetings.syncMeetings();
|
|
331
409
|
assert.calledOnce(webex.meetings.request.getActiveMeetings);
|
|
332
|
-
assert.calledOnce(
|
|
410
|
+
assert.calledOnce(destroySpy);
|
|
333
411
|
|
|
334
|
-
assert.calledOnce(
|
|
412
|
+
assert.calledOnce(MeetingUtil.cleanUp);
|
|
335
413
|
});
|
|
336
414
|
});
|
|
337
415
|
});
|
|
@@ -348,7 +426,9 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
348
426
|
type: 'CONVERSATION_URL'
|
|
349
427
|
};
|
|
350
428
|
webex.meetings.meetingCollection.getByKey = sinon.stub().returns();
|
|
351
|
-
webex.meetings.createMeeting = sinon.stub().returns(Promise.resolve({
|
|
429
|
+
webex.meetings.createMeeting = sinon.stub().returns(Promise.resolve({
|
|
430
|
+
on: () => true
|
|
431
|
+
}));
|
|
352
432
|
});
|
|
353
433
|
|
|
354
434
|
it('should call MeetingInfo#fetchInfoOptions() with proper params',
|
|
@@ -404,17 +484,30 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
404
484
|
webex.meetings.handleLocusEvent = sinon.stub().returns(true);
|
|
405
485
|
});
|
|
406
486
|
it('doesnt call handle locus mercury for a locus roap event', () => {
|
|
407
|
-
webex.meetings.handleLocusMercury({
|
|
487
|
+
webex.meetings.handleLocusMercury({
|
|
488
|
+
data: {
|
|
489
|
+
eventType: 'locus.message.roap'
|
|
490
|
+
}
|
|
491
|
+
});
|
|
408
492
|
assert.notCalled(webex.meetings.handleLocusEvent);
|
|
409
493
|
});
|
|
410
494
|
it('doesnt call handle locus mercury for an undefined eventType', () => {
|
|
411
|
-
webex.meetings.handleLocusMercury({
|
|
495
|
+
webex.meetings.handleLocusMercury({
|
|
496
|
+
data: {
|
|
497
|
+
}
|
|
498
|
+
});
|
|
412
499
|
assert.notCalled(webex.meetings.handleLocusEvent);
|
|
413
500
|
});
|
|
414
501
|
it('calls handle locus mercury for all locus events', () => {
|
|
415
|
-
webex.meetings.handleLocusMercury({
|
|
502
|
+
webex.meetings.handleLocusMercury({
|
|
503
|
+
data: {
|
|
504
|
+
eventType: test1
|
|
505
|
+
}
|
|
506
|
+
});
|
|
416
507
|
assert.calledOnce(webex.meetings.handleLocusEvent);
|
|
417
|
-
assert.calledWith(webex.meetings.handleLocusEvent, {
|
|
508
|
+
assert.calledWith(webex.meetings.handleLocusEvent, {
|
|
509
|
+
eventType: test1
|
|
510
|
+
});
|
|
418
511
|
});
|
|
419
512
|
});
|
|
420
513
|
describe('#handleLocusEvent', () => {
|
|
@@ -423,14 +516,26 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
423
516
|
|
|
424
517
|
beforeEach(() => {
|
|
425
518
|
parse = sinon.stub().returns(true);
|
|
426
|
-
webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
|
|
519
|
+
webex.meetings.meetingCollection.getByKey = sinon.stub().returns({
|
|
520
|
+
locusInfo: {
|
|
521
|
+
parse
|
|
522
|
+
}
|
|
523
|
+
});
|
|
427
524
|
});
|
|
428
525
|
it('should parse the meeting info', () => {
|
|
429
|
-
webex.meetings.handleLocusEvent({
|
|
526
|
+
webex.meetings.handleLocusEvent({
|
|
527
|
+
locusUrl: url1
|
|
528
|
+
});
|
|
430
529
|
assert.calledOnce(webex.meetings.meetingCollection.getByKey);
|
|
431
530
|
assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
|
|
432
531
|
assert.calledOnce(parse);
|
|
433
|
-
assert.calledWith(parse, {
|
|
532
|
+
assert.calledWith(parse, {
|
|
533
|
+
locusInfo: {
|
|
534
|
+
parse
|
|
535
|
+
}
|
|
536
|
+
}, {
|
|
537
|
+
locusUrl: url1
|
|
538
|
+
});
|
|
434
539
|
});
|
|
435
540
|
});
|
|
436
541
|
describe('there was not a meeting', () => {
|
|
@@ -439,28 +544,92 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
439
544
|
beforeEach(() => {
|
|
440
545
|
initialSetup = sinon.stub().returns(true);
|
|
441
546
|
webex.meetings.meetingCollection.getByKey = sinon.stub().returns(undefined);
|
|
442
|
-
webex.meetings.create = sinon.stub().returns(Promise.resolve({
|
|
547
|
+
webex.meetings.create = sinon.stub().returns(Promise.resolve({
|
|
548
|
+
locusInfo: {
|
|
549
|
+
initialSetup
|
|
550
|
+
}
|
|
551
|
+
}));
|
|
443
552
|
});
|
|
444
553
|
it('should setup the meeting by difference event', async () => {
|
|
445
|
-
await webex.meetings.handleLocusEvent({
|
|
554
|
+
await webex.meetings.handleLocusEvent({
|
|
555
|
+
locus: {
|
|
556
|
+
id: uuid1,
|
|
557
|
+
replaces: [{
|
|
558
|
+
locusUrl: 'http:locusUrl'
|
|
559
|
+
}],
|
|
560
|
+
self: {
|
|
561
|
+
callBackInfo: {
|
|
562
|
+
callbackAddress: uri1
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
eventType: 'locus.difference',
|
|
567
|
+
locusUrl: url1
|
|
568
|
+
});
|
|
446
569
|
assert.callCount(webex.meetings.meetingCollection.getByKey, 5);
|
|
447
570
|
assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
|
|
448
571
|
assert.calledOnce(initialSetup);
|
|
449
|
-
assert.calledWith(initialSetup, {
|
|
572
|
+
assert.calledWith(initialSetup, {
|
|
573
|
+
id: uuid1,
|
|
574
|
+
replaces: [{
|
|
575
|
+
locusUrl: 'http:locusUrl'
|
|
576
|
+
}],
|
|
577
|
+
self: {
|
|
578
|
+
callBackInfo: {
|
|
579
|
+
callbackAddress: uri1
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
});
|
|
450
583
|
});
|
|
451
584
|
it('should setup the meeting by difference event without replaces', async () => {
|
|
452
|
-
await webex.meetings.handleLocusEvent({
|
|
585
|
+
await webex.meetings.handleLocusEvent({
|
|
586
|
+
locus: {
|
|
587
|
+
id: uuid1,
|
|
588
|
+
self: {
|
|
589
|
+
callBackInfo: {
|
|
590
|
+
callbackAddress: uri1
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
eventType: 'locus.difference',
|
|
595
|
+
locusUrl: url1
|
|
596
|
+
});
|
|
453
597
|
assert.callCount(webex.meetings.meetingCollection.getByKey, 4);
|
|
454
598
|
assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
|
|
455
599
|
assert.calledOnce(initialSetup);
|
|
456
|
-
assert.calledWith(initialSetup, {
|
|
600
|
+
assert.calledWith(initialSetup, {
|
|
601
|
+
id: uuid1,
|
|
602
|
+
self: {
|
|
603
|
+
callBackInfo: {
|
|
604
|
+
callbackAddress: uri1
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
});
|
|
457
608
|
});
|
|
458
609
|
it('should setup the meeting by a not difference event', async () => {
|
|
459
|
-
await webex.meetings.handleLocusEvent({
|
|
610
|
+
await webex.meetings.handleLocusEvent({
|
|
611
|
+
locus: {
|
|
612
|
+
id: uuid1,
|
|
613
|
+
self: {
|
|
614
|
+
callBackInfo: {
|
|
615
|
+
callbackAddress: uri1
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
eventType: test1,
|
|
620
|
+
locusUrl: url1
|
|
621
|
+
});
|
|
460
622
|
assert.callCount(webex.meetings.meetingCollection.getByKey, 4);
|
|
461
623
|
assert.calledWith(webex.meetings.meetingCollection.getByKey, 'locusUrl', url1);
|
|
462
624
|
assert.calledOnce(initialSetup);
|
|
463
|
-
assert.calledWith(initialSetup, {
|
|
625
|
+
assert.calledWith(initialSetup, {
|
|
626
|
+
id: uuid1,
|
|
627
|
+
self: {
|
|
628
|
+
callBackInfo: {
|
|
629
|
+
callbackAddress: uri1
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
});
|
|
464
633
|
});
|
|
465
634
|
});
|
|
466
635
|
});
|
|
@@ -471,23 +640,23 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
471
640
|
webex.internal.device.url = url1;
|
|
472
641
|
MeetingCollection.set = sinon.stub().returns(true);
|
|
473
642
|
MeetingsUtil.getMeetingAddedType = sinon.stub().returns('test');
|
|
474
|
-
|
|
643
|
+
TriggerProxy.trigger.reset();
|
|
475
644
|
});
|
|
476
645
|
describe('successful MeetingInfo.#fetchMeetingInfo', () => {
|
|
477
646
|
beforeEach(() => {
|
|
478
|
-
webex.meetings.meetingInfo.fetchMeetingInfo = sinon.stub().returns(Promise.resolve({
|
|
647
|
+
webex.meetings.meetingInfo.fetchMeetingInfo = sinon.stub().returns(Promise.resolve({
|
|
648
|
+
body: {
|
|
649
|
+
permissionToken: 'PT', meetingJoinUrl: 'meetingJoinUrl'
|
|
650
|
+
}
|
|
651
|
+
}));
|
|
479
652
|
});
|
|
480
653
|
it('creates the meeting from a successful meeting info fetch promise testing', async () => {
|
|
481
|
-
const meeting = webex.meetings.createMeeting('test', 'test');
|
|
654
|
+
const meeting = await webex.meetings.createMeeting('test', 'test');
|
|
482
655
|
|
|
483
|
-
assert.exists(meeting.then);
|
|
484
|
-
await meeting;
|
|
485
656
|
assert.calledOnce(webex.meetings.meetingInfo.fetchMeetingInfo);
|
|
486
|
-
assert.calledOnce(MeetingsUtil.extractDestination);
|
|
487
657
|
assert.calledOnce(MeetingsUtil.getMeetingAddedType);
|
|
488
658
|
assert.calledTwice(TriggerProxy.trigger);
|
|
489
659
|
assert.calledWith(webex.meetings.meetingInfo.fetchMeetingInfo, 'test');
|
|
490
|
-
assert.calledWith(MeetingsUtil.extractDestination, 'test', 'test');
|
|
491
660
|
assert.calledWith(MeetingsUtil.getMeetingAddedType, 'test');
|
|
492
661
|
assert.equal(meeting.permissionToken, 'PT');
|
|
493
662
|
assert.equal(meeting.meetingJoinUrl, 'meetingJoinUrl');
|
|
@@ -498,18 +667,21 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
498
667
|
|
|
499
668
|
assert.instanceOf(meeting, Meeting, 'createMeeting should eventually resolve to a Meeting Object');
|
|
500
669
|
assert.calledOnce(webex.meetings.meetingInfo.fetchMeetingInfo);
|
|
501
|
-
assert.calledOnce(MeetingsUtil.extractDestination);
|
|
502
670
|
assert.calledOnce(MeetingsUtil.getMeetingAddedType);
|
|
503
671
|
assert.calledTwice(TriggerProxy.trigger);
|
|
504
672
|
assert.calledWith(webex.meetings.meetingInfo.fetchMeetingInfo, 'test');
|
|
505
|
-
assert.calledWith(MeetingsUtil.extractDestination, 'test', 'test');
|
|
506
673
|
assert.calledWith(MeetingsUtil.getMeetingAddedType, 'test');
|
|
507
|
-
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
674
|
+
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
675
|
+
file: 'meetings', function: 'createMeeting'
|
|
676
|
+
}, 'meeting:added', {
|
|
677
|
+
meeting: sinon.match.instanceOf(Meeting), type: 'test'
|
|
678
|
+
});
|
|
508
679
|
});
|
|
509
680
|
});
|
|
510
681
|
describe('rejected MeetingInfo.#fetchMeetingInfo', () => {
|
|
511
682
|
beforeEach(() => {
|
|
512
683
|
console.error = sinon.stub().returns(false);
|
|
684
|
+
TriggerProxy.trigger.reset();
|
|
513
685
|
webex.meetings.meetingInfo.fetchMeetingInfo = sinon.stub().returns(Promise.reject(new Error('test')));
|
|
514
686
|
});
|
|
515
687
|
it('creates the meeting from a rejected meeting info fetch', async () => {
|
|
@@ -517,19 +689,25 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
517
689
|
|
|
518
690
|
assert.instanceOf(meeting, Meeting, 'createMeeting should eventually resolve to a Meeting Object');
|
|
519
691
|
assert.calledOnce(webex.meetings.meetingInfo.fetchMeetingInfo);
|
|
520
|
-
assert.calledOnce(MeetingsUtil.extractDestination);
|
|
521
692
|
assert.calledOnce(MeetingsUtil.getMeetingAddedType);
|
|
522
693
|
assert.calledTwice(TriggerProxy.trigger);
|
|
523
694
|
assert.calledWith(webex.meetings.meetingInfo.fetchMeetingInfo, 'test');
|
|
524
|
-
assert.calledWith(MeetingsUtil.extractDestination, 'test', 'test');
|
|
525
695
|
assert.calledWith(MeetingsUtil.getMeetingAddedType, 'test');
|
|
526
|
-
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
696
|
+
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
697
|
+
file: 'meetings', function: 'createMeeting'
|
|
698
|
+
}, 'meeting:added', {
|
|
699
|
+
meeting: sinon.match.instanceOf(Meeting), type: 'test'
|
|
700
|
+
});
|
|
527
701
|
});
|
|
528
702
|
});
|
|
529
703
|
});
|
|
530
704
|
});
|
|
531
705
|
describe('Public Event Triggers', () => {
|
|
532
706
|
describe('#destroy', () => {
|
|
707
|
+
beforeEach(() => {
|
|
708
|
+
MediaUtil.createPeerConnection = sinon.stub().returns(true);
|
|
709
|
+
MeetingUtil.cleanUp = sinon.stub();
|
|
710
|
+
});
|
|
533
711
|
it('should have #destroy', () => {
|
|
534
712
|
assert.exists(webex.meetings.destroy);
|
|
535
713
|
});
|
|
@@ -538,23 +716,33 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
538
716
|
webex.meetings.meetingCollection.delete = sinon.stub().returns(true);
|
|
539
717
|
});
|
|
540
718
|
|
|
541
|
-
it('tests the destroy removal from the collection', () => {
|
|
542
|
-
webex.meetings.
|
|
719
|
+
it('tests the destroy removal from the collection', async () => {
|
|
720
|
+
const meeting = await webex.meetings.createMeeting('test', 'test');
|
|
721
|
+
|
|
722
|
+
webex.meetings.destroy(meeting, test1);
|
|
543
723
|
|
|
544
724
|
assert.calledOnce(webex.meetings.meetingCollection.delete);
|
|
545
|
-
assert.calledWith(webex.meetings.meetingCollection.delete,
|
|
546
|
-
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
725
|
+
assert.calledWith(webex.meetings.meetingCollection.delete, meeting.id);
|
|
726
|
+
assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meetings), {
|
|
727
|
+
file: 'meetings', function: 'destroy'
|
|
728
|
+
}, 'meeting:removed', {
|
|
729
|
+
meetingId: meeting.id, reason: test1
|
|
730
|
+
});
|
|
547
731
|
});
|
|
548
732
|
});
|
|
549
733
|
|
|
550
734
|
describe('with auto upload logs enabled', () => {
|
|
551
735
|
beforeEach(() => {
|
|
552
|
-
webex.
|
|
736
|
+
webex.config.autoUploadLogs = true;
|
|
553
737
|
webex.meetings.loggerRequest.uploadLogs = sinon.stub().returns(Promise.resolve());
|
|
554
738
|
});
|
|
555
739
|
|
|
556
|
-
|
|
557
|
-
|
|
740
|
+
// Invalid test currently does not upload log on destroy of meeting when we do destory
|
|
741
|
+
// rather happens when we do leave or when via the meetign object action
|
|
742
|
+
xit('uploads logs on destroy', async () => {
|
|
743
|
+
const meeting = await webex.meetings.createMeeting('test', 'test');
|
|
744
|
+
|
|
745
|
+
webex.meetings.destroy(meeting, test1);
|
|
558
746
|
assert.calledOnce(webex.meetings.loggerRequest.uploadLogs);
|
|
559
747
|
});
|
|
560
748
|
});
|
|
@@ -563,9 +751,13 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
563
751
|
describe('#network:disconnected', () => {
|
|
564
752
|
it('should trigger event upon mercury disconnect', () => {
|
|
565
753
|
const {meetings} = webex;
|
|
566
|
-
const SCOPE = {
|
|
754
|
+
const SCOPE = {
|
|
755
|
+
file: 'meetings/index', function: 'handleMercuryOffline'
|
|
756
|
+
};
|
|
567
757
|
const EVENT = 'network:disconnected';
|
|
568
758
|
|
|
759
|
+
TriggerProxy.trigger.reset();
|
|
760
|
+
|
|
569
761
|
meetings.handleMercuryOffline = sinon.spy(meetings.handleMercuryOffline);
|
|
570
762
|
webex.internal.mercury.disconnect = sinon.stub().callsFake(meetings.handleMercuryOffline);
|
|
571
763
|
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import 'jsdom-global/register';
|
|
5
5
|
import sinon from 'sinon';
|
|
6
6
|
import Metrics from '@webex/internal-plugin-metrics';
|
|
7
|
-
import metrics from '@webex/plugin-meetings/src/metrics';
|
|
8
|
-
import BrowserDetection from '@webex/plugin-meetings/src/common/browser-detection';
|
|
9
7
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
10
8
|
import {browserOnly} from '@webex/test-helper-mocha';
|
|
11
9
|
import {assert} from '@webex/test-helper-chai';
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
getBrowserVersion,
|
|
16
|
-
getOSName,
|
|
17
|
-
getOSVersion
|
|
18
|
-
} = BrowserDetection();
|
|
11
|
+
import metrics from '@webex/plugin-meetings/src/metrics';
|
|
12
|
+
|
|
19
13
|
|
|
20
14
|
/**
|
|
21
15
|
* Meeting can only run in a browser, so we can only send metrics for
|
|
@@ -48,6 +42,7 @@ browserOnly(describe)('Meeting metrics', () => {
|
|
|
48
42
|
clientId: 'mock-client-id'
|
|
49
43
|
}
|
|
50
44
|
};
|
|
45
|
+
webex.config.metrics.type = ['behavioral'];
|
|
51
46
|
webex.internal.metrics.submitClientMetrics = mockSubmitMetric;
|
|
52
47
|
metrics.initialSetup({}, webex);
|
|
53
48
|
});
|
|
@@ -98,10 +93,10 @@ browserOnly(describe)('Meeting metrics', () => {
|
|
|
98
93
|
});
|
|
99
94
|
|
|
100
95
|
it('adds environment information to metric', () => {
|
|
101
|
-
const
|
|
102
|
-
const
|
|
96
|
+
const fields = {value: 567};
|
|
97
|
+
const metricTags = {test: true};
|
|
103
98
|
|
|
104
|
-
metrics.sendBehavioralMetric('myMetric',
|
|
99
|
+
metrics.sendBehavioralMetric('myMetric', fields, metricTags);
|
|
105
100
|
|
|
106
101
|
assert.calledWithMatch(
|
|
107
102
|
mockSubmitMetric,
|
|
@@ -109,27 +104,13 @@ browserOnly(describe)('Meeting metrics', () => {
|
|
|
109
104
|
{
|
|
110
105
|
type: ['behavioral'],
|
|
111
106
|
fields: {
|
|
112
|
-
browser_version: getBrowserVersion(),
|
|
113
|
-
os_version: getOSVersion(),
|
|
114
|
-
sdk_version: '1.2.3',
|
|
115
107
|
value: 567
|
|
116
108
|
},
|
|
117
109
|
tags: {
|
|
118
|
-
org_id: '7890',
|
|
119
|
-
os: getOSName(),
|
|
120
|
-
browser: getBrowserName(),
|
|
121
|
-
domain: window.location.hostname,
|
|
122
110
|
test: true
|
|
123
111
|
}
|
|
124
112
|
}
|
|
125
113
|
);
|
|
126
114
|
});
|
|
127
|
-
|
|
128
|
-
it('throws error if no metric name is given', () => {
|
|
129
|
-
assert.throws(
|
|
130
|
-
() => metrics.sendBehavioralMetric(),
|
|
131
|
-
'Missing behavioral metric name. Please provide one'
|
|
132
|
-
);
|
|
133
|
-
});
|
|
134
115
|
});
|
|
135
116
|
});
|