@webex/plugin-meetings 3.8.0-next.27 → 3.8.0-next.29

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.
@@ -7,10 +7,7 @@ import sinon from 'sinon';
7
7
  import MockWebex from '@webex/test-helper-mock-webex';
8
8
  import Device from '@webex/internal-plugin-device';
9
9
  import Mercury from '@webex/internal-plugin-mercury';
10
- import {
11
- DESTINATION_TYPE,
12
- WBXAPPAPI_SERVICE,
13
- } from '@webex/plugin-meetings/src/constants';
10
+ import {DESTINATION_TYPE, WBXAPPAPI_SERVICE} from '@webex/plugin-meetings/src/constants';
14
11
 
15
12
  import Meetings from '@webex/plugin-meetings/src/meetings';
16
13
  import MeetingInfo, {
@@ -20,6 +17,8 @@ import MeetingInfo, {
20
17
  MeetingInfoV2PolicyError,
21
18
  MeetingInfoV2JoinWebinarError,
22
19
  MeetingInfoV2JoinForbiddenError,
20
+ MeetingInfoV2MeetingIsInProgressError,
21
+ MeetingInfoV2StaticMeetingLinkAlreadyExists,
23
22
  } from '@webex/plugin-meetings/src/meeting-info/meeting-info-v2';
24
23
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
25
24
  import Metrics from '@webex/plugin-meetings/src/metrics';
@@ -93,6 +92,223 @@ describe('plugin-meetings', () => {
93
92
  meetingInfo = new MeetingInfo(webex);
94
93
  });
95
94
 
95
+ describe('#enableStaticMeetingLink', () => {
96
+ const setup = () => {
97
+ const invitee = [];
98
+
99
+ invitee.push({
100
+ email: conversation.participants.items[0].emailAddress,
101
+ ciUserUuid: conversation.participants.items[0].entryUUID,
102
+ });
103
+
104
+ invitee.push({
105
+ email: conversation.participants.items[1].emailAddress,
106
+ ciUserUuid: conversation.participants.items[1].entryUUID,
107
+ });
108
+
109
+ return {invitee};
110
+ };
111
+
112
+ it('should enable static meeting link', async () => {
113
+ const {invitee} = setup();
114
+ const installedOrgID = '12345';
115
+ const conversationUrl = 'conv.fakeconversationurl.com';
116
+ webex.request.resolves({
117
+ statusCode: 200,
118
+ body: conversation,
119
+ });
120
+ const result = await meetingInfo.enableStaticMeetingLink(conversationUrl);
121
+
122
+ assert.calledWith(webex.request, {
123
+ uri: conversationUrl,
124
+ qs: {includeParticipants: true},
125
+ disableTransform: true,
126
+ });
127
+
128
+ assert.calledWith(webex.request, {
129
+ method: 'POST',
130
+ uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`,
131
+ body: {
132
+ title: conversation.displayName,
133
+ spaceUrl: conversation.url,
134
+ keyUrl: conversation.encryptionKeyUrl,
135
+ kroUrl: conversation.kmsResourceObjectUrl,
136
+ invitees: invitee,
137
+ installedOrgID: undefined,
138
+ schedule: true,
139
+ },
140
+ });
141
+
142
+ assert(Metrics.sendBehavioralMetric.calledOnce);
143
+ assert.calledWith(
144
+ Metrics.sendBehavioralMetric,
145
+ BEHAVIORAL_METRICS.ENABLE_STATIC_METTING_LINK_SUCCESS
146
+ );
147
+
148
+ assert.deepEqual(result, {
149
+ body: conversation,
150
+ statusCode: 200,
151
+ });
152
+ });
153
+
154
+ it('should not enable static meeting link for given conversation url if no preferred webex site', async () => {
155
+ webex.meetings.preferredWebexSite = undefined;
156
+
157
+ const conversationUrl = 'conv.fakeconversationurl.com';
158
+ try {
159
+ await meetingInfo.enableStaticMeetingLink(conversationUrl);
160
+
161
+ assert.calledWith(webex.request, {
162
+ method: 'POST',
163
+ uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`,
164
+ body,
165
+ });
166
+ } catch (err) {
167
+ assert.deepEqual(err.message, 'No preferred webex site found');
168
+ assert.notCalled(webex.request);
169
+ }
170
+ });
171
+
172
+ it('handles error for MeetingInfoV2MeetingIsInProgressError', async () => {
173
+ const conversationUrl = 'conv.fakeconversationurl.com';
174
+ webex.request = sinon
175
+ .stub()
176
+ .rejects({stack: 'a stack', message: 'a message', statusCode: 403, body: {code: 33003}});
177
+ try {
178
+ await meetingInfo.enableStaticMeetingLink(conversationUrl);
179
+ } catch (err) {
180
+ assert.equal(err.wbxAppApiCode, 33003);
181
+ assert.instanceOf(err, MeetingInfoV2MeetingIsInProgressError);
182
+ assert.deepEqual(err.message, 'Meeting is in progress, code=33003, enable=true');
183
+ assert.calledWith(
184
+ Metrics.sendBehavioralMetric,
185
+ BEHAVIORAL_METRICS.MEETING_IS_IN_PROGRESS_ERROR,
186
+ {reason: 'a message', stack: 'a stack'}
187
+ );
188
+ }
189
+ });
190
+
191
+ it('handles error for MeetingInfoV2StaticMeetingLinkAlreadyExists', async () => {
192
+ const conversationUrl = 'conv.fakeconversationurl.com';
193
+ webex.request = sinon
194
+ .stub()
195
+ .rejects({stack: 'a stack', message: 'a message', statusCode: 409, body: {code: 409000}});
196
+ try {
197
+ await meetingInfo.enableStaticMeetingLink(conversationUrl);
198
+ } catch (err) {
199
+ assert.equal(err.wbxAppApiCode, 409000);
200
+ assert.instanceOf(err, MeetingInfoV2StaticMeetingLinkAlreadyExists);
201
+ assert.deepEqual(err.message, 'Static meeting link already exists, code=409000');
202
+ assert.calledWith(
203
+ Metrics.sendBehavioralMetric,
204
+ BEHAVIORAL_METRICS.STATIC_MEETING_LINK_ALREADY_EXISTS_ERROR,
205
+ {reason: 'a message', stack: 'a stack'}
206
+ );
207
+ }
208
+ });
209
+
210
+ it('handles generic error when enabling static link', async () => {
211
+ const conversationUrl = 'conv.fakeconversationurl.com';
212
+ webex.request = sinon
213
+ .stub()
214
+ .rejects({stack: 'a stack', message: 'a message', statusCode: 500, body: {code: 400000}});
215
+ try {
216
+ await meetingInfo.enableStaticMeetingLink(conversationUrl);
217
+ } catch (err) {
218
+ assert(Metrics.sendBehavioralMetric.calledOnce);
219
+ assert.calledWith(
220
+ Metrics.sendBehavioralMetric,
221
+ BEHAVIORAL_METRICS.ENABLE_STATIC_METTING_LINK_FAILURE,
222
+ {reason: 'a message', stack: 'a stack'}
223
+ );
224
+ }
225
+ });
226
+ });
227
+
228
+ describe('#disableStaticMeetingLink', () => {
229
+ it('should disable static meeting link for given conversation url', async () => {
230
+ const conversationUrl = 'conv.fakeconversationurl.com';
231
+ const body = {spaceUrl: conversationUrl};
232
+ const requestResponse = {statusCode: 204};
233
+ webex.request.resolves(requestResponse);
234
+ const result = await meetingInfo.disableStaticMeetingLink(conversationUrl);
235
+
236
+ assert.calledWith(webex.request, {
237
+ method: 'POST',
238
+ uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant/deletePersistentMeeting`,
239
+ body,
240
+ });
241
+
242
+ assert(Metrics.sendBehavioralMetric.calledOnce);
243
+ assert.calledWith(
244
+ Metrics.sendBehavioralMetric,
245
+ BEHAVIORAL_METRICS.DISABLE_STATIC_MEETING_LINK_SUCCESS
246
+ );
247
+
248
+ assert.deepEqual(result, requestResponse);
249
+ });
250
+
251
+ it('should not disable static meeting link for given conversation url if no preferred webex site', async () => {
252
+ webex.meetings.preferredWebexSite = undefined;
253
+
254
+ const conversationUrl = 'conv.fakeconversationurl.com';
255
+ try {
256
+ await meetingInfo.disableStaticMeetingLink(conversationUrl);
257
+
258
+ assert.calledWith(webex.request, {
259
+ method: 'POST',
260
+ uri: `https://${webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant/deletePersistentMeeting`,
261
+ body,
262
+ });
263
+ } catch (err) {
264
+ assert.deepEqual(err.message, 'No preferred webex site found');
265
+ assert.notCalled(webex.request);
266
+ }
267
+ });
268
+
269
+ it('handles error for MeetingInfoV2MeetingIsInProgressError for disable', async () => {
270
+ const conversationUrl = 'conv.fakeconversationurl.com';
271
+ webex.request = sinon.stub().rejects({
272
+ stack: 'a stack',
273
+ message: 'a message',
274
+ statusCode: 403,
275
+ body: {code: 33003},
276
+ });
277
+ try {
278
+ await meetingInfo.disableStaticMeetingLink(conversationUrl);
279
+ } catch (err) {
280
+ assert.equal(err.wbxAppApiCode, 33003);
281
+ assert.instanceOf(err, MeetingInfoV2MeetingIsInProgressError);
282
+ assert.deepEqual(err.message, 'Meeting is in progress, code=33003, enable=false');
283
+ assert.calledWith(
284
+ Metrics.sendBehavioralMetric,
285
+ BEHAVIORAL_METRICS.MEETING_IS_IN_PROGRESS_ERROR,
286
+ {reason: 'a message', stack: 'a stack'}
287
+ );
288
+ }
289
+ });
290
+
291
+ it('handles generic error when disabling static link', async () => {
292
+ const conversationUrl = 'conv.fakeconversationurl.com';
293
+ webex.request = sinon.stub().rejects({
294
+ stack: 'a stack',
295
+ message: 'a message',
296
+ statusCode: 500,
297
+ body: {code: 400000},
298
+ });
299
+ try {
300
+ await meetingInfo.disableStaticMeetingLink(conversationUrl);
301
+ } catch (err) {
302
+ assert(Metrics.sendBehavioralMetric.calledOnce);
303
+ assert.calledWith(
304
+ Metrics.sendBehavioralMetric,
305
+ BEHAVIORAL_METRICS.DISABLE_STATIC_MEETING_LINK_FAILURE,
306
+ {reason: 'a message', stack: 'a stack'}
307
+ );
308
+ }
309
+ });
310
+ });
311
+
96
312
  describe('#fetchMeetingInfo', () => {
97
313
  it('should fetch meeting info for the destination type', async () => {
98
314
  const body = {meetingKey: '1234323'};
@@ -151,14 +367,20 @@ describe('plugin-meetings', () => {
151
367
  const body = {meetingKey: '1234323'};
152
368
  const requestResponse = {statusCode: 200, body};
153
369
 
154
- sinon
155
- .stub(MeetingInfoUtil, 'getDestinationType')
156
- .returns(Promise.resolve({type: DESTINATION_TYPE.SIP_URI, destination: 'example@something.webex.com'}));
370
+ sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(
371
+ Promise.resolve({
372
+ type: DESTINATION_TYPE.SIP_URI,
373
+ destination: 'example@something.webex.com',
374
+ })
375
+ );
157
376
  sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve(body));
158
377
  sinon.stub(MeetingInfoUtil, 'getDirectMeetingInfoURI').returns('https://example.com');
159
378
  webex.request.resolves(requestResponse);
160
379
 
161
- const result = await meetingInfo.fetchMeetingInfo('example@something.webex.com', DESTINATION_TYPE.SIP_URI);
380
+ const result = await meetingInfo.fetchMeetingInfo(
381
+ 'example@something.webex.com',
382
+ DESTINATION_TYPE.SIP_URI
383
+ );
162
384
 
163
385
  assert.calledWith(MeetingInfoUtil.getDestinationType, {
164
386
  destination: 'example@something.webex.com',
@@ -186,10 +408,15 @@ describe('plugin-meetings', () => {
186
408
 
187
409
  webex.request.resolves(requestResponse);
188
410
 
189
- const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
190
- id: '999',
191
- code: 'aabbcc11',
192
- });
411
+ const result = await meetingInfo.fetchMeetingInfo(
412
+ '1234323',
413
+ DESTINATION_TYPE.MEETING_ID,
414
+ 'abc',
415
+ {
416
+ id: '999',
417
+ code: 'aabbcc11',
418
+ }
419
+ );
193
420
 
194
421
  assert.calledWith(webex.request, {
195
422
  method: 'POST',
@@ -218,7 +445,13 @@ describe('plugin-meetings', () => {
218
445
 
219
446
  webex.request.resolves(requestResponse);
220
447
 
221
- const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, installedOrgID);
448
+ const result = await meetingInfo.fetchMeetingInfo(
449
+ '1234323',
450
+ DESTINATION_TYPE.MEETING_ID,
451
+ null,
452
+ null,
453
+ installedOrgID
454
+ );
222
455
 
223
456
  assert.calledWith(webex.request, {
224
457
  method: 'POST',
@@ -245,7 +478,14 @@ describe('plugin-meetings', () => {
245
478
 
246
479
  webex.request.resolves(requestResponse);
247
480
 
248
- const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, null, locusId);
481
+ const result = await meetingInfo.fetchMeetingInfo(
482
+ '1234323',
483
+ DESTINATION_TYPE.MEETING_ID,
484
+ null,
485
+ null,
486
+ null,
487
+ locusId
488
+ );
249
489
 
250
490
  assert.calledWith(webex.request, {
251
491
  method: 'POST',
@@ -268,11 +508,19 @@ describe('plugin-meetings', () => {
268
508
 
269
509
  it('should fetch meeting info with provided extraParams', async () => {
270
510
  const requestResponse = {statusCode: 200, body: {meetingKey: '1234323'}};
271
- const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
511
+ const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'};
272
512
 
273
513
  webex.request.resolves(requestResponse);
274
514
 
275
- const result = await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, null, null, null, null, extraParams);
515
+ const result = await meetingInfo.fetchMeetingInfo(
516
+ '1234323',
517
+ DESTINATION_TYPE.MEETING_ID,
518
+ null,
519
+ null,
520
+ null,
521
+ null,
522
+ extraParams
523
+ );
276
524
 
277
525
  assert.calledWith(webex.request, {
278
526
  method: 'POST',
@@ -305,7 +553,7 @@ describe('plugin-meetings', () => {
305
553
  it('create adhoc meeting when conversationUrl and installedOrgID passed with enableAdhocMeetings toggle', async () => {
306
554
  sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
307
555
 
308
- const installedOrgID = '12345'
556
+ const installedOrgID = '12345';
309
557
 
310
558
  await meetingInfo.fetchMeetingInfo(
311
559
  'conversationUrl',
@@ -324,7 +572,6 @@ describe('plugin-meetings', () => {
324
572
  meetingInfo.createAdhocSpaceMeeting.restore();
325
573
  });
326
574
 
327
-
328
575
  it('should not call createAdhocSpaceMeeting if enableAdhocMeetings toggle is off', async () => {
329
576
  webex.config.meetings.experimental.enableAdhocMeetings = false;
330
577
  sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
@@ -350,7 +597,9 @@ describe('plugin-meetings', () => {
350
597
  it('should throw an error MeetingInfoV2AdhocMeetingError if not able to start adhoc meeting for a conversation', async () => {
351
598
  webex.config.meetings.experimental.enableAdhocMeetings = true;
352
599
 
353
- webex.request = sinon.stub().rejects({stack: 'a stack', message: 'a message', statusCode: 403, body: {code: 400000}});
600
+ webex.request = sinon
601
+ .stub()
602
+ .rejects({stack: 'a stack', message: 'a message', statusCode: 403, body: {code: 400000}});
354
603
  try {
355
604
  await meetingInfo.createAdhocSpaceMeeting('conversationUrl');
356
605
  } catch (err) {
@@ -416,7 +665,8 @@ describe('plugin-meetings', () => {
416
665
  );
417
666
  assert.fail('fetchMeetingInfo should have thrown, but has not done that');
418
667
  } catch (err) {
419
- const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
668
+ const submitInternalEventCalls =
669
+ webex.internal.newMetrics.submitInternalEvent.getCalls();
420
670
  const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
421
671
 
422
672
  if (sendCAevents) {
@@ -427,7 +677,7 @@ describe('plugin-meetings', () => {
427
677
  assert.deepEqual(submitClientEventCalls[0].args[0], {
428
678
  name: 'client.meetinginfo.request',
429
679
  options: {
430
- meetingId: 'meeting-id'
680
+ meetingId: 'meeting-id',
431
681
  },
432
682
  });
433
683
 
@@ -480,11 +730,14 @@ describe('plugin-meetings', () => {
480
730
  ],
481
731
  ({meetingId, sendCAevents, shouldSendCAevents, confIdStr}) => {
482
732
  it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
483
- const requestResponse = {statusCode: 200, body: {meetingKey: '1234323', meetingId: '123', confID: '321'}};
733
+ const requestResponse = {
734
+ statusCode: 200,
735
+ body: {meetingKey: '1234323', meetingId: '123', confID: '321'},
736
+ };
484
737
  if (confIdStr) {
485
738
  requestResponse.body.confIdStr = confIdStr;
486
739
  }
487
- const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
740
+ const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'};
488
741
 
489
742
  webex.request.resolves(requestResponse);
490
743
 
@@ -517,10 +770,11 @@ describe('plugin-meetings', () => {
517
770
  BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS
518
771
  );
519
772
 
520
- const submitInternalEventCalls = webex.internal.newMetrics.submitInternalEvent.getCalls();
773
+ const submitInternalEventCalls =
774
+ webex.internal.newMetrics.submitInternalEvent.getCalls();
521
775
  const submitClientEventCalls = webex.internal.newMetrics.submitClientEvent.getCalls();
522
776
 
523
- if(shouldSendCAevents) {
777
+ if (shouldSendCAevents) {
524
778
  assert.deepEqual(submitInternalEventCalls[0].args[0], {
525
779
  name: 'internal.client.meetinginfo.request',
526
780
  });
@@ -528,7 +782,7 @@ describe('plugin-meetings', () => {
528
782
  name: 'client.meetinginfo.request',
529
783
  options: {
530
784
  meetingId,
531
- }
785
+ },
532
786
  });
533
787
 
534
788
  assert.deepEqual(submitInternalEventCalls[1].args[0], {
@@ -544,20 +798,25 @@ describe('plugin-meetings', () => {
544
798
  options: {
545
799
  meetingId,
546
800
  globalMeetingId: requestResponse.body?.meetingId,
547
- webexConferenceIdStr: confIdStr ? requestResponse.body?.confIdStr : requestResponse.body?.confID,
548
- }
801
+ webexConferenceIdStr: confIdStr
802
+ ? requestResponse.body?.confIdStr
803
+ : requestResponse.body?.confID,
804
+ },
549
805
  });
550
806
  } else {
551
807
  assert.notCalled(webex.internal.newMetrics.submitClientEvent);
552
808
  assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
553
809
  }
554
- })
810
+ });
555
811
  }
556
- )
812
+ );
557
813
 
558
814
  it('should send CA metric if meetingId is provided and send CA events is authorized', async () => {
559
- const requestResponse = {statusCode: 200, body: {meetingKey: '1234323', confID: '123', meetingId: '321'}};
560
- const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'}
815
+ const requestResponse = {
816
+ statusCode: 200,
817
+ body: {meetingKey: '1234323', confID: '123', meetingId: '321'},
818
+ };
819
+ const extraParams = {mtid: 'm9fe0afd8c435e892afcce9ea25b97046', joinTXId: 'TSmrX61wNF'};
561
820
 
562
821
  webex.request.resolves(requestResponse);
563
822
 
@@ -600,7 +859,7 @@ describe('plugin-meetings', () => {
600
859
  name: 'client.meetinginfo.request',
601
860
  options: {
602
861
  meetingId: 'meetingId',
603
- }
862
+ },
604
863
  });
605
864
 
606
865
  assert.deepEqual(submitInternalEventCalls[1].args[0], {
@@ -617,47 +876,41 @@ describe('plugin-meetings', () => {
617
876
  meetingId: 'meetingId',
618
877
  globalMeetingId: requestResponse.body?.meetingId,
619
878
  webexConferenceIdStr: requestResponse.body?.confID,
620
- }
879
+ },
621
880
  });
622
881
  });
623
882
 
624
- forEach(
625
- [
626
- {sendCAevents: true},
627
- {sendCAevents: false},
628
- ],
629
- ({sendCAevents}) => {
630
- it(`should not send CA metric if meetingId is not provided disregarding if sendCAevents is ${sendCAevents}`, async () => {
631
- const message = 'a message';
632
- const meetingInfoData = 'meeting info';
883
+ forEach([{sendCAevents: true}, {sendCAevents: false}], ({sendCAevents}) => {
884
+ it(`should not send CA metric if meetingId is not provided disregarding if sendCAevents is ${sendCAevents}`, async () => {
885
+ const message = 'a message';
886
+ const meetingInfoData = 'meeting info';
633
887
 
634
- webex.request = sinon.stub().rejects({
635
- statusCode: 403,
636
- body: {message, code: 403102, data: {meetingInfo: meetingInfoData}},
637
- url: 'http://api-url.com',
638
- });
639
- try {
640
- await meetingInfo.fetchMeetingInfo(
641
- '1234323',
642
- DESTINATION_TYPE.MEETING_ID,
643
- 'abc',
644
- {
645
- id: '999',
646
- code: 'aabbcc11',
647
- },
648
- null,
649
- null,
650
- undefined,
651
- {meetingId: undefined, sendCAevents}
652
- );
653
- assert.fail('fetchMeetingInfo should have thrown, but has not done that');
654
- } catch (err) {
655
- assert.notCalled(webex.internal.newMetrics.submitClientEvent);
656
- assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
657
- }
888
+ webex.request = sinon.stub().rejects({
889
+ statusCode: 403,
890
+ body: {message, code: 403102, data: {meetingInfo: meetingInfoData}},
891
+ url: 'http://api-url.com',
658
892
  });
659
- }
660
- );
893
+ try {
894
+ await meetingInfo.fetchMeetingInfo(
895
+ '1234323',
896
+ DESTINATION_TYPE.MEETING_ID,
897
+ 'abc',
898
+ {
899
+ id: '999',
900
+ code: 'aabbcc11',
901
+ },
902
+ null,
903
+ null,
904
+ undefined,
905
+ {meetingId: undefined, sendCAevents}
906
+ );
907
+ assert.fail('fetchMeetingInfo should have thrown, but has not done that');
908
+ } catch (err) {
909
+ assert.notCalled(webex.internal.newMetrics.submitClientEvent);
910
+ assert.notCalled(webex.internal.newMetrics.submitInternalEvent);
911
+ }
912
+ });
913
+ });
661
914
 
662
915
  it('should throw MeetingInfoV2PasswordError for 403 response', async () => {
663
916
  const FAKE_MEETING_INFO = {blablabla: 'some_fake_meeting_info'};
@@ -786,23 +1039,24 @@ describe('plugin-meetings', () => {
786
1039
  ciUserUuid: conversation.participants.items[1].entryUUID,
787
1040
  });
788
1041
 
789
- return {invitee}
790
- }
1042
+ return {invitee};
1043
+ };
791
1044
 
792
1045
  it('Make a request to /spaceInstant when conversationUrl', async () => {
793
1046
  const {invitee} = setup();
794
1047
 
795
1048
  webex.request.resolves({
796
1049
  statusCode: 200,
797
- body: conversation
1050
+ body: conversation,
798
1051
  });
799
1052
 
800
- const result = await meetingInfo.createAdhocSpaceMeeting(conversationUrl,installedOrgID);
1053
+ const result = await meetingInfo.createAdhocSpaceMeeting(conversationUrl, installedOrgID);
801
1054
 
802
- assert.calledWith(
803
- webex.request,
804
- {uri:conversationUrl, qs: {includeParticipants: true}, disableTransform: true}
805
- )
1055
+ assert.calledWith(webex.request, {
1056
+ uri: conversationUrl,
1057
+ qs: {includeParticipants: true},
1058
+ disableTransform: true,
1059
+ });
806
1060
 
807
1061
  assert.calledWith(webex.request, {
808
1062
  method: 'POST',
@@ -813,14 +1067,15 @@ describe('plugin-meetings', () => {
813
1067
  keyUrl: conversation.encryptionKeyUrl,
814
1068
  kroUrl: conversation.kmsResourceObjectUrl,
815
1069
  invitees: invitee,
816
- installedOrgID: installedOrgID
1070
+ installedOrgID: installedOrgID,
1071
+ schedule: false,
817
1072
  },
818
1073
  });
819
1074
  assert.calledOnce(Metrics.sendBehavioralMetric);
820
1075
  assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);
821
1076
  assert.deepEqual(result, {
822
1077
  body: conversation,
823
- statusCode: 200
1078
+ statusCode: 200,
824
1079
  });
825
1080
  });
826
1081
  it('Make a request to /spaceInstant when conversationUrl with installed org ID', async () => {
@@ -845,13 +1100,13 @@ describe('plugin-meetings', () => {
845
1100
  kroUrl: conversation.kmsResourceObjectUrl,
846
1101
  invitees: invitee,
847
1102
  installedOrgID,
1103
+ schedule: false,
848
1104
  },
849
1105
  });
850
1106
  assert(Metrics.sendBehavioralMetric.calledOnce);
851
1107
  assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);
852
1108
  });
853
1109
 
854
-
855
1110
  forEach(
856
1111
  [
857
1112
  {errorCode: 403049},
@@ -885,7 +1140,6 @@ describe('plugin-meetings', () => {
885
1140
  BEHAVIORAL_METRICS.MEETING_INFO_POLICY_ERROR,
886
1141
  {code: errorCode}
887
1142
  );
888
-
889
1143
  }
890
1144
  });
891
1145
  }
@@ -926,47 +1180,40 @@ describe('plugin-meetings', () => {
926
1180
  BEHAVIORAL_METRICS.JOIN_WEBINAR_ERROR,
927
1181
  {code: errorCode}
928
1182
  );
929
-
930
1183
  }
931
1184
  });
932
1185
  }
933
1186
  );
934
1187
 
935
- forEach(
936
- [
937
- {errorCode: 403003},
938
- ],
939
- ({errorCode}) => {
940
- it(`should throw a MeetingInfoV2JoinForbiddenError for error code ${errorCode}`, async () => {
941
- const message = 'a message';
942
- const meetingInfoData = 'meeting info';
1188
+ forEach([{errorCode: 403003}], ({errorCode}) => {
1189
+ it(`should throw a MeetingInfoV2JoinForbiddenError for error code ${errorCode}`, async () => {
1190
+ const message = 'a message';
1191
+ const meetingInfoData = 'meeting info';
943
1192
 
944
- webex.request = sinon.stub().rejects({
945
- statusCode: 403,
946
- body: {message, code: errorCode, data: {meetingInfo: meetingInfoData}},
1193
+ webex.request = sinon.stub().rejects({
1194
+ statusCode: 403,
1195
+ body: {message, code: errorCode, data: {meetingInfo: meetingInfoData}},
1196
+ });
1197
+ try {
1198
+ await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
1199
+ id: '999',
1200
+ code: 'aabbcc11',
947
1201
  });
948
- try {
949
- await meetingInfo.fetchMeetingInfo('1234323', DESTINATION_TYPE.MEETING_ID, 'abc', {
950
- id: '999',
951
- code: 'aabbcc11',
952
- });
953
- } catch (err) {
954
- assert.instanceOf(err, MeetingInfoV2JoinForbiddenError);
955
- assert.deepEqual(err.message, `${message}, code=${errorCode}`);
956
- assert.equal(err.wbxAppApiCode, errorCode);
957
- assert.deepEqual(err.meetingInfo, meetingInfoData);
958
-
959
- assert(Metrics.sendBehavioralMetric.calledOnce);
960
- assert.calledWith(
961
- Metrics.sendBehavioralMetric,
962
- BEHAVIORAL_METRICS.JOIN_FORBIDDEN_ERROR,
963
- {code: errorCode}
964
- );
1202
+ } catch (err) {
1203
+ assert.instanceOf(err, MeetingInfoV2JoinForbiddenError);
1204
+ assert.deepEqual(err.message, `${message}, code=${errorCode}`);
1205
+ assert.equal(err.wbxAppApiCode, errorCode);
1206
+ assert.deepEqual(err.meetingInfo, meetingInfoData);
965
1207
 
966
- }
967
- });
968
- }
969
- );
1208
+ assert(Metrics.sendBehavioralMetric.calledOnce);
1209
+ assert.calledWith(
1210
+ Metrics.sendBehavioralMetric,
1211
+ BEHAVIORAL_METRICS.JOIN_FORBIDDEN_ERROR,
1212
+ {code: errorCode}
1213
+ );
1214
+ }
1215
+ });
1216
+ });
970
1217
  });
971
1218
  });
972
1219
  });