@webex/plugin-meetings 3.0.0-beta.251 → 3.0.0-beta.253

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.
@@ -25,8 +25,8 @@ describe('plugin-meetings', () => {
25
25
  });
26
26
 
27
27
  describe('#fetchMeetingInfo', () => {
28
- it('should send ca events if meetingId present', async () => {
29
- const body = {meetingKey: '1234323'};
28
+ const checkResolvedFetchMeetingInfo = async ({meetingId, sendCAevents, shouldSendCAMetrics}) => {
29
+ const body = {meetingKey: '1234323', url: 'url-123'};
30
30
 
31
31
  sinon
32
32
  .stub(MeetingInfoUtil, 'generateOptions')
@@ -34,33 +34,62 @@ describe('plugin-meetings', () => {
34
34
  sinon.stub(MeetingInfoRequest.prototype, 'fetchMeetingInfo').returns(Promise.resolve(body));
35
35
 
36
36
  await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, null, null, null, {
37
- meetingId: 'meetingId',
37
+ meetingId,
38
+ sendCAevents,
38
39
  });
39
40
 
40
41
  const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
42
+ const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
41
43
 
42
- assert.deepEqual(submitInternalEventCalls[0].args[0], {
43
- name: 'internal.client.meetinginfo.request',
44
- });
45
- assert.deepEqual(submitInternalEventCalls[1].args[0], {
46
- name: 'internal.client.meetinginfo.response',
47
- });
48
- });
44
+ if (shouldSendCAMetrics) {
45
+ assert.deepEqual(submitInternalEventCalls[0].args[0], {
46
+ name: 'internal.client.meetinginfo.request',
47
+ });
49
48
 
50
- it('should not send ca events if meetingId not present', async () => {
51
- const body = {meetingKey: '1234323'};
49
+ assert.deepEqual(submitClientEventCalls[0].args[0], {
50
+ name: 'client.meetinginfo.request',
51
+ options: {
52
+ meetingId,
53
+ },
54
+ });
52
55
 
53
- sinon
54
- .stub(MeetingInfoUtil, 'generateOptions')
55
- .resolves({type: 'MEETING_ID', destination: '123456'});
56
- sinon.stub(MeetingInfoRequest.prototype, 'fetchMeetingInfo').returns(Promise.resolve(body));
56
+ assert.deepEqual(submitInternalEventCalls[1].args[0], {
57
+ name: 'internal.client.meetinginfo.response',
58
+ });
59
+
60
+ assert.deepEqual(submitClientEventCalls[1].args[0], {
61
+ name: 'client.meetinginfo.response',
62
+ payload: {
63
+ identifiers: {
64
+ meetingLookupUrl: 'url-123',
65
+ },
66
+ },
67
+ options: {
68
+ meetingId,
69
+ },
70
+ });
71
+ } else {
72
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
73
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
74
+ }
75
+ }
76
+ it('should send ca events if meetingId present and send CA events is authorized', async () => {
77
+ checkResolvedFetchMeetingInfo({meetingId: 'meetingId', sendCAevents: true, shouldSendCAMetrics: true});
78
+ });
57
79
 
58
- await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, null, null, null);
80
+ it('should not send ca events if meetingId not present even if CA events are authorized', async () => {
81
+ checkResolvedFetchMeetingInfo({sendCAevents: true, shouldSendCAMetrics: false});
82
+ });
83
+
84
+ it('should not send ca events if CA events are not authorized', async () => {
85
+ checkResolvedFetchMeetingInfo({meetingId: 'meetingId', shouldSendCAMetrics: false});
86
+ });
59
87
 
60
- assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
88
+ it('should not send ca events if meeting id is not present and CA events are not authorized', async () => {
89
+ checkResolvedFetchMeetingInfo({shouldSendCAMetrics: false});
61
90
  });
62
91
 
63
- it('should send ca events when fails and if meetingId present', async () => {
92
+ const checkFailingFetchMeetingInfo = async ({meetingId, sendCAevents, shouldSendCAMetrics}) => {
64
93
  const reject = {
65
94
  statusCode: 403,
66
95
  body: {message: 'msg', code: 403102, data: {meetingInfo: {}}},
@@ -84,32 +113,66 @@ describe('plugin-meetings', () => {
84
113
  null,
85
114
  null,
86
115
  {
87
- meetingId: 'meetingId',
116
+ meetingId,
117
+ sendCAevents,
88
118
  }
89
119
  );
90
120
  } catch (err) {
91
121
  const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
122
+ const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
92
123
 
93
- assert.deepEqual(submitInternalEventCalls[0].args[0], {
94
- name: 'internal.client.meetinginfo.request',
95
- });
124
+ if(shouldSendCAMetrics) {
125
+ assert.deepEqual(submitInternalEventCalls[0].args[0], {
126
+ name: 'internal.client.meetinginfo.request',
127
+ });
96
128
 
97
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
98
- name: 'client.meetinginfo.response',
99
- payload: {
100
- identifiers: {
101
- meetingLookupUrl: 'http://api-url.com',
129
+ assert.deepEqual(submitClientEventCalls[0].args[0], {
130
+ name: 'client.meetinginfo.request',
131
+ options: {
132
+ meetingId: 'meetingId',
102
133
  },
103
- },
104
- options: {
105
- meetingId: 'meetingId',
106
- rawError: err,
107
- },
108
- });
134
+ });
135
+
136
+ assert.deepEqual(submitInternalEventCalls[1].args[0], {
137
+ name: 'internal.client.meetinginfo.response',
138
+ });
139
+
140
+ assert.deepEqual(submitClientEventCalls[1].args[0], {
141
+ name: 'client.meetinginfo.response',
142
+ payload: {
143
+ identifiers: {
144
+ meetingLookupUrl: 'http://api-url.com',
145
+ },
146
+ },
147
+ options: {
148
+ meetingId: 'meetingId',
149
+ rawError: err,
150
+ },
151
+ });
152
+ } else {
153
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
154
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
155
+ }
109
156
  }
157
+ }
158
+
159
+ it('should send ca events when fails if meetingId present and CA events are authorized', async () => {
160
+ checkFailingFetchMeetingInfo({meetingId: 'meetingId', sendCAevents: true, shouldSendCAMetrics: true})
161
+ });
162
+
163
+ it('should not send ca events when fails if meetingId present and CA events are not authorized', async () => {
164
+ checkFailingFetchMeetingInfo({meetingId: 'meetingId', shouldSendCAMetrics: false})
165
+ });
166
+
167
+ it('should not send ca events when fails if meetingId not present even if CA events are authorized', async () => {
168
+ checkFailingFetchMeetingInfo({sendCAevents: true, shouldSendCAMetrics: false})
169
+ });
170
+
171
+ it('should not send ca events when fails if meetingId not present and CA events are not authorized', async () => {
172
+ checkFailingFetchMeetingInfo({shouldSendCAMetrics: false})
110
173
  });
111
174
 
112
- it('should send ca events when in the retry as well if meetingId present', async () => {
175
+ const checkRetryFetchMeetingInfo = async ({meetingId, sendCAevents, shouldSendCAMetrics}) => {
113
176
  const reject = {
114
177
  statusCode: 403,
115
178
  body: {message: 'msg', code: 403102, data: {meetingInfo: {}}},
@@ -118,7 +181,7 @@ describe('plugin-meetings', () => {
118
181
 
119
182
  sinon
120
183
  .stub(MeetingInfoUtil, 'generateOptions')
121
- .resolves({type: 'MEETING_LINK', destination: '123456'});
184
+ .resolves({type: 'MEETING_LINK', destination: '123456', url: 'success-url-123'});
122
185
  const requestStub = sinon
123
186
  .stub(MeetingInfoRequest.prototype, 'fetchMeetingInfo')
124
187
  .rejects(reject);
@@ -133,48 +196,97 @@ describe('plugin-meetings', () => {
133
196
  null,
134
197
  null,
135
198
  {
136
- meetingId: 'meetingId',
199
+ meetingId,
200
+ sendCAevents,
137
201
  }
138
202
  );
139
203
  assert.fail('fetchMeetingInfo should have thrown, but has not done that');
140
204
  } catch (err) {
141
205
  let submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
206
+ let submitClientEventCalls = webex.internal.newMetrics.submitClientlEvent.getCalls();
142
207
 
143
- assert.deepEqual(submitInternalEventCalls[0].args[0], {
144
- name: 'internal.client.meetinginfo.request',
145
- });
208
+ if(shouldSendCAMetrics) {
209
+ assert.deepEqual(submitInternalEventCalls[0].args[0], {
210
+ name: 'internal.client.meetinginfo.request',
211
+ });
146
212
 
147
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
148
- name: 'client.meetinginfo.response',
149
- payload: {
150
- identifiers: {
151
- meetingLookupUrl: 'http://api-url.com',
152
- },
153
- },
154
- options: {
155
- meetingId: 'meetingId',
156
- rawError: err,
157
- },
158
- });
213
+ assert.deepEqual(submitClientEventCalls[0].args[0], {
214
+ name: 'client.meetinginfo.request',
215
+ });
159
216
 
160
- assert.deepEqual(submitInternalEventCalls[1].args[0], {
161
- name: 'internal.client.meetinginfo.response',
162
- });
217
+ assert.deepEqual(submitInternalEventCalls[1].args[0], {
218
+ name: 'internal.client.meetinginfo.response',
219
+ });
220
+
221
+ assert.deepEqual(submitClientEventCalls[1].args[0], {
222
+ name: 'client.meetinginfo.response',
223
+ payload: {
224
+ identifiers: {
225
+ meetingLookupUrl: 'http://api-url.com',
226
+ },
227
+ },
228
+ options: {
229
+ meetingId: 'meetingId',
230
+ rawError: err,
231
+ },
232
+ });
163
233
 
164
- assert.deepEqual(submitInternalEventCalls[2].args[0], {
165
- name: 'internal.client.meetinginfo.request',
166
- });
234
+ assert.deepEqual(submitInternalEventCalls[2].args[0], {
235
+ name: 'internal.client.meetinginfo.request',
236
+ });
237
+
238
+ assert.deepEqual(submitClientEventCalls[2].args[0], {
239
+ name: 'client.meetinginfo.request',
240
+ payload: {
241
+ identifiers: {
242
+ meetingLookupUrl: 'success-url-123',
243
+ },
244
+ },
245
+ });
246
+ } else {
247
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
248
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
249
+ }
167
250
 
168
251
  requestStub.resolves({});
169
252
 
170
253
  await flushPromises();
171
254
 
172
255
  submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
256
+ submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
173
257
 
174
- assert.deepEqual(submitInternalEventCalls[3].args[0], {
175
- name: 'internal.client.meetinginfo.response',
176
- });
258
+ if(shouldSendInternalCAMetrics) {
259
+ assert.deepEqual(submitInternalEventCalls[3].args[0], {
260
+ name: 'internal.client.meetinginfo.response',
261
+ });
262
+ } else {
263
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
264
+ }
265
+
266
+ if(shouldSendCAMetrics) {
267
+ assert.deepEqual(submitClientEventCalls[3].args[0], {
268
+ name: 'internal.client.meetinginfo.response',
269
+ });
270
+ } else {
271
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
272
+ }
177
273
  }
274
+ }
275
+
276
+ it('should send ca events when in the retry as well if meetingId present and CA events are authorized', async () => {
277
+ checkRetryFetchMeetingInfo({meetingId: 'meetingId', sendCAevents: true, shouldSendCAMetrics: true})
278
+ });
279
+
280
+ it('should not send ca events when in the retry as well if meetingId not present and CA events are authorized', async () => {
281
+ checkRetryFetchMeetingInfo({sendCAevents: true, shouldSendCAMetrics: false})
282
+ });
283
+
284
+ it('should not send ca events when in the retry as well if meetingId present and CA events are not authorized', async () => {
285
+ checkRetryFetchMeetingInfo({meetingId: 'meetingId', shouldSendCAMetrics: false})
286
+ });
287
+
288
+ it('should not send ca events when in the retry as well if meetingId not present and CA events are not authorized', async () => {
289
+ checkRetryFetchMeetingInfo({shouldSendCAMetrics: false})
178
290
  });
179
291
  });
180
292
  });
@@ -373,14 +373,26 @@ describe('plugin-meetings', () => {
373
373
 
374
374
  forEach(
375
375
  [
376
+ {errorCode: 403049, sendCAevents: false},
377
+ {errorCode: 403049, sendCAevents: true},
376
378
  {errorCode: 403049},
379
+ {errorCode: 403104, sendCAevents: false},
380
+ {errorCode: 403104, sendCAevents: true},
377
381
  {errorCode: 403104},
382
+ {errorCode: 403103, sendCAevents: false},
383
+ {errorCode: 403103, sendCAevents: true},
378
384
  {errorCode: 403103},
385
+ {errorCode: 403048, sendCAevents: false},
386
+ {errorCode: 403048, sendCAevents: true},
379
387
  {errorCode: 403048},
388
+ {errorCode: 403102, sendCAevents: false},
389
+ {errorCode: 403102, sendCAevents: true},
380
390
  {errorCode: 403102},
391
+ {errorCode: 403101, sendCAevents: false},
392
+ {errorCode: 403101, sendCAevents: true},
381
393
  {errorCode: 403101},
382
394
  ],
383
- ({errorCode}) => {
395
+ ({errorCode, sendCAevents}) => {
384
396
  it(`should throw a MeetingInfoV2PolicyError for error code ${errorCode}`, async () => {
385
397
  const message = 'a message';
386
398
  const meetingInfoData = 'meeting info';
@@ -402,34 +414,48 @@ describe('plugin-meetings', () => {
402
414
  null,
403
415
  null,
404
416
  {},
405
- {meetingId: 'meeting-id'}
417
+ {meetingId: 'meeting-id', sendCAevents}
406
418
  );
407
419
  assert.fail('fetchMeetingInfo should have thrown, but has not done that');
408
420
  } catch (err) {
409
- assert(webex.internal.newMetrics.submitClientEvent.calledOnce);
410
421
  const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
411
- assert.deepEqual(submitInternalEventCalls[0].args[0], {
412
- name: 'internal.client.meetinginfo.request',
413
- });
414
- assert.deepEqual(submitInternalEventCalls[1].args[0], {
415
- name: 'internal.client.meetinginfo.response',
416
- });
417
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
418
- name: 'client.meetinginfo.response',
419
- payload: {
420
- identifiers: {
421
- meetingLookupUrl: 'http://api-url.com',
422
+ const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
423
+
424
+ if (sendCAevents) {
425
+ assert.deepEqual(submitInternalEventCalls[0].args[0], {
426
+ name: 'internal.client.meetinginfo.request',
427
+ });
428
+
429
+ assert.deepEqual(submitClientEventCalls[0].args[0], {
430
+ name: 'client.meetinginfo.request',
431
+ options: {
432
+ meetingId: 'meeting-id'
422
433
  },
423
- },
424
- options: {
425
- meetingId: 'meeting-id',
426
- rawError: {
427
- statusCode: 403,
428
- body: {message, code: errorCode, data: {meetingInfo: meetingInfoData}},
429
- url: 'http://api-url.com',
434
+ });
435
+
436
+ assert.deepEqual(submitInternalEventCalls[1].args[0], {
437
+ name: 'internal.client.meetinginfo.response',
438
+ });
439
+
440
+ assert.deepEqual(submitClientEventCalls[1].args[0], {
441
+ name: 'client.meetinginfo.response',
442
+ payload: {
443
+ identifiers: {
444
+ meetingLookupUrl: 'http://api-url.com',
445
+ },
430
446
  },
431
- },
432
- });
447
+ options: {
448
+ meetingId: 'meeting-id',
449
+ rawError: {
450
+ statusCode: 403,
451
+ body: {message, code: errorCode, data: {meetingInfo: meetingInfoData}},
452
+ url: 'http://api-url.com',
453
+ },
454
+ },
455
+ });
456
+ } else {
457
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
458
+ }
433
459
 
434
460
  assert.instanceOf(err, MeetingInfoV2PolicyError);
435
461
  assert.deepEqual(err.message, `${message}, code=${errorCode}`);
@@ -446,7 +472,86 @@ describe('plugin-meetings', () => {
446
472
  }
447
473
  );
448
474
 
449
- it('should send internal CA metric if meetingId is provided', async () => {
475
+ forEach(
476
+ [
477
+ {meetingId: '123', sendCAevents: true, shouldSendCAevents: true},
478
+ {sendCAevents: true, shouldSendCAevents: false},
479
+ {meetingId: '123', sendCAevents: false, shouldSendCAevents: false},
480
+ {shouldSendCAevents: false},
481
+ ],
482
+ ({meetingId, sendCAevents, shouldSendCAevents}) => {
483
+ it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
484
+ const requestResponse = {statusCode: 200, body: {meetingKey: '1234323'}};
485
+ const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
486
+
487
+ webex.request.resolves(requestResponse);
488
+
489
+ const result = await meetingInfo.fetchMeetingInfo(
490
+ '1234323',
491
+ _MEETING_ID_,
492
+ null,
493
+ null,
494
+ null,
495
+ null,
496
+ extraParams,
497
+ {meetingId, sendCAevents}
498
+ );
499
+
500
+ assert.calledWith(webex.request, {
501
+ method: 'POST',
502
+ service: WBXAPPAPI_SERVICE,
503
+ resource: 'meetingInfo',
504
+ body: {
505
+ supportHostKey: true,
506
+ supportCountryList: true,
507
+ meetingKey: '1234323',
508
+ ...extraParams,
509
+ },
510
+ });
511
+ assert.deepEqual(result, requestResponse);
512
+ assert(Metrics.sendBehavioralMetric.calledOnce);
513
+ assert.calledWith(
514
+ Metrics.sendBehavioralMetric,
515
+ BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS
516
+ );
517
+
518
+ const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
519
+ const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
520
+
521
+ if(shouldSendCAevents) {
522
+ assert.deepEqual(submitInternalEventCalls[0].args[0], {
523
+ name: 'internal.client.meetinginfo.request',
524
+ });
525
+ assert.deepEqual(submitClientEventCalls[0].args[0], {
526
+ name: 'client.meetinginfo.request',
527
+ options: {
528
+ meetingId,
529
+ }
530
+ });
531
+
532
+ assert.deepEqual(submitInternalEventCalls[1].args[0], {
533
+ name: 'internal.client.meetinginfo.response',
534
+ });
535
+ assert.deepEqual(submitClientEventCalls[1].args[0], {
536
+ name: 'client.meetinginfo.response',
537
+ payload: {
538
+ identifiers: {
539
+ meetingLookupUrl: result?.url,
540
+ },
541
+ },
542
+ options: {
543
+ meetingId,
544
+ }
545
+ });
546
+ } else {
547
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
548
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
549
+ }
550
+ })
551
+ }
552
+ )
553
+
554
+ it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
450
555
  const requestResponse = {statusCode: 200, body: {meetingKey: '1234323'}};
451
556
  const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
452
557
 
@@ -460,7 +565,7 @@ describe('plugin-meetings', () => {
460
565
  null,
461
566
  null,
462
567
  extraParams,
463
- {meetingId: 'meetingId'}
568
+ {meetingId: 'meetingId', sendCAevents: true}
464
569
  );
465
570
 
466
571
  assert.calledWith(webex.request, {
@@ -482,42 +587,71 @@ describe('plugin-meetings', () => {
482
587
  );
483
588
 
484
589
  const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
590
+ const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
591
+
485
592
  assert.deepEqual(submitInternalEventCalls[0].args[0], {
486
593
  name: 'internal.client.meetinginfo.request',
487
594
  });
595
+ assert.deepEqual(submitClientEventCalls[0].args[0], {
596
+ name: 'client.meetinginfo.request',
597
+ options: {
598
+ meetingId: 'meetingId',
599
+ }
600
+ });
601
+
488
602
  assert.deepEqual(submitInternalEventCalls[1].args[0], {
489
603
  name: 'internal.client.meetinginfo.response',
490
604
  });
605
+ assert.deepEqual(submitClientEventCalls[1].args[0], {
606
+ name: 'client.meetinginfo.response',
607
+ payload: {
608
+ identifiers: {
609
+ meetingLookupUrl: result?.url,
610
+ },
611
+ },
612
+ options: {
613
+ meetingId: 'meetingId',
614
+ }
615
+ });
491
616
  });
492
617
 
493
- it('should not send CA metric if meetingId is not provided', async () => {
494
- const message = 'a message';
495
- const meetingInfoData = 'meeting info';
496
-
497
- webex.request = sinon.stub().rejects({
498
- statusCode: 403,
499
- body: {message, code: 403102, data: {meetingInfo: meetingInfoData}},
500
- url: 'http://api-url.com',
501
- });
502
- try {
503
- await meetingInfo.fetchMeetingInfo(
504
- '1234323',
505
- _MEETING_ID_,
506
- 'abc',
507
- {
508
- id: '999',
509
- code: 'aabbcc11',
510
- },
511
- null,
512
- null,
513
- undefined
514
- );
515
- assert.fail('fetchMeetingInfo should have thrown, but has not done that');
516
- } catch (err) {
517
- assert.notCalled(webex.internal.newMetrics.submitClientEvent);
518
- assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
618
+ forEach(
619
+ [
620
+ {sendCAevents: true},
621
+ {sendCAevents: false},
622
+ ],
623
+ ({sendCAevents}) => {
624
+ it(`should not send CA metric if meetingId is not provided disregarding if sendCAevents is ${sendCAevents}`, async () => {
625
+ const message = 'a message';
626
+ const meetingInfoData = 'meeting info';
627
+
628
+ webex.request = sinon.stub().rejects({
629
+ statusCode: 403,
630
+ body: {message, code: 403102, data: {meetingInfo: meetingInfoData}},
631
+ url: 'http://api-url.com',
632
+ });
633
+ try {
634
+ await meetingInfo.fetchMeetingInfo(
635
+ '1234323',
636
+ _MEETING_ID_,
637
+ 'abc',
638
+ {
639
+ id: '999',
640
+ code: 'aabbcc11',
641
+ },
642
+ null,
643
+ null,
644
+ undefined,
645
+ {meetingId: undefined, sendCAevents}
646
+ );
647
+ assert.fail('fetchMeetingInfo should have thrown, but has not done that');
648
+ } catch (err) {
649
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
650
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
651
+ }
652
+ });
519
653
  }
520
- });
654
+ );
521
655
 
522
656
  it('should throw MeetingInfoV2PasswordError for 403 response', async () => {
523
657
  const FAKE_MEETING_INFO = {blablabla: 'some_fake_meeting_info'};
@@ -1068,13 +1068,14 @@ describe('plugin-meetings', () => {
1068
1068
  destination,
1069
1069
  type,
1070
1070
  extraParams = {},
1071
- expectedMeetingData = {}
1071
+ expectedMeetingData = {},
1072
+ sendCAevents = false,
1072
1073
  ) => {
1073
1074
  assert.calledOnce(webex.meetings.meetingInfo.fetchMeetingInfo);
1074
1075
  assert.calledOnce(MeetingsUtil.getMeetingAddedType);
1075
1076
  assert.notCalled(setTimeoutSpy);
1076
1077
  assert.callCount(TriggerProxy.trigger, 5);
1077
- assert.calledWith(webex.meetings.meetingInfo.fetchMeetingInfo, destination, type, null, null, undefined, undefined, extraParams, {meetingId: meeting.id});
1078
+ assert.calledWith(webex.meetings.meetingInfo.fetchMeetingInfo, destination, type, null, null, undefined, undefined, extraParams, {meetingId: meeting.id, sendCAevents});
1078
1079
  assert.calledWith(MeetingsUtil.getMeetingAddedType, 'test type');
1079
1080
 
1080
1081
  if (expectedMeetingData.permissionToken) {
@@ -1334,7 +1335,7 @@ describe('plugin-meetings', () => {
1334
1335
  correlationId: 'my-correlationId',
1335
1336
  };
1336
1337
 
1337
- checkCreateWithoutDelay(meeting, 'test destination', 'test type', {}, expectedMeetingData);
1338
+ checkCreateWithoutDelay(meeting, 'test destination', 'test type', {}, expectedMeetingData, true);
1338
1339
  })
1339
1340
  });
1340
1341