@webex/internal-plugin-team 3.0.0-beta.2 → 3.0.0-beta.21

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.
@@ -15,42 +15,45 @@ describe('plugin-team', () => {
15
15
  describe('Team', () => {
16
16
  let kirk, spock;
17
17
 
18
- before(() => testUsers.create({count: 2})
19
- .then((users) => {
18
+ before(() =>
19
+ testUsers.create({count: 2}).then((users) => {
20
20
  [kirk, spock] = users;
21
21
 
22
22
  kirk.webex = new WebexCore({
23
23
  credentials: {
24
- authorization: kirk.token
24
+ authorization: kirk.token,
25
25
  },
26
26
  config: {
27
27
  conversation: {
28
- keepEncryptedProperties: true
29
- }
30
- }
28
+ keepEncryptedProperties: true,
29
+ },
30
+ },
31
31
  });
32
32
 
33
33
  spock.webex = new WebexCore({
34
34
  credentials: {
35
- authorization: spock.token
35
+ authorization: spock.token,
36
36
  },
37
37
  config: {
38
38
  conversation: {
39
- keepEncryptedProperties: true
40
- }
41
- }
39
+ keepEncryptedProperties: true,
40
+ },
41
+ },
42
42
  });
43
43
 
44
44
  return Promise.all([
45
45
  kirk.webex.internal.mercury.connect(),
46
- spock.webex.internal.mercury.connect()
46
+ spock.webex.internal.mercury.connect(),
47
47
  ]);
48
- }));
48
+ })
49
+ );
49
50
 
50
- after(() => Promise.all([
51
- kirk && kirk.webex.internal.mercury.disconnect(),
52
- spock && spock.webex.internal.mercury.disconnect()
53
- ]));
51
+ after(() =>
52
+ Promise.all([
53
+ kirk && kirk.webex.internal.mercury.disconnect(),
54
+ spock && spock.webex.internal.mercury.disconnect(),
55
+ ])
56
+ );
54
57
 
55
58
  describe('#addConversation()', () => {
56
59
  let groupConversation, team;
@@ -58,179 +61,190 @@ describe('plugin-team', () => {
58
61
  before(() => {
59
62
  const teamPromise = kirk.webex.internal.team.create({
60
63
  displayName: `team-${uuid.v4()}`,
61
- participants: [
62
- kirk,
63
- spock
64
- ]
64
+ participants: [kirk, spock],
65
65
  });
66
66
 
67
67
  const conversation = {
68
68
  displayName: `group-conversation-${uuid.v4()}`,
69
- participants: [
70
- kirk
71
- ]
69
+ participants: [kirk],
72
70
  };
73
71
 
74
72
  return Promise.all([
75
73
  teamPromise,
76
- kirk.webex.internal.conversation.create(conversation, {forceGrouped: true})
77
- ])
78
- .then(([t, c]) => {
79
- team = t;
80
- groupConversation = c;
81
- });
74
+ kirk.webex.internal.conversation.create(conversation, {forceGrouped: true}),
75
+ ]).then(([t, c]) => {
76
+ team = t;
77
+ groupConversation = c;
78
+ });
82
79
  });
83
80
 
84
- it('adds an existing group conversation to a team', () => kirk.webex.internal.team.addConversation(team, groupConversation)
85
- .then((activity) => {
86
- assert.isActivity(activity);
87
- assert.equal(activity.verb, 'add');
88
- assert.equal(activity.target.id, team.id);
89
- assert.equal(activity.object.id, groupConversation.id);
90
-
91
- return spock.webex.internal.team.get(team, {includeTeamConversations: true});
92
- })
93
- .then((t) => {
94
- assert.equal(t.conversations.items.length, 2);
95
- const teamConversation = find(t.conversations.items, {id: groupConversation.id});
96
- const generalConversation = find(t.conversations.items, {id: t.generalConversationUuid});
97
-
98
- assert.include(teamConversation.tags, 'OPEN');
99
-
100
- // Ensure that spock can decrypt the title of the room now that
101
- // it's been added to a team he's a member of.
102
- assert.equal(generalConversation.displayName, team.displayName);
103
- assert.equal(teamConversation.displayName, groupConversation.displayName);
104
-
105
- return kirk.webex.internal.conversation.get(groupConversation);
106
- })
107
- .then((conversation) => {
108
- assert.isDefined(conversation.team);
109
- assert.equal(conversation.team.id, team.id);
110
- }));
111
- });
112
-
113
- describe('#addMember()', () => {
114
- let additionalConversation, team;
115
-
116
- before(() => kirk.webex.internal.team.create({
117
- displayName: `team-${uuid.v4()}`,
118
- participants: [
119
- kirk
120
- ]
121
- })
122
- .then((res) => {
123
- team = res;
81
+ it('adds an existing group conversation to a team', () =>
82
+ kirk.webex.internal.team
83
+ .addConversation(team, groupConversation)
84
+ .then((activity) => {
85
+ assert.isActivity(activity);
86
+ assert.equal(activity.verb, 'add');
87
+ assert.equal(activity.target.id, team.id);
88
+ assert.equal(activity.object.id, groupConversation.id);
124
89
 
125
- return kirk.webex.internal.team.createConversation(team, {
126
- displayName: `team-conversation-${uuid.v4()}`,
127
- participants: [
128
- kirk
129
- ]
90
+ return spock.webex.internal.team.get(team, {includeTeamConversations: true});
130
91
  })
131
- .then((conversation) => {
132
- additionalConversation = conversation;
92
+ .then((t) => {
93
+ assert.equal(t.conversations.items.length, 2);
94
+ const teamConversation = find(t.conversations.items, {id: groupConversation.id});
95
+ const generalConversation = find(t.conversations.items, {
96
+ id: t.generalConversationUuid,
133
97
  });
134
- }));
135
98
 
136
- it('adds a team member to a team', () => kirk.webex.internal.team.addMember(team, spock)
137
- .then((activity) => {
138
- assert.isActivity(activity);
139
- assert.equal(activity.verb, 'add');
140
- assert.equal(activity.target.id, team.id);
141
- assert.equal(activity.object.id, spock.id);
99
+ assert.include(teamConversation.tags, 'OPEN');
142
100
 
143
- return kirk.webex.internal.team.get(team, {
144
- includeTeamMembers: true
145
- });
146
- })
147
- .then((team) => {
148
- const spockEntry = find(team.teamMembers.items, {id: spock.id});
101
+ // Ensure that spock can decrypt the title of the room now that
102
+ // it's been added to a team he's a member of.
103
+ assert.equal(generalConversation.displayName, team.displayName);
104
+ assert.equal(teamConversation.displayName, groupConversation.displayName);
105
+
106
+ return kirk.webex.internal.conversation.get(groupConversation);
107
+ })
108
+ .then((conversation) => {
109
+ assert.isDefined(conversation.team);
110
+ assert.equal(conversation.team.id, team.id);
111
+ }));
112
+ });
149
113
 
150
- assert.isDefined(spockEntry);
151
- assert.isUndefined(spockEntry.roomProperties);
114
+ describe('#addMember()', () => {
115
+ let additionalConversation, team;
152
116
 
153
- // Assert spock can decrypt team and its rooms
154
- return spock.webex.internal.team.get(team, {
155
- includeTeamConversations: true
117
+ before(() =>
118
+ kirk.webex.internal.team
119
+ .create({
120
+ displayName: `team-${uuid.v4()}`,
121
+ participants: [kirk],
122
+ })
123
+ .then((res) => {
124
+ team = res;
125
+
126
+ return kirk.webex.internal.team
127
+ .createConversation(team, {
128
+ displayName: `team-conversation-${uuid.v4()}`,
129
+ participants: [kirk],
130
+ })
131
+ .then((conversation) => {
132
+ additionalConversation = conversation;
133
+ });
156
134
  })
157
- .then((spockTeam) => {
158
- assert.isDefined(spockTeam);
159
- assert.notEqual(spockTeam.displayName, spockTeam.encryptedDisplayName);
160
- assert.equal(spockTeam.displayName, team.displayName);
161
- assert.equal(spockTeam.conversations.items.length, 2);
135
+ );
162
136
 
163
- const spockAddtlConversation = find(spockTeam.conversations.items, {id: additionalConversation.id});
137
+ it('adds a team member to a team', () =>
138
+ kirk.webex.internal.team
139
+ .addMember(team, spock)
140
+ .then((activity) => {
141
+ assert.isActivity(activity);
142
+ assert.equal(activity.verb, 'add');
143
+ assert.equal(activity.target.id, team.id);
144
+ assert.equal(activity.object.id, spock.id);
164
145
 
165
- assert.isDefined(spockAddtlConversation);
166
- assert.notEqual(spockAddtlConversation.displayName, spockAddtlConversation.encryptedDisplayName);
167
- assert.equal(spockAddtlConversation.displayName, additionalConversation.displayName);
168
- assert.include(spockAddtlConversation.tags, 'NOT_JOINED');
146
+ return kirk.webex.internal.team.get(team, {
147
+ includeTeamMembers: true,
169
148
  });
170
- }));
149
+ })
150
+ .then((team) => {
151
+ const spockEntry = find(team.teamMembers.items, {id: spock.id});
152
+
153
+ assert.isDefined(spockEntry);
154
+ assert.isUndefined(spockEntry.roomProperties);
155
+
156
+ // Assert spock can decrypt team and its rooms
157
+ return spock.webex.internal.team
158
+ .get(team, {
159
+ includeTeamConversations: true,
160
+ })
161
+ .then((spockTeam) => {
162
+ assert.isDefined(spockTeam);
163
+ assert.notEqual(spockTeam.displayName, spockTeam.encryptedDisplayName);
164
+ assert.equal(spockTeam.displayName, team.displayName);
165
+ assert.equal(spockTeam.conversations.items.length, 2);
166
+
167
+ const spockAddtlConversation = find(spockTeam.conversations.items, {
168
+ id: additionalConversation.id,
169
+ });
170
+
171
+ assert.isDefined(spockAddtlConversation);
172
+ assert.notEqual(
173
+ spockAddtlConversation.displayName,
174
+ spockAddtlConversation.encryptedDisplayName
175
+ );
176
+ assert.equal(
177
+ spockAddtlConversation.displayName,
178
+ additionalConversation.displayName
179
+ );
180
+ assert.include(spockAddtlConversation.tags, 'NOT_JOINED');
181
+ });
182
+ }));
171
183
  });
172
184
 
173
185
  describe('#assignModerator()', () => {
174
186
  let team;
175
187
 
176
- before(() => kirk.webex.internal.team.create({
177
- displayName: `team-${uuid.v4()}`,
178
- participants: [
179
- kirk,
180
- spock
181
- ]
182
- })
183
- .then((t) => {
184
- team = t;
185
- }));
188
+ before(() =>
189
+ kirk.webex.internal.team
190
+ .create({
191
+ displayName: `team-${uuid.v4()}`,
192
+ participants: [kirk, spock],
193
+ })
194
+ .then((t) => {
195
+ team = t;
196
+ })
197
+ );
186
198
 
187
- it('assigns a team moderator', () => kirk.webex.internal.team.assignModerator(team, spock)
188
- .then((activity) => {
189
- assert.isActivity(activity);
190
- assert.equal(activity.verb, 'assignModerator');
191
- assert.equal(activity.target.id, team.id);
192
- assert.equal(activity.object.id, spock.id);
199
+ it('assigns a team moderator', () =>
200
+ kirk.webex.internal.team
201
+ .assignModerator(team, spock)
202
+ .then((activity) => {
203
+ assert.isActivity(activity);
204
+ assert.equal(activity.verb, 'assignModerator');
205
+ assert.equal(activity.target.id, team.id);
206
+ assert.equal(activity.object.id, spock.id);
193
207
 
194
- return kirk.webex.internal.team.get(team, {
195
- includeTeamMembers: true
196
- });
197
- })
198
- .then((team) => {
199
- const spockEntry = find(team.teamMembers.items, {id: spock.id});
208
+ return kirk.webex.internal.team.get(team, {
209
+ includeTeamMembers: true,
210
+ });
211
+ })
212
+ .then((team) => {
213
+ const spockEntry = find(team.teamMembers.items, {id: spock.id});
200
214
 
201
- assert.isDefined(spockEntry);
202
- assert.isTrue(spockEntry.roomProperties.isModerator);
203
- }));
215
+ assert.isDefined(spockEntry);
216
+ assert.isTrue(spockEntry.roomProperties.isModerator);
217
+ }));
204
218
  });
205
219
 
206
220
  describe('#archive()', () => {
207
221
  let conversation, team;
208
222
 
209
- before(() => kirk.webex.internal.team.create({
210
- displayName: `team-${uuid.v4()}`,
211
- participants: [
212
- kirk
213
- ]
214
- })
215
- .then((t) => {
216
- team = t;
223
+ before(() =>
224
+ kirk.webex.internal.team
225
+ .create({
226
+ displayName: `team-${uuid.v4()}`,
227
+ participants: [kirk],
228
+ })
229
+ .then((t) => {
230
+ team = t;
217
231
 
218
- return kirk.webex.internal.team.createConversation(team, {
219
- displayName: `team-conversation-${uuid.v4()}`,
220
- participants: [
221
- kirk
222
- ]
223
- });
224
- })
225
- .then((c) => {
226
- conversation = c;
227
- }));
232
+ return kirk.webex.internal.team.createConversation(team, {
233
+ displayName: `team-conversation-${uuid.v4()}`,
234
+ participants: [kirk],
235
+ });
236
+ })
237
+ .then((c) => {
238
+ conversation = c;
239
+ })
240
+ );
228
241
 
229
242
  it('archives a team conversation', () => {
230
243
  assert.notInclude(conversation.tags, 'ARCHIVED');
231
244
  assert.notInclude(conversation.tags, 'HIDDEN');
232
245
 
233
- return kirk.webex.internal.team.archive(conversation)
246
+ return kirk.webex.internal.team
247
+ .archive(conversation)
234
248
  .then((activity) => {
235
249
  assert.isActivity(activity);
236
250
  assert.equal(activity.verb, 'archive');
@@ -252,7 +266,8 @@ describe('plugin-team', () => {
252
266
  it('archives a team', () => {
253
267
  assert.isFalse(team.archived);
254
268
 
255
- return kirk.webex.internal.team.archive(team)
269
+ return kirk.webex.internal.team
270
+ .archive(team)
256
271
  .then((activity) => {
257
272
  assert.isActivity(activity);
258
273
  assert.equal(activity.verb, 'archive');
@@ -264,7 +279,9 @@ describe('plugin-team', () => {
264
279
  .then((t) => {
265
280
  assert.isTrue(t.archived);
266
281
 
267
- const generalConversation = find(t.conversations.items, {id: team.generalConversationUuid});
282
+ const generalConversation = find(t.conversations.items, {
283
+ id: team.generalConversationUuid,
284
+ });
268
285
 
269
286
  assert.isDefined(generalConversation);
270
287
  assert.include(generalConversation.tags, 'ARCHIVED');
@@ -276,170 +293,178 @@ describe('plugin-team', () => {
276
293
  describe('#joinConversation()', () => {
277
294
  let conversation, team;
278
295
 
279
- before(() => kirk.webex.internal.team.create({
280
- displayName: `team-${uuid.v4()}`,
281
- participants: [
282
- kirk,
283
- spock
284
- ]
285
- })
286
- .then((t) => {
287
- team = t;
296
+ before(() =>
297
+ kirk.webex.internal.team
298
+ .create({
299
+ displayName: `team-${uuid.v4()}`,
300
+ participants: [kirk, spock],
301
+ })
302
+ .then((t) => {
303
+ team = t;
288
304
 
289
- return kirk.webex.internal.team.createConversation(t, {
290
- displayName: `team-room-${uuid.v4()}`,
291
- participants: [kirk]
292
- });
293
- })
294
- .then((c) => {
295
- conversation = c;
296
- }));
305
+ return kirk.webex.internal.team.createConversation(t, {
306
+ displayName: `team-room-${uuid.v4()}`,
307
+ participants: [kirk],
308
+ });
309
+ })
310
+ .then((c) => {
311
+ conversation = c;
312
+ })
313
+ );
297
314
 
298
- it('adds the user to an open team conversation', () => spock.webex.internal.team.joinConversation(team, conversation)
299
- .then((c) => assert.notInclude(c.tags, 'NOT_JOINED')));
315
+ it('adds the user to an open team conversation', () =>
316
+ spock.webex.internal.team
317
+ .joinConversation(team, conversation, spock.id)
318
+ .then((c) => assert.notInclude(c.tags, 'NOT_JOINED')));
300
319
  });
301
320
 
302
321
  describe('#removeConversation()', () => {
303
322
  let conversation, team;
304
323
 
305
- before(() => kirk.webex.internal.team.create({
306
- displayName: `team-${uuid.v4()}`,
307
- participants: [
308
- kirk,
309
- spock
310
- ]
311
- })
312
- .then((t) => {
313
- team = t;
324
+ before(() =>
325
+ kirk.webex.internal.team
326
+ .create({
327
+ displayName: `team-${uuid.v4()}`,
328
+ participants: [kirk, spock],
329
+ })
330
+ .then((t) => {
331
+ team = t;
314
332
 
315
- return kirk.webex.internal.team.createConversation(t, {
316
- displayName: `team-room-${uuid.v4()}`,
317
- participants: [kirk]
318
- });
319
- })
320
- .then((c) => {
321
- conversation = c;
322
- }));
323
-
324
- it('removes a team conversation from a team', () => kirk.webex.internal.team.removeConversation(team, conversation)
325
- .then((activity) => {
326
- assert.isActivity(activity);
327
- assert.equal(activity.verb, 'remove');
328
- assert.equal(activity.target.id, team.id);
329
- assert.equal(activity.object.id, conversation.id);
330
-
331
- return kirk.webex.internal.team.get(team, {includeTeamConversations: true});
332
- })
333
- .then((t) => {
334
- assert.lengthOf(t.conversations.items, 1);
335
- assert.isUndefined(find(t.conversations.items, {id: conversation.id}));
336
- }));
333
+ return kirk.webex.internal.team.createConversation(t, {
334
+ displayName: `team-room-${uuid.v4()}`,
335
+ participants: [kirk],
336
+ });
337
+ })
338
+ .then((c) => {
339
+ conversation = c;
340
+ })
341
+ );
342
+
343
+ it('removes a team conversation from a team', () =>
344
+ kirk.webex.internal.team
345
+ .removeConversation(team, conversation)
346
+ .then((activity) => {
347
+ assert.isActivity(activity);
348
+ assert.equal(activity.verb, 'remove');
349
+ assert.equal(activity.target.id, team.id);
350
+ assert.equal(activity.object.id, conversation.id);
351
+
352
+ return kirk.webex.internal.team.get(team, {includeTeamConversations: true});
353
+ })
354
+ .then((t) => {
355
+ assert.lengthOf(t.conversations.items, 1);
356
+ assert.isUndefined(find(t.conversations.items, {id: conversation.id}));
357
+ }));
337
358
  });
338
359
 
339
360
  describe('#removeMember()', () => {
340
361
  let team;
341
362
 
342
- before(() => kirk.webex.internal.team.create({
343
- displayName: `team-${uuid.v4()}`,
344
- participants: [
345
- kirk,
346
- spock
347
- ]
348
- })
349
- .then((t) => {
350
- team = t;
351
- }));
363
+ before(() =>
364
+ kirk.webex.internal.team
365
+ .create({
366
+ displayName: `team-${uuid.v4()}`,
367
+ participants: [kirk, spock],
368
+ })
369
+ .then((t) => {
370
+ team = t;
371
+ })
372
+ );
352
373
 
353
- it('removes a team member from a team', () => kirk.webex.internal.team.removeMember(team, spock)
354
- .then((activity) => {
355
- assert.isActivity(activity);
356
- assert.equal(activity.verb, 'leave');
357
- assert.equal(activity.target.id, team.id);
358
- assert.equal(activity.object.id, spock.id);
374
+ it('removes a team member from a team', () =>
375
+ kirk.webex.internal.team
376
+ .removeMember(team, spock)
377
+ .then((activity) => {
378
+ assert.isActivity(activity);
379
+ assert.equal(activity.verb, 'leave');
380
+ assert.equal(activity.target.id, team.id);
381
+ assert.equal(activity.object.id, spock.id);
359
382
 
360
- return kirk.webex.internal.team.get(team, {
361
- includeTeamMembers: true
362
- });
363
- })
364
- .then((team) => {
365
- assert.equal(team.teamMembers.items.length, 1);
366
- assert.equal(team.teamMembers.items[0].id, kirk.id);
367
- }));
383
+ return kirk.webex.internal.team.get(team, {
384
+ includeTeamMembers: true,
385
+ });
386
+ })
387
+ .then((team) => {
388
+ assert.equal(team.teamMembers.items.length, 1);
389
+ assert.equal(team.teamMembers.items[0].id, kirk.id);
390
+ }));
368
391
  });
369
392
 
370
393
  describe('#unassignModerator()', () => {
371
394
  let team;
372
395
 
373
- before(() => kirk.webex.internal.team.create({
374
- displayName: `team-${uuid.v4()}`,
375
- participants: [
376
- kirk,
377
- spock
378
- ]
379
- })
380
- .then((t) => {
381
- team = t;
396
+ before(() =>
397
+ kirk.webex.internal.team
398
+ .create({
399
+ displayName: `team-${uuid.v4()}`,
400
+ participants: [kirk, spock],
401
+ })
402
+ .then((t) => {
403
+ team = t;
382
404
 
383
- return kirk.webex.internal.team.assignModerator(team, spock);
384
- }));
405
+ return kirk.webex.internal.team.assignModerator(team, spock);
406
+ })
407
+ );
385
408
 
386
- it('unassigns a team moderator', () => kirk.webex.internal.team.unassignModerator(team, spock)
387
- .then((activity) => {
388
- assert.isActivity(activity);
389
- assert.equal(activity.verb, 'unassignModerator');
390
- assert.equal(activity.target.id, team.id);
391
- assert.equal(activity.object.id, spock.id);
409
+ it('unassigns a team moderator', () =>
410
+ kirk.webex.internal.team
411
+ .unassignModerator(team, spock)
412
+ .then((activity) => {
413
+ assert.isActivity(activity);
414
+ assert.equal(activity.verb, 'unassignModerator');
415
+ assert.equal(activity.target.id, team.id);
416
+ assert.equal(activity.object.id, spock.id);
392
417
 
393
- return kirk.webex.internal.team.get(team, {
394
- includeTeamMembers: true
395
- });
396
- })
397
- .then((team) => {
398
- const spockEntry = find(team.teamMembers.items, {id: spock.id});
418
+ return kirk.webex.internal.team.get(team, {
419
+ includeTeamMembers: true,
420
+ });
421
+ })
422
+ .then((team) => {
423
+ const spockEntry = find(team.teamMembers.items, {id: spock.id});
399
424
 
400
- assert.isDefined(spockEntry);
401
- assert.isUndefined(spockEntry.roomProperties);
402
- }));
425
+ assert.isDefined(spockEntry);
426
+ assert.isUndefined(spockEntry.roomProperties);
427
+ }));
403
428
  });
404
429
 
405
430
  describe('#unarchive()', () => {
406
431
  let conversation, team;
407
432
 
408
- before(() => kirk.webex.internal.team.create({
409
- displayName: `team-${uuid.v4()}`,
410
- participants: [
411
- kirk
412
- ]
413
- })
414
- .then((t) => {
415
- team = t;
433
+ before(() =>
434
+ kirk.webex.internal.team
435
+ .create({
436
+ displayName: `team-${uuid.v4()}`,
437
+ participants: [kirk],
438
+ })
439
+ .then((t) => {
440
+ team = t;
416
441
 
417
- return kirk.webex.internal.team.createConversation(team, {
418
- displayName: `team-conversation-${uuid.v4()}`,
419
- participants: [
420
- kirk
421
- ]
422
- });
423
- })
424
- .then((c) => {
425
- conversation = c;
426
-
427
- return Promise.all([
428
- kirk.webex.internal.team.archive(conversation),
429
- kirk.webex.internal.team.archive(team)
430
- ]);
431
- })
432
- .then(() => kirk.webex.internal.team.get(team, {includeTeamConversations: true}))
433
- .then((t) => {
434
- team = t;
435
- conversation = find(team.conversations.items, {id: conversation.id});
436
- }));
442
+ return kirk.webex.internal.team.createConversation(team, {
443
+ displayName: `team-conversation-${uuid.v4()}`,
444
+ participants: [kirk],
445
+ });
446
+ })
447
+ .then((c) => {
448
+ conversation = c;
449
+
450
+ return Promise.all([
451
+ kirk.webex.internal.team.archive(conversation),
452
+ kirk.webex.internal.team.archive(team),
453
+ ]);
454
+ })
455
+ .then(() => kirk.webex.internal.team.get(team, {includeTeamConversations: true}))
456
+ .then((t) => {
457
+ team = t;
458
+ conversation = find(team.conversations.items, {id: conversation.id});
459
+ })
460
+ );
437
461
 
438
462
  it('unarchives a team conversation', () => {
439
463
  assert.include(conversation.tags, 'ARCHIVED');
440
464
  assert.include(conversation.tags, 'HIDDEN');
441
465
 
442
- return kirk.webex.internal.team.unarchive(conversation)
466
+ return kirk.webex.internal.team
467
+ .unarchive(conversation)
443
468
  .then((activity) => {
444
469
  assert.isActivity(activity);
445
470
  assert.equal(activity.verb, 'unarchive');
@@ -459,7 +484,8 @@ describe('plugin-team', () => {
459
484
  it('unarchives a team', () => {
460
485
  assert.isTrue(team.archived);
461
486
 
462
- return kirk.webex.internal.team.unarchive(team)
487
+ return kirk.webex.internal.team
488
+ .unarchive(team)
463
489
  .then((activity) => {
464
490
  assert.isActivity(activity);
465
491
  assert.equal(activity.verb, 'unarchive');
@@ -471,7 +497,9 @@ describe('plugin-team', () => {
471
497
  .then((t) => {
472
498
  assert.isFalse(t.archived);
473
499
 
474
- const generalConversation = find(t.conversations.items, {id: team.generalConversationUuid});
500
+ const generalConversation = find(t.conversations.items, {
501
+ id: team.generalConversationUuid,
502
+ });
475
503
 
476
504
  assert.isDefined(generalConversation);
477
505
  assert.notInclude(generalConversation.tags, 'ARCHIVED');
@@ -483,23 +511,25 @@ describe('plugin-team', () => {
483
511
  describe('#update()', () => {
484
512
  let team;
485
513
 
486
- before(() => kirk.webex.internal.team.create({
487
- displayName: `team-${uuid.v4()}`,
488
- participants: [
489
- kirk
490
- ]
491
- })
492
- .then((t) => {
493
- team = t;
494
- }));
514
+ before(() =>
515
+ kirk.webex.internal.team
516
+ .create({
517
+ displayName: `team-${uuid.v4()}`,
518
+ participants: [kirk],
519
+ })
520
+ .then((t) => {
521
+ team = t;
522
+ })
523
+ );
495
524
 
496
525
  it('updates a team displayName', () => {
497
526
  const obj = {
498
527
  displayName: `updated-team-title-${uuid.v4()}`,
499
- objectType: 'team'
528
+ objectType: 'team',
500
529
  };
501
530
 
502
- return kirk.webex.internal.team.update(team, obj)
531
+ return kirk.webex.internal.team
532
+ .update(team, obj)
503
533
  .then((activity) => {
504
534
  assert.isActivity(activity);
505
535
  assert.equal(activity.verb, 'update');
@@ -512,10 +542,11 @@ describe('plugin-team', () => {
512
542
  it('updates a team summary', () => {
513
543
  const obj = {
514
544
  summary: `updated-team-summary-${uuid.v4()}`,
515
- objectType: 'team'
545
+ objectType: 'team',
516
546
  };
517
547
 
518
- return kirk.webex.internal.team.update(team, obj)
548
+ return kirk.webex.internal.team
549
+ .update(team, obj)
519
550
  .then((activity) => {
520
551
  assert.isActivity(activity);
521
552
  assert.equal(activity.verb, 'update');