@webex/internal-plugin-calendar 3.0.0-beta.4 → 3.0.0-beta.41

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.
@@ -11,7 +11,6 @@ import retry from '@webex/test-helper-retry';
11
11
  import testUsers from '@webex/test-helper-test-users';
12
12
  import uuid from 'uuid';
13
13
 
14
-
15
14
  /**
16
15
  * produces a mock meeting object
17
16
  * @param {Object} params
@@ -30,8 +29,8 @@ function makeMockMeetingPayload(params) {
30
29
  links: [
31
30
  {
32
31
  href: `https://calendar-example.com/calendar/api/v1/${params.locusId}`,
33
- rel: 'self'
34
- }
32
+ rel: 'self',
33
+ },
35
34
  ],
36
35
  encryptedNotes: params.body,
37
36
  encryptedLocation: params.location,
@@ -42,7 +41,7 @@ function makeMockMeetingPayload(params) {
42
41
  spaceURL: params.spaceURL,
43
42
  meetingJoinInfo: {
44
43
  meetingJoinURI: params.meetingJoinInfo.meetingJoinURI,
45
- meetingJoinURL: params.meetingJoinInfo.meetingJoinURI
44
+ meetingJoinURL: params.meetingJoinInfo.meetingJoinURI,
46
45
  },
47
46
  encryptedParticipants: [
48
47
  {
@@ -52,7 +51,7 @@ function makeMockMeetingPayload(params) {
52
51
  participantType: 'OPTIONAL',
53
52
  orgId: params.participants.participant1.orgId,
54
53
  encryptedEmailAddress: params.participants.participant1.emailAddress,
55
- encryptedName: params.participants.participant1.name
54
+ encryptedName: params.participants.participant1.name,
56
55
  },
57
56
  {
58
57
  id: params.participants.participant2.id,
@@ -61,9 +60,9 @@ function makeMockMeetingPayload(params) {
61
60
  participantType: 'REQUIRED',
62
61
  orgId: params.participants.participant2.orgId,
63
62
  encryptedEmailAddress: params.participants.participant2.emailAddress,
64
- encryptedName: params.participants.participant2.name
65
- }
66
- ]
63
+ encryptedName: params.participants.participant2.name,
64
+ },
65
+ ],
67
66
  };
68
67
 
69
68
  return payload;
@@ -81,10 +80,10 @@ function makeMockNotesPayload(params) {
81
80
  links: [
82
81
  {
83
82
  href: `https://calendar-example.com/calendar/api/v1/${params.locusId}`,
84
- rel: 'self'
85
- }
83
+ rel: 'self',
84
+ },
86
85
  ],
87
- encryptedNotes: params.meetingNotes
86
+ encryptedNotes: params.meetingNotes,
88
87
  };
89
88
 
90
89
  return payload;
@@ -102,8 +101,8 @@ function makeMockParticipantsPayload(params) {
102
101
  links: [
103
102
  {
104
103
  href: `https://calendar-example.com/calendar/api/v1/${params.locusId}`,
105
- rel: 'self'
106
- }
104
+ rel: 'self',
105
+ },
107
106
  ],
108
107
  encryptedParticipants: [
109
108
  {
@@ -113,7 +112,7 @@ function makeMockParticipantsPayload(params) {
113
112
  participantType: 'OPTIONAL',
114
113
  orgId: params.participants.participant1.orgId,
115
114
  encryptedEmailAddress: params.participants.participant1.emailAddress,
116
- encryptedName: params.participants.participant1.name
115
+ encryptedName: params.participants.participant1.name,
117
116
  },
118
117
  {
119
118
  id: params.participants.participant2.id,
@@ -122,62 +121,77 @@ function makeMockParticipantsPayload(params) {
122
121
  participantType: 'REQUIRED',
123
122
  orgId: params.participants.participant2.orgId,
124
123
  encryptedEmailAddress: params.participants.participant2.emailAddress,
125
- encryptedName: params.participants.participant2.name
126
- }
127
- ]
124
+ encryptedName: params.participants.participant2.name,
125
+ },
126
+ ],
128
127
  };
129
128
 
130
129
  return payload;
131
130
  }
132
131
 
133
132
  function postToWhistler(webex, type, payload) {
134
- return retry(() => webex.request({
135
- method: 'POST',
136
- uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
137
- body: payload,
138
- qs: {
139
- changeType: type,
140
- useProduction: typeof process.env.WDM_SERVICE_URL === 'undefined' || process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com')
141
- }
142
- })
143
- .then((res) => {
144
- // Test response is using our parameters
145
- const createdMeeting = res.body;
146
-
147
- assert.isDefined(createdMeeting);
148
- assert.equal(createdMeeting.meeting.itemId, payload.id);
149
- assert.equal(createdMeeting.userUUID, payload.organizer);
150
- assert.equal(createdMeeting.meeting.startDate, payload.start);
151
- assert.equal(createdMeeting.meeting.duration, payload.durationMinutes);
152
-
153
- return res;
154
- }));
133
+ return retry(() =>
134
+ webex
135
+ .request({
136
+ method: 'POST',
137
+ uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
138
+ body: payload,
139
+ qs: {
140
+ changeType: type,
141
+ useProduction:
142
+ typeof process.env.WDM_SERVICE_URL === 'undefined' ||
143
+ process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com'),
144
+ },
145
+ })
146
+ .then((res) => {
147
+ // Test response is using our parameters
148
+ const createdMeeting = res.body;
149
+
150
+ assert.isDefined(createdMeeting);
151
+ assert.equal(createdMeeting.meeting.itemId, payload.id);
152
+ assert.equal(createdMeeting.userUUID, payload.organizer);
153
+ assert.equal(createdMeeting.meeting.startDate, payload.start);
154
+ assert.equal(createdMeeting.meeting.duration, payload.durationMinutes);
155
+
156
+ return res;
157
+ })
158
+ );
155
159
  }
156
160
 
157
161
  function postNotesToWhistler(webex, type, payload) {
158
- return retry(() => webex.request({
159
- method: 'POST',
160
- uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
161
- body: payload,
162
- qs: {
163
- changeType: type,
164
- useProduction: typeof process.env.WDM_SERVICE_URL === 'undefined' || process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com')
165
- }
166
- })
167
- .then((res) => res.body));
162
+ return retry(() =>
163
+ webex
164
+ .request({
165
+ method: 'POST',
166
+ uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
167
+ body: payload,
168
+ qs: {
169
+ changeType: type,
170
+ useProduction:
171
+ typeof process.env.WDM_SERVICE_URL === 'undefined' ||
172
+ process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com'),
173
+ },
174
+ })
175
+ .then((res) => res.body)
176
+ );
168
177
  }
169
178
 
170
179
  function postParticipantsToWhistler(webex, type, payload) {
171
- return retry(() => webex.request({
172
- method: 'POST',
173
- uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
174
- body: payload,
175
- qs: {
176
- changeType: type,
177
- useProduction: typeof process.env.WDM_SERVICE_URL === 'undefined' || process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com')
178
- }
179
- })
180
- .then((res) => res.body));
180
+ return retry(() =>
181
+ webex
182
+ .request({
183
+ method: 'POST',
184
+ uri: `${process.env.WHISTLER_API_SERVICE_URL}/calendarEvent`,
185
+ body: payload,
186
+ qs: {
187
+ changeType: type,
188
+ useProduction:
189
+ typeof process.env.WDM_SERVICE_URL === 'undefined' ||
190
+ process.env.WDM_SERVICE_URL.includes('wdm-a.wbx2.com'),
191
+ },
192
+ })
193
+ .then((res) => res.body)
194
+ );
181
195
  }
182
196
 
183
197
  describe.skip('plugin-calendar', () => {
@@ -186,41 +200,49 @@ describe.skip('plugin-calendar', () => {
186
200
  this.timeout(retry.timeout(20000));
187
201
  let creator, mccoy, webex, spock;
188
202
 
189
- before('create test users', () => testUsers.create({
190
- count: 3,
191
- config: {
192
- entitlements: [
193
- 'sparkCompliance',
194
- 'sparkAdmin',
195
- 'spark',
196
- 'squaredCallInitiation',
197
- 'squaredRoomModeration',
198
- 'squaredInviter',
199
- 'webExSquared',
200
- 'squaredFusionCal'
201
- ]
202
- }
203
- })
204
- .then((users) => {
205
- [creator, spock, mccoy] = users;
206
-
207
- webex = new WebexCore({
208
- credentials: {
209
- authorization: creator.token
210
- },
203
+ before('create test users', () =>
204
+ testUsers
205
+ .create({
206
+ count: 3,
211
207
  config: {
212
- device: {
213
- preDiscoveryServices: {
214
- whistlerServiceUrl: process.env.WHISTLER_API_SERVICE_URL || 'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1'
215
- }
216
- }
217
- }
218
- });
219
- }));
220
-
221
- before('register to wdm, set features, and connect to mercury', () => webex.internal.device.register()
222
- .then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
223
- .then(() => webex.internal.mercury.connect()));
208
+ entitlements: [
209
+ 'sparkCompliance',
210
+ 'sparkAdmin',
211
+ 'spark',
212
+ 'squaredCallInitiation',
213
+ 'squaredRoomModeration',
214
+ 'squaredInviter',
215
+ 'webExSquared',
216
+ 'squaredFusionCal',
217
+ ],
218
+ },
219
+ })
220
+ .then((users) => {
221
+ [creator, spock, mccoy] = users;
222
+
223
+ webex = new WebexCore({
224
+ credentials: {
225
+ authorization: creator.token,
226
+ },
227
+ config: {
228
+ device: {
229
+ preDiscoveryServices: {
230
+ whistlerServiceUrl:
231
+ process.env.WHISTLER_API_SERVICE_URL ||
232
+ 'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1',
233
+ },
234
+ },
235
+ },
236
+ });
237
+ })
238
+ );
239
+
240
+ before('register to wdm, set features, and connect to mercury', () =>
241
+ webex.internal.device
242
+ .register()
243
+ .then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
244
+ .then(() => webex.internal.mercury.connect())
245
+ );
224
246
 
225
247
  after(() => webex && webex.internal.mercury.disconnect());
226
248
 
@@ -233,7 +255,6 @@ describe.skip('plugin-calendar', () => {
233
255
  const seriesID = uuid.v4();
234
256
 
235
257
  const meetingParams = {
236
-
237
258
  meetingId: meetingID,
238
259
  seriesId: seriesID,
239
260
  start: startInterval,
@@ -245,55 +266,78 @@ describe.skip('plugin-calendar', () => {
245
266
  organizer: creator,
246
267
  participants: {
247
268
  participant1: mccoy,
248
- participant2: spock
269
+ participant2: spock,
249
270
  },
250
271
  location: '@webex',
251
- body: 'Test Agenda'
272
+ body: 'Test Agenda',
252
273
  };
253
274
 
254
- return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams))
255
- .then((res) => {
275
+ return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams)).then(
276
+ (res) => {
256
277
  const createdMeeting = res.body;
257
278
 
258
- return webex.internal.calendar.list()
259
- .then((meetings) => {
260
- const testMeeting = meetings.find((meeting) => meeting.seriesId === createdMeeting.meeting.meetingSeriesId);
261
-
262
- assert.isDefined(testMeeting);
263
- assert.equal(createdMeeting.meeting.meetingSeriesId, testMeeting.seriesId);
264
- assert.equal(createdMeeting.userUUID, testMeeting.organizer);
265
- assert.equal(createdMeeting.meeting.startDate, testMeeting.start);
266
- assert.equal(Math.round((new Date(createdMeeting.meeting.endDate).getTime() - new Date(createdMeeting.meeting.startDate).getTime()) / 60000), testMeeting.durationMinutes);
267
-
268
- // Validate decryption of subject, location and agenda
269
- assert.isDefined(testMeeting.encryptedSubject);
270
- assert.equal(meetingParams.title, testMeeting.encryptedSubject);
271
- assert.isDefined(testMeeting.encryptedLocation);
272
- assert.equal(meetingParams.location, testMeeting.encryptedLocation);
273
- assert.isDefined(testMeeting.encryptedNotes);
274
- assert.equal(meetingParams.body, testMeeting.encryptedNotes);
275
- assert.isDefined(testMeeting.webexURI);
276
- assert.equal(meetingParams.location, testMeeting.webexURI);
277
- assert.isDefined(testMeeting.webexURL);
278
- assert.equal(meetingParams.location, testMeeting.webexURL);
279
- assert.isDefined(testMeeting.spaceMeetURL);
280
- assert.equal(meetingParams.location, testMeeting.spaceMeetURL);
281
- assert.isDefined(testMeeting.spaceURI);
282
- assert.equal(meetingParams.location, testMeeting.spaceURI);
283
- assert.isDefined(testMeeting.spaceURL);
284
- assert.equal(meetingParams.location, testMeeting.spaceURL);
285
- assert.isDefined(testMeeting.encryptedParticipants);
286
- const encryptedParticipant1 = testMeeting.encryptedParticipants
287
- .find((participant) => participant.id === meetingParams.participants.participant1.id);
288
- const encryptedParticipant2 = testMeeting.encryptedParticipants
289
- .find((participant) => participant.id === meetingParams.participants.participant2.id);
290
-
291
- assert.equal(meetingParams.participants.participant1.emailAddress, encryptedParticipant1.encryptedEmailAddress);
292
- assert.equal(meetingParams.participants.participant1.name, encryptedParticipant1.encryptedName);
293
- assert.equal(meetingParams.participants.participant2.emailAddress, encryptedParticipant2.encryptedEmailAddress);
294
- assert.equal(meetingParams.participants.participant2.name, encryptedParticipant2.encryptedName);
295
- });
296
- });
279
+ return webex.internal.calendar.list().then((meetings) => {
280
+ const testMeeting = meetings.find(
281
+ (meeting) => meeting.seriesId === createdMeeting.meeting.meetingSeriesId
282
+ );
283
+
284
+ assert.isDefined(testMeeting);
285
+ assert.equal(createdMeeting.meeting.meetingSeriesId, testMeeting.seriesId);
286
+ assert.equal(createdMeeting.userUUID, testMeeting.organizer);
287
+ assert.equal(createdMeeting.meeting.startDate, testMeeting.start);
288
+ assert.equal(
289
+ Math.round(
290
+ (new Date(createdMeeting.meeting.endDate).getTime() -
291
+ new Date(createdMeeting.meeting.startDate).getTime()) /
292
+ 60000
293
+ ),
294
+ testMeeting.durationMinutes
295
+ );
296
+
297
+ // Validate decryption of subject, location and agenda
298
+ assert.isDefined(testMeeting.encryptedSubject);
299
+ assert.equal(meetingParams.title, testMeeting.encryptedSubject);
300
+ assert.isDefined(testMeeting.encryptedLocation);
301
+ assert.equal(meetingParams.location, testMeeting.encryptedLocation);
302
+ assert.isDefined(testMeeting.encryptedNotes);
303
+ assert.equal(meetingParams.body, testMeeting.encryptedNotes);
304
+ assert.isDefined(testMeeting.webexURI);
305
+ assert.equal(meetingParams.location, testMeeting.webexURI);
306
+ assert.isDefined(testMeeting.webexURL);
307
+ assert.equal(meetingParams.location, testMeeting.webexURL);
308
+ assert.isDefined(testMeeting.spaceMeetURL);
309
+ assert.equal(meetingParams.location, testMeeting.spaceMeetURL);
310
+ assert.isDefined(testMeeting.spaceURI);
311
+ assert.equal(meetingParams.location, testMeeting.spaceURI);
312
+ assert.isDefined(testMeeting.spaceURL);
313
+ assert.equal(meetingParams.location, testMeeting.spaceURL);
314
+ assert.isDefined(testMeeting.encryptedParticipants);
315
+ const encryptedParticipant1 = testMeeting.encryptedParticipants.find(
316
+ (participant) => participant.id === meetingParams.participants.participant1.id
317
+ );
318
+ const encryptedParticipant2 = testMeeting.encryptedParticipants.find(
319
+ (participant) => participant.id === meetingParams.participants.participant2.id
320
+ );
321
+
322
+ assert.equal(
323
+ meetingParams.participants.participant1.emailAddress,
324
+ encryptedParticipant1.encryptedEmailAddress
325
+ );
326
+ assert.equal(
327
+ meetingParams.participants.participant1.name,
328
+ encryptedParticipant1.encryptedName
329
+ );
330
+ assert.equal(
331
+ meetingParams.participants.participant2.emailAddress,
332
+ encryptedParticipant2.encryptedEmailAddress
333
+ );
334
+ assert.equal(
335
+ meetingParams.participants.participant2.name,
336
+ encryptedParticipant2.encryptedName
337
+ );
338
+ });
339
+ }
340
+ );
297
341
  });
298
342
 
299
343
  it('receives a mercury event for a new meeting', () => {
@@ -305,7 +349,6 @@ describe.skip('plugin-calendar', () => {
305
349
  const seriesID = uuid.v4();
306
350
 
307
351
  const meetingParams = {
308
-
309
352
  meetingId: meetingID,
310
353
  seriesId: seriesID,
311
354
  start: startInterval,
@@ -317,10 +360,10 @@ describe.skip('plugin-calendar', () => {
317
360
  organizer: creator,
318
361
  participants: {
319
362
  participant1: mccoy,
320
- participant2: spock
363
+ participant2: spock,
321
364
  },
322
365
  location: '@webex',
323
- body: 'Test Agenda'
366
+ body: 'Test Agenda',
324
367
  };
325
368
 
326
369
  const mercuryPromise = new Promise((resolve) => {
@@ -329,91 +372,129 @@ describe.skip('plugin-calendar', () => {
329
372
  });
330
373
  });
331
374
 
332
- return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams))
333
- .then((res) => {
375
+ return postToWhistler(webex, 'CREATE', makeMockMeetingPayload(meetingParams)).then(
376
+ (res) => {
334
377
  const createdMeeting = res.body;
335
378
 
336
- return mercuryPromise
337
- .then((calendarMeetingExternal) => {
338
- assert.equal(createdMeeting.meeting.meetingSeriesId, calendarMeetingExternal.seriesId);
339
- assert.equal(createdMeeting.userUUID, calendarMeetingExternal.organizer);
340
- assert.equal(createdMeeting.meeting.startDate, calendarMeetingExternal.start);
341
- assert.equal(Math.round((new Date(createdMeeting.meeting.endDate).getTime() - new Date(createdMeeting.meeting.startDate).getTime()) / 60000), calendarMeetingExternal.durationMinutes);
342
-
343
- // Validate decryption of subject, location and agenda
344
- assert.isDefined(calendarMeetingExternal.encryptedSubject);
345
- assert.equal(meetingParams.title, calendarMeetingExternal.encryptedSubject);
346
- assert.isDefined(calendarMeetingExternal.encryptedLocation);
347
- assert.equal(meetingParams.location, calendarMeetingExternal.encryptedLocation);
348
- assert.isDefined(calendarMeetingExternal.encryptedNotes);
349
- assert.equal(meetingParams.body, calendarMeetingExternal.encryptedNotes);
350
- assert.isDefined(calendarMeetingExternal.webexURI);
351
- assert.equal(meetingParams.body, calendarMeetingExternal.webexURI);
352
- assert.isDefined(calendarMeetingExternal.webexURL);
353
- assert.equal(meetingParams.body, calendarMeetingExternal.webexURL);
354
- assert.isDefined(calendarMeetingExternal.spaceMeetURL);
355
- assert.equal(meetingParams.body, calendarMeetingExternal.spaceMeetURL);
356
- assert.isDefined(calendarMeetingExternal.spaceURI);
357
- assert.equal(meetingParams.body, calendarMeetingExternal.spaceURI);
358
- assert.isDefined(calendarMeetingExternal.spaceURL);
359
- assert.equal(meetingParams.body, calendarMeetingExternal.spaceURL);
360
- assert.isDefined(calendarMeetingExternal.meetingJoinInfo.meetingJoinURI);
361
- assert.equal(meetingParams.body, calendarMeetingExternal.meetingJoinInfo.meetingJoinURI);
362
- assert.isDefined(calendarMeetingExternal.meetingJoinInfo.meetingJoinURL);
363
- assert.equal(meetingParams.body, calendarMeetingExternal.meetingJoinInfo.meetingJoinURL);
364
- assert.isDefined(calendarMeetingExternal.encryptedParticipants);
365
- const encryptedParticipant1 = calendarMeetingExternal.encryptedParticipants
366
- .find((participant) => participant.id === meetingParams.participants.participant1.id);
367
- const encryptedParticipant2 = calendarMeetingExternal.encryptedParticipants
368
- .find((participant) => participant.id === meetingParams.participants.participant2.id);
369
-
370
- assert.equal(meetingParams.participants.participant1.emailAddress, encryptedParticipant1.encryptedEmailAddress);
371
- assert.equal(meetingParams.participants.participant1.name, encryptedParticipant1.encryptedName);
372
- assert.equal(meetingParams.participants.participant2.emailAddress, encryptedParticipant2.encryptedEmailAddress);
373
- assert.equal(meetingParams.participants.participant2.name, encryptedParticipant2.encryptedName);
374
- });
375
- });
379
+ return mercuryPromise.then((calendarMeetingExternal) => {
380
+ assert.equal(
381
+ createdMeeting.meeting.meetingSeriesId,
382
+ calendarMeetingExternal.seriesId
383
+ );
384
+ assert.equal(createdMeeting.userUUID, calendarMeetingExternal.organizer);
385
+ assert.equal(createdMeeting.meeting.startDate, calendarMeetingExternal.start);
386
+ assert.equal(
387
+ Math.round(
388
+ (new Date(createdMeeting.meeting.endDate).getTime() -
389
+ new Date(createdMeeting.meeting.startDate).getTime()) /
390
+ 60000
391
+ ),
392
+ calendarMeetingExternal.durationMinutes
393
+ );
394
+
395
+ // Validate decryption of subject, location and agenda
396
+ assert.isDefined(calendarMeetingExternal.encryptedSubject);
397
+ assert.equal(meetingParams.title, calendarMeetingExternal.encryptedSubject);
398
+ assert.isDefined(calendarMeetingExternal.encryptedLocation);
399
+ assert.equal(meetingParams.location, calendarMeetingExternal.encryptedLocation);
400
+ assert.isDefined(calendarMeetingExternal.encryptedNotes);
401
+ assert.equal(meetingParams.body, calendarMeetingExternal.encryptedNotes);
402
+ assert.isDefined(calendarMeetingExternal.webexURI);
403
+ assert.equal(meetingParams.body, calendarMeetingExternal.webexURI);
404
+ assert.isDefined(calendarMeetingExternal.webexURL);
405
+ assert.equal(meetingParams.body, calendarMeetingExternal.webexURL);
406
+ assert.isDefined(calendarMeetingExternal.spaceMeetURL);
407
+ assert.equal(meetingParams.body, calendarMeetingExternal.spaceMeetURL);
408
+ assert.isDefined(calendarMeetingExternal.spaceURI);
409
+ assert.equal(meetingParams.body, calendarMeetingExternal.spaceURI);
410
+ assert.isDefined(calendarMeetingExternal.spaceURL);
411
+ assert.equal(meetingParams.body, calendarMeetingExternal.spaceURL);
412
+ assert.isDefined(calendarMeetingExternal.meetingJoinInfo.meetingJoinURI);
413
+ assert.equal(
414
+ meetingParams.body,
415
+ calendarMeetingExternal.meetingJoinInfo.meetingJoinURI
416
+ );
417
+ assert.isDefined(calendarMeetingExternal.meetingJoinInfo.meetingJoinURL);
418
+ assert.equal(
419
+ meetingParams.body,
420
+ calendarMeetingExternal.meetingJoinInfo.meetingJoinURL
421
+ );
422
+ assert.isDefined(calendarMeetingExternal.encryptedParticipants);
423
+ const encryptedParticipant1 = calendarMeetingExternal.encryptedParticipants.find(
424
+ (participant) => participant.id === meetingParams.participants.participant1.id
425
+ );
426
+ const encryptedParticipant2 = calendarMeetingExternal.encryptedParticipants.find(
427
+ (participant) => participant.id === meetingParams.participants.participant2.id
428
+ );
429
+
430
+ assert.equal(
431
+ meetingParams.participants.participant1.emailAddress,
432
+ encryptedParticipant1.encryptedEmailAddress
433
+ );
434
+ assert.equal(
435
+ meetingParams.participants.participant1.name,
436
+ encryptedParticipant1.encryptedName
437
+ );
438
+ assert.equal(
439
+ meetingParams.participants.participant2.emailAddress,
440
+ encryptedParticipant2.encryptedEmailAddress
441
+ );
442
+ assert.equal(
443
+ meetingParams.participants.participant2.name,
444
+ encryptedParticipant2.encryptedName
445
+ );
446
+ });
447
+ }
448
+ );
376
449
  });
377
450
  });
378
451
 
379
452
  describe('#getNotes()', () => {
380
453
  let creator, webex;
381
454
 
382
- before('create test users', () => testUsers.create({
383
- count: 3,
384
- config: {
385
- entitlements: [
386
- 'sparkCompliance',
387
- 'sparkAdmin',
388
- 'spark',
389
- 'squaredCallInitiation',
390
- 'squaredRoomModeration',
391
- 'squaredInviter',
392
- 'webExSquared',
393
- 'squaredFusionCal'
394
- ]
395
- }
396
- })
397
- .then((users) => {
398
- [creator] = users;
399
-
400
- webex = new WebexCore({
401
- credentials: {
402
- authorization: creator.token
403
- },
455
+ before('create test users', () =>
456
+ testUsers
457
+ .create({
458
+ count: 3,
404
459
  config: {
405
- services: {
406
- discovery: {
407
- whistlerServiceUrl: process.env.WHISTLER_API_SERVICE_URL || 'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1'
408
- }
409
- }
410
- }
411
- });
412
- }));
413
-
414
- before('register to wdm, set features, and connect to mercury', () => webex.internal.device.register()
415
- .then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
416
- .then(() => webex.internal.mercury.connect()));
460
+ entitlements: [
461
+ 'sparkCompliance',
462
+ 'sparkAdmin',
463
+ 'spark',
464
+ 'squaredCallInitiation',
465
+ 'squaredRoomModeration',
466
+ 'squaredInviter',
467
+ 'webExSquared',
468
+ 'squaredFusionCal',
469
+ ],
470
+ },
471
+ })
472
+ .then((users) => {
473
+ [creator] = users;
474
+
475
+ webex = new WebexCore({
476
+ credentials: {
477
+ authorization: creator.token,
478
+ },
479
+ config: {
480
+ services: {
481
+ discovery: {
482
+ whistlerServiceUrl:
483
+ process.env.WHISTLER_API_SERVICE_URL ||
484
+ 'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1',
485
+ },
486
+ },
487
+ },
488
+ });
489
+ })
490
+ );
491
+
492
+ before('register to wdm, set features, and connect to mercury', () =>
493
+ webex.internal.device
494
+ .register()
495
+ .then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
496
+ .then(() => webex.internal.mercury.connect())
497
+ );
417
498
 
418
499
  after(() => webex && webex.internal.mercury.disconnect());
419
500
 
@@ -427,56 +508,65 @@ describe.skip('plugin-calendar', () => {
427
508
  meetingId: meetingID,
428
509
  seriesId: seriesID,
429
510
  locusId: locusID,
430
- meetingNotes
511
+ meetingNotes,
431
512
  };
432
513
 
433
- return postNotesToWhistler(webex, 'CREATE', makeMockNotesPayload(meetingParams))
434
- .then((createdMeeting) => webex.internal.calendar.getNotes(meetingID)
435
- .then((response) => {
514
+ return postNotesToWhistler(webex, 'CREATE', makeMockNotesPayload(meetingParams)).then(
515
+ (createdMeeting) =>
516
+ webex.internal.calendar.getNotes(meetingID).then((response) => {
436
517
  assert.equal(createdMeeting.meeting.meetingSeriesId, response.seriesId);
437
518
  assert.equal(meetingParams.meetingNotes, response.encryptedNotes);
438
- }));
519
+ })
520
+ );
439
521
  });
440
522
  });
441
523
 
442
524
  describe('#getParticipants()', () => {
443
525
  let creator, mccoy, webex, spock;
444
526
 
445
- before('create test users', () => testUsers.create({
446
- count: 3,
447
- config: {
448
- entitlements: [
449
- 'sparkCompliance',
450
- 'sparkAdmin',
451
- 'spark',
452
- 'squaredCallInitiation',
453
- 'squaredRoomModeration',
454
- 'squaredInviter',
455
- 'webExSquared',
456
- 'squaredFusionCal'
457
- ]
458
- }
459
- })
460
- .then((users) => {
461
- [creator, spock, mccoy] = users;
462
-
463
- webex = new WebexCore({
464
- credentials: {
465
- authorization: creator.token
466
- },
527
+ before('create test users', () =>
528
+ testUsers
529
+ .create({
530
+ count: 3,
467
531
  config: {
468
- services: {
469
- discovery: {
470
- whistlerServiceUrl: process.env.WHISTLER_API_SERVICE_URL || 'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1'
471
- }
472
- }
473
- }
474
- });
475
- }));
476
-
477
- before('register to wdm, set features, and connect to mercury', () => webex.internal.device.register()
478
- .then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
479
- .then(() => webex.internal.mercury.connect()));
532
+ entitlements: [
533
+ 'sparkCompliance',
534
+ 'sparkAdmin',
535
+ 'spark',
536
+ 'squaredCallInitiation',
537
+ 'squaredRoomModeration',
538
+ 'squaredInviter',
539
+ 'webExSquared',
540
+ 'squaredFusionCal',
541
+ ],
542
+ },
543
+ })
544
+ .then((users) => {
545
+ [creator, spock, mccoy] = users;
546
+
547
+ webex = new WebexCore({
548
+ credentials: {
549
+ authorization: creator.token,
550
+ },
551
+ config: {
552
+ services: {
553
+ discovery: {
554
+ whistlerServiceUrl:
555
+ process.env.WHISTLER_API_SERVICE_URL ||
556
+ 'https://calendar-whistler.allnint.ciscospark.com:8084/api/v1',
557
+ },
558
+ },
559
+ },
560
+ });
561
+ })
562
+ );
563
+
564
+ before('register to wdm, set features, and connect to mercury', () =>
565
+ webex.internal.device
566
+ .register()
567
+ .then(() => webex.internal.feature.setFeature('developer', 'calsvc_calendar_view', true))
568
+ .then(() => webex.internal.mercury.connect())
569
+ );
480
570
 
481
571
  after(() => webex && webex.internal.mercury.disconnect());
482
572
 
@@ -491,25 +581,43 @@ describe.skip('plugin-calendar', () => {
491
581
  locusId: locusID,
492
582
  participants: {
493
583
  participant1: mccoy,
494
- participant2: spock
495
- }
584
+ participant2: spock,
585
+ },
496
586
  };
497
587
 
498
- return postParticipantsToWhistler(webex, 'CREATE', makeMockParticipantsPayload(meetingParams))
499
- .then((createdMeeting) => webex.internal.calendar.getParticipants(meetingID)
500
- .then((response) => {
501
- assert.equal(createdMeeting.meeting.meetingSeriesId, response.seriesId);
502
-
503
- const encryptedParticipant1 = response.encryptedParticipants
504
- .find((participant) => participant.id === meetingParams.participants.participant1.id);
505
- const encryptedParticipant2 = response.encryptedParticipants
506
- .find((participant) => participant.id === meetingParams.participants.participant2.id);
507
-
508
- assert.equal(meetingParams.participants.participant1.emailAddress, encryptedParticipant1.encryptedEmailAddress);
509
- assert.equal(meetingParams.participants.participant1.name, encryptedParticipant1.encryptedName);
510
- assert.equal(meetingParams.participants.participant2.emailAddress, encryptedParticipant2.encryptedEmailAddress);
511
- assert.equal(meetingParams.participants.participant2.name, encryptedParticipant2.encryptedName);
512
- }));
588
+ return postParticipantsToWhistler(
589
+ webex,
590
+ 'CREATE',
591
+ makeMockParticipantsPayload(meetingParams)
592
+ ).then((createdMeeting) =>
593
+ webex.internal.calendar.getParticipants(meetingID).then((response) => {
594
+ assert.equal(createdMeeting.meeting.meetingSeriesId, response.seriesId);
595
+
596
+ const encryptedParticipant1 = response.encryptedParticipants.find(
597
+ (participant) => participant.id === meetingParams.participants.participant1.id
598
+ );
599
+ const encryptedParticipant2 = response.encryptedParticipants.find(
600
+ (participant) => participant.id === meetingParams.participants.participant2.id
601
+ );
602
+
603
+ assert.equal(
604
+ meetingParams.participants.participant1.emailAddress,
605
+ encryptedParticipant1.encryptedEmailAddress
606
+ );
607
+ assert.equal(
608
+ meetingParams.participants.participant1.name,
609
+ encryptedParticipant1.encryptedName
610
+ );
611
+ assert.equal(
612
+ meetingParams.participants.participant2.emailAddress,
613
+ encryptedParticipant2.encryptedEmailAddress
614
+ );
615
+ assert.equal(
616
+ meetingParams.participants.participant2.name,
617
+ encryptedParticipant2.encryptedName
618
+ );
619
+ })
620
+ );
513
621
  });
514
622
  });
515
623
  });