@webex/plugin-meetings 3.0.0-beta.87 → 3.0.0-beta.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotation/annotation.types.js +7 -0
- package/dist/annotation/annotation.types.js.map +1 -0
- package/dist/annotation/constants.js +48 -0
- package/dist/annotation/constants.js.map +1 -0
- package/dist/annotation/index.js +325 -0
- package/dist/annotation/index.js.map +1 -0
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +13 -7
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +6 -2
- package/dist/constants.js.map +1 -1
- package/dist/meeting/index.js +15 -1
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/request.js +29 -17
- package/dist/meeting/request.js.map +1 -1
- package/dist/types/annotation/annotation.types.d.ts +33 -0
- package/dist/types/annotation/constants.d.ts +31 -0
- package/dist/types/annotation/index.d.ts +117 -0
- package/dist/types/constants.d.ts +3 -0
- package/dist/types/meeting/index.d.ts +1 -0
- package/dist/types/meeting/request.d.ts +3 -0
- package/package.json +19 -19
- package/src/annotation/annotation.types.ts +37 -0
- package/src/annotation/constants.ts +36 -0
- package/src/annotation/index.ts +314 -0
- package/src/breakouts/index.ts +11 -4
- package/src/constants.ts +3 -0
- package/src/meeting/index.ts +12 -0
- package/src/meeting/request.ts +16 -1
- package/test/unit/spec/annotation/index.ts +420 -0
- package/test/unit/spec/breakouts/index.ts +72 -52
- package/test/unit/spec/meeting/index.js +13 -1
- package/test/unit/spec/meeting/request.js +65 -1
- package/test/unit/spec/meeting/utils.js +1 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import MockWebex from '@webex/test-helper-mock-webex';
|
|
2
|
+
import MockWebSocket from '@webex/test-helper-mock-web-socket';
|
|
3
|
+
import {assert} from '@webex/test-helper-chai';
|
|
4
|
+
import sinon from 'sinon';
|
|
5
|
+
import Mercury from '@webex/internal-plugin-mercury';
|
|
6
|
+
import LLMChannel from '@webex/internal-plugin-llm';
|
|
7
|
+
|
|
8
|
+
import AnnotationService from '../../../../src/annotation/index';
|
|
9
|
+
import {ANNOTATION_RELAY_TYPES, ANNOTATION_REQUEST_TYPE, EVENT_TRIGGERS} from '../../../../src/annotation/constants';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
describe('live-annotation', () => {
|
|
13
|
+
const locusUrl = 'https://locus.wbx2.com/locus/api/v1/loci/163c1787-c1f5-47cc-95eb-ab2d660999e6';
|
|
14
|
+
|
|
15
|
+
describe('annotation', () => {
|
|
16
|
+
let webex, annotationService;
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
webex = new MockWebex({
|
|
20
|
+
children: {
|
|
21
|
+
mercury: Mercury,
|
|
22
|
+
llm: LLMChannel,
|
|
23
|
+
annotation: AnnotationService,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
annotationService = webex.internal.annotation;
|
|
29
|
+
annotationService.connect = sinon.stub().resolves(true);
|
|
30
|
+
annotationService.webex.internal.llm.isConnected = sinon.stub().returns(true);
|
|
31
|
+
annotationService.webex.internal.llm.getBinding = sinon.stub().returns(undefined);
|
|
32
|
+
annotationService.webex.internal.llm.getLocusUrl = sinon.stub().returns(locusUrl);
|
|
33
|
+
annotationService.approvalUrl = 'url/approval';
|
|
34
|
+
annotationService.locusUrl = locusUrl;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
webex.request = sinon.stub().returns(Promise.resolve('REQUEST_RETURN_VALUE'));
|
|
38
|
+
annotationService.register = sinon.stub().resolves({
|
|
39
|
+
body: {
|
|
40
|
+
binding: 'binding',
|
|
41
|
+
webSocketUrl: 'url',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
describe('event message processing', () => {
|
|
48
|
+
beforeEach(async () => {
|
|
49
|
+
annotationService.decryptContent = sinon.stub().returns(Promise.resolve('decryptedContent'));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('eventCommandProcessor call failed', () => {
|
|
53
|
+
const spy = sinon.spy();
|
|
54
|
+
annotationService.on(EVENT_TRIGGERS.ANNOTATION_COMMAND, spy);
|
|
55
|
+
annotationService.eventCommandProcessor({});
|
|
56
|
+
assert.notCalled(spy);
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
annotationService.eventCommandProcessor({
|
|
60
|
+
data: {
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
assert.notCalled(spy);
|
|
64
|
+
|
|
65
|
+
annotationService.eventCommandProcessor({
|
|
66
|
+
data: {
|
|
67
|
+
eventType: 'not:locus.approval_request',
|
|
68
|
+
approval: {
|
|
69
|
+
resourceType: 'AnnotationOnShare',
|
|
70
|
+
actionType: 'actionType'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
assert.notCalled(spy);
|
|
75
|
+
|
|
76
|
+
annotationService.eventCommandProcessor({
|
|
77
|
+
data: {
|
|
78
|
+
eventType: 'locus.approval_request',
|
|
79
|
+
approval: {
|
|
80
|
+
resourceType: 'not:AnnotationOnShare',
|
|
81
|
+
actionType: 'actionType'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
assert.notCalled(spy);
|
|
86
|
+
|
|
87
|
+
annotationService.eventCommandProcessor({
|
|
88
|
+
data: {
|
|
89
|
+
eventType: 'locus.approval_request',
|
|
90
|
+
approval: {
|
|
91
|
+
resourceType: 'AnnotationOnShare',
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
assert.notCalled(spy)
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
it('eventCommandProcessor call success', () => {
|
|
101
|
+
const spy = sinon.spy();
|
|
102
|
+
annotationService.on(EVENT_TRIGGERS.ANNOTATION_COMMAND, spy);
|
|
103
|
+
|
|
104
|
+
annotationService.eventCommandProcessor({
|
|
105
|
+
data: {
|
|
106
|
+
eventType: 'locus.approval_request',
|
|
107
|
+
approval: {
|
|
108
|
+
resourceType: 'AnnotationOnShare',
|
|
109
|
+
actionType: 'actionType'
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
assert.calledOnceWithExactly(spy, {
|
|
115
|
+
type: 'actionType',
|
|
116
|
+
payload: {
|
|
117
|
+
resourceType: 'AnnotationOnShare',
|
|
118
|
+
actionType: 'actionType',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('eventDataProcessor call failed', () => {
|
|
124
|
+
|
|
125
|
+
const spy = sinon.spy(annotationService, "processStrokeMessage");
|
|
126
|
+
|
|
127
|
+
annotationService.eventDataProcessor();
|
|
128
|
+
|
|
129
|
+
assert.notCalled(spy);
|
|
130
|
+
|
|
131
|
+
annotationService.eventDataProcessor({data: {}});
|
|
132
|
+
|
|
133
|
+
assert.notCalled(spy);
|
|
134
|
+
|
|
135
|
+
annotationService.eventDataProcessor({data: {relayType: 'NOT:annotation.client'}});
|
|
136
|
+
|
|
137
|
+
assert.notCalled(spy);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
it('eventDataProcessor call success', () => {
|
|
142
|
+
|
|
143
|
+
const spy = sinon.spy(annotationService, "processStrokeMessage");
|
|
144
|
+
|
|
145
|
+
annotationService.eventDataProcessor({data: {relayType: 'annotation.client', request: 'request'}});
|
|
146
|
+
|
|
147
|
+
assert.calledOnceWithExactly(spy, 'request');
|
|
148
|
+
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
it('processStrokeMessage', async () => {
|
|
153
|
+
const spy = sinon.spy();
|
|
154
|
+
annotationService.on(EVENT_TRIGGERS.ANNOTATION_STROKE_DATA, spy);
|
|
155
|
+
|
|
156
|
+
await annotationService.processStrokeMessage({encryptionKeyUrl: 'encryptionKeyUrl', content: 'content'});
|
|
157
|
+
|
|
158
|
+
assert.calledOnceWithExactly(spy, {
|
|
159
|
+
data: {encryptionKeyUrl: 'encryptionKeyUrl', content: 'decryptedContent'},
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
describe('event message processing',() =>{
|
|
167
|
+
|
|
168
|
+
it('listens to mercury events once', () => {
|
|
169
|
+
|
|
170
|
+
const spy = sinon.spy(webex.internal.mercury, 'on');
|
|
171
|
+
|
|
172
|
+
annotationService.listenToEvents();
|
|
173
|
+
|
|
174
|
+
assert.calledOnceWithExactly(spy, 'event:locus', sinon.match.func);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('listens to llm events once', () => {
|
|
178
|
+
|
|
179
|
+
const spy = sinon.spy(webex.internal.llm, 'on');
|
|
180
|
+
|
|
181
|
+
annotationService.listenToEvents();
|
|
182
|
+
|
|
183
|
+
assert.calledOnceWithExactly(spy, 'event:relay.event', sinon.match.func);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
describe('encrypt/decrypt Content ', () => {
|
|
190
|
+
beforeEach(async () => {
|
|
191
|
+
annotationService.webex.internal.encryption.encryptText = sinon.stub().returns(Promise.resolve('RETURN_VALUE'));
|
|
192
|
+
annotationService.webex.internal.encryption.decryptText = sinon.stub().returns(Promise.resolve('RETURN_VALUE'));
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('encryptContent', async () => {
|
|
196
|
+
const result = await annotationService.encryptContent("encryptionKeyUrl", "content");
|
|
197
|
+
assert.calledOnceWithExactly(webex.internal.encryption.encryptText, "encryptionKeyUrl", "content");
|
|
198
|
+
assert.equal(result, 'RETURN_VALUE')
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('decryptContent ', async() => {
|
|
202
|
+
const result = await annotationService.decryptContent("decryptionKeyUrl", "content");
|
|
203
|
+
assert.calledOnceWithExactly(webex.internal.encryption.decryptText, "decryptionKeyUrl", "content");
|
|
204
|
+
assert.equal(result, 'RETURN_VALUE')
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
describe('publish Stroke Data with LLM is not connected', () => {
|
|
212
|
+
|
|
213
|
+
beforeEach(async () => {
|
|
214
|
+
annotationService.webex.internal.llm.socket = new MockWebSocket();
|
|
215
|
+
annotationService.webex.internal.llm.isConnected = sinon.stub().returns(false);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('publish Stroke Data with LLM is not connected', async () => {
|
|
219
|
+
annotationService.sendStrokeData("", {});
|
|
220
|
+
assert.notCalled(annotationService.webex.internal.llm.socket.send);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
describe('sendStrokeData', () => {
|
|
226
|
+
|
|
227
|
+
beforeEach(async () => {
|
|
228
|
+
annotationService.webex.internal.llm.socket = new MockWebSocket();
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
it('works on publish Stroke Data', async () => {
|
|
233
|
+
const strokeData = {
|
|
234
|
+
content: {
|
|
235
|
+
"contentsBuffer": [{
|
|
236
|
+
"contentArray": [{
|
|
237
|
+
"curveId": "58dcf45c-1fc5-46bf-a902-053621dd8977",
|
|
238
|
+
"curvePoints": [592.593, 352.963, 3.400, 596.710, 352.963, 3.400, 600.000, 352.963, 3.398, 600.000, 352.963, 3.398],
|
|
239
|
+
"stride": 3
|
|
240
|
+
}], "type": "curve", "name": "contentUpdate"
|
|
241
|
+
}], "action": "contentUpdate", "sender": {"name": "perfectt", "id": "4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741"}
|
|
242
|
+
},
|
|
243
|
+
fromUserId: "525ead98-6c93-4fcb-899d-517305c47503",
|
|
244
|
+
fromDeviceUrl: "https://wdm.wbx2.com/wdm/api/v1/devices/0bbecbf8-59ac-410a-b906-b310d1a50867",
|
|
245
|
+
toUserId: "987ead98-6c93-4fcb-899d-517305c47503",
|
|
246
|
+
locusUrl: "https://locus.wbx2.com/locus/api/v1/loci/163c1787-c1f5-47cc-95eb-ab2d660999e6",
|
|
247
|
+
shareInstanceId: "7fa6fe07-dcb1-41ad-973d-7bcf65fab55d",
|
|
248
|
+
encryptionKeyUrl: "encryptionKeyUrl",
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
annotationService.publishEncrypted(strokeData.content, strokeData);
|
|
252
|
+
|
|
253
|
+
const sendObject = {
|
|
254
|
+
id: sinon.match.string,
|
|
255
|
+
type: 'publishRequest',
|
|
256
|
+
recipients: {route: undefined},
|
|
257
|
+
headers: {to: '987ead98-6c93-4fcb-899d-517305c47503'},
|
|
258
|
+
data: {
|
|
259
|
+
eventType: 'relay.event',
|
|
260
|
+
relayType: ANNOTATION_RELAY_TYPES.ANNOTATION_CLIENT,
|
|
261
|
+
request: {
|
|
262
|
+
value: {
|
|
263
|
+
sessionId: sinon.match.string,
|
|
264
|
+
type: ANNOTATION_REQUEST_TYPE.ANNOTATION_MESSAGE,
|
|
265
|
+
locusUrl: locusUrl,
|
|
266
|
+
content: strokeData.content,
|
|
267
|
+
version: "mVersion",
|
|
268
|
+
fromUserId: strokeData.fromUserId,
|
|
269
|
+
fromDeviceUrl: strokeData.fromDeviceUrl,
|
|
270
|
+
shareInstanceId: strokeData.shareInstanceId,
|
|
271
|
+
locusId: '163c1787-c1f5-47cc-95eb-ab2d660999e6',
|
|
272
|
+
encryptionKeyUrl: 'encryptionKeyUrl',
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
trackingId: sinon.match.string,
|
|
277
|
+
timestamp: sinon.match.number,
|
|
278
|
+
sequenceNumber: 1,
|
|
279
|
+
filterMessage: false,
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
assert.calledOnceWithExactly(annotationService.webex.internal.llm.socket.send, sendObject);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
describe('Locus API collection', () => {
|
|
289
|
+
|
|
290
|
+
describe('send approve request', () => {
|
|
291
|
+
it('makes send request approved annotation as expected', async () => {
|
|
292
|
+
const
|
|
293
|
+
requestData = {
|
|
294
|
+
toUserId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
295
|
+
toDeviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057',
|
|
296
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
const result = await annotationService.approveAnnotation(requestData);
|
|
301
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
302
|
+
method: 'POST',
|
|
303
|
+
url: 'url/approval',
|
|
304
|
+
body: {
|
|
305
|
+
actionType: 'REQUESTED',
|
|
306
|
+
resourceType: 'AnnotationOnShare',
|
|
307
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
308
|
+
receivers: [{
|
|
309
|
+
participantId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
310
|
+
deviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057'
|
|
311
|
+
}],
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
describe('cancel Approve request', () => {
|
|
320
|
+
it('makes the cancel Approve request annotation as expected', async () => {
|
|
321
|
+
const
|
|
322
|
+
requestData = {
|
|
323
|
+
toUserId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
324
|
+
toDeviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057',
|
|
325
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
const result = await annotationService.cancelApproveAnnotation(requestData);
|
|
330
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
331
|
+
method: 'POST',
|
|
332
|
+
url: 'url/approval',
|
|
333
|
+
body: {
|
|
334
|
+
actionType: 'CANCELED',
|
|
335
|
+
resourceType: 'AnnotationOnShare',
|
|
336
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
337
|
+
receivers: [{
|
|
338
|
+
participantId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
339
|
+
deviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057'
|
|
340
|
+
}],
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
describe('# close annotation', () => {
|
|
350
|
+
it('makes the close annotation as expected', async () => {
|
|
351
|
+
const
|
|
352
|
+
requestData = {
|
|
353
|
+
toUserId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
354
|
+
toDeviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057',
|
|
355
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
const result = await annotationService.closeAnnotation(requestData);
|
|
360
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
361
|
+
method: 'POST',
|
|
362
|
+
url: 'url/approval',
|
|
363
|
+
body: {
|
|
364
|
+
actionType: 'CLOSED',
|
|
365
|
+
resourceType: 'AnnotationOnShare',
|
|
366
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
367
|
+
receivers: [{
|
|
368
|
+
participantId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
369
|
+
deviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057'
|
|
370
|
+
}],
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
describe('declined annotation', () => {
|
|
380
|
+
it('makes the declined annotation as expected', async () => {
|
|
381
|
+
const approval = {
|
|
382
|
+
url: 'approvalUrl'
|
|
383
|
+
}
|
|
384
|
+
const result = await annotationService.declineRequest(approval);
|
|
385
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
386
|
+
method: 'PUT',
|
|
387
|
+
url: 'approvalUrl',
|
|
388
|
+
body: {
|
|
389
|
+
actionType: 'DECLINED',
|
|
390
|
+
resourceType: 'AnnotationOnShare',
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
describe('# accept annotation', () => {
|
|
399
|
+
it('makes the accepted annotation as expected', async () => {
|
|
400
|
+
const approval = {
|
|
401
|
+
url: 'approvalUrl'
|
|
402
|
+
}
|
|
403
|
+
const result = await annotationService.acceptRequest(approval);
|
|
404
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
405
|
+
method: 'PUT',
|
|
406
|
+
url: 'approvalUrl',
|
|
407
|
+
body: {
|
|
408
|
+
actionType: 'ACCEPTED',
|
|
409
|
+
resourceType: 'AnnotationOnShare',
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
});
|
|
@@ -53,7 +53,12 @@ const getBOResponseWithEditLockInfo = (status: string, withOutToken?: boolean) =
|
|
|
53
53
|
locusUrl: 'locusUrl',
|
|
54
54
|
mainGroupId: 'mainGroupId',
|
|
55
55
|
mainSessionId: 'mainSessionId',
|
|
56
|
-
editlock: {
|
|
56
|
+
editlock: {
|
|
57
|
+
state: 'LOCKED',
|
|
58
|
+
ttl: 30,
|
|
59
|
+
userId: 'cc5d452f-04b6-4876-a4c3-28ca21982c6a',
|
|
60
|
+
token: withOutToken ? '' : 'token1',
|
|
61
|
+
},
|
|
57
62
|
groups: [
|
|
58
63
|
{
|
|
59
64
|
sessions: [
|
|
@@ -580,7 +585,7 @@ describe('plugin-meetings', () => {
|
|
|
580
585
|
);
|
|
581
586
|
assert.calledOnceWithExactly(
|
|
582
587
|
LoggerProxy.logger.info,
|
|
583
|
-
'Breakouts#update --> Edit lock token mismatch'
|
|
588
|
+
'Breakouts#update --> Edit lock token mismatch'
|
|
584
589
|
);
|
|
585
590
|
});
|
|
586
591
|
|
|
@@ -607,15 +612,13 @@ describe('plugin-meetings', () => {
|
|
|
607
612
|
|
|
608
613
|
assert.calledOnceWithExactly(
|
|
609
614
|
LoggerProxy.logger.info,
|
|
610
|
-
'Breakouts#update --> Not authorized to interact with edit lock'
|
|
615
|
+
'Breakouts#update --> Not authorized to interact with edit lock'
|
|
611
616
|
);
|
|
612
617
|
});
|
|
613
618
|
|
|
614
619
|
it('rejects when other unknow error', async () => {
|
|
615
620
|
const mockError = new Error('something wrong');
|
|
616
|
-
webex.request.returns(
|
|
617
|
-
Promise.reject(mockError)
|
|
618
|
-
);
|
|
621
|
+
webex.request.returns(Promise.reject(mockError));
|
|
619
622
|
LoggerProxy.logger.info = sinon.stub();
|
|
620
623
|
|
|
621
624
|
const params = {
|
|
@@ -623,15 +626,11 @@ describe('plugin-meetings', () => {
|
|
|
623
626
|
sessions: [{name: 'Session 1'}],
|
|
624
627
|
};
|
|
625
628
|
|
|
626
|
-
await assert.isRejected(
|
|
627
|
-
breakouts.update(params),
|
|
628
|
-
mockError,
|
|
629
|
-
'something wrong'
|
|
630
|
-
);
|
|
629
|
+
await assert.isRejected(breakouts.update(params), mockError, 'something wrong');
|
|
631
630
|
|
|
632
631
|
assert.calledOnceWithExactly(
|
|
633
632
|
LoggerProxy.logger.info,
|
|
634
|
-
'Breakouts#update --> something wrong'
|
|
633
|
+
'Breakouts#update --> something wrong'
|
|
635
634
|
);
|
|
636
635
|
});
|
|
637
636
|
});
|
|
@@ -987,7 +986,6 @@ describe('plugin-meetings', () => {
|
|
|
987
986
|
});
|
|
988
987
|
|
|
989
988
|
it('do not call unLock if edit lock info not exist ', async () => {
|
|
990
|
-
|
|
991
989
|
breakouts.unLockEditBreakout();
|
|
992
990
|
assert.notCalled(webex.request);
|
|
993
991
|
});
|
|
@@ -1138,6 +1136,34 @@ describe('plugin-meetings', () => {
|
|
|
1138
1136
|
assert.calledOnceWithExactly(breakouts.assign, params);
|
|
1139
1137
|
assert.equal(result, 'ASSIGN_RETURN_VALUE');
|
|
1140
1138
|
});
|
|
1139
|
+
|
|
1140
|
+
it('called with editlock', async () => {
|
|
1141
|
+
breakouts.request = sinon.stub().returns(Promise.resolve('ASSIGN_RETURN_VALUE'));
|
|
1142
|
+
breakouts.editLock = {
|
|
1143
|
+
token: 'token1',
|
|
1144
|
+
};
|
|
1145
|
+
const params = [{id: 'sessionId', emails: ['111@cisco.com'], memberIds: []}];
|
|
1146
|
+
await breakouts.assign(params);
|
|
1147
|
+
const args = breakouts.request.getCall(0).args[0];
|
|
1148
|
+
expect(args).to.be.an('object', {
|
|
1149
|
+
method: 'PUT',
|
|
1150
|
+
uri: 'url',
|
|
1151
|
+
body: {
|
|
1152
|
+
editlock: {token: 'token1', refresh: true},
|
|
1153
|
+
groups: {
|
|
1154
|
+
id: 'sessionId',
|
|
1155
|
+
sessions: [
|
|
1156
|
+
{
|
|
1157
|
+
id: 'sessionId',
|
|
1158
|
+
assigned: [],
|
|
1159
|
+
assignedEmails: ['111@cisco.com'],
|
|
1160
|
+
anyoneCanJoin: false,
|
|
1161
|
+
},
|
|
1162
|
+
],
|
|
1163
|
+
},
|
|
1164
|
+
},
|
|
1165
|
+
});
|
|
1166
|
+
});
|
|
1141
1167
|
});
|
|
1142
1168
|
|
|
1143
1169
|
describe('queryPreAssignments', () => {
|
|
@@ -1145,57 +1171,52 @@ describe('plugin-meetings', () => {
|
|
|
1145
1171
|
webex.request.returns(
|
|
1146
1172
|
Promise.resolve({
|
|
1147
1173
|
body: {
|
|
1148
|
-
|
|
1174
|
+
groups: [
|
|
1149
1175
|
{
|
|
1150
|
-
|
|
1176
|
+
sessions: [
|
|
1151
1177
|
{
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
"b@b.com",
|
|
1156
|
-
"jial2@cisco.com"
|
|
1157
|
-
],
|
|
1158
|
-
"anyoneCanJoin": false
|
|
1178
|
+
name: 'Breakout session 1',
|
|
1179
|
+
assignedEmails: ['a@a.com', 'b@b.com', 'jial2@cisco.com'],
|
|
1180
|
+
anyoneCanJoin: false,
|
|
1159
1181
|
},
|
|
1160
1182
|
{
|
|
1161
|
-
|
|
1162
|
-
|
|
1183
|
+
name: 'Breakout session 2',
|
|
1184
|
+
anyoneCanJoin: false,
|
|
1163
1185
|
},
|
|
1164
1186
|
{
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
"anyoneCanJoin": false
|
|
1170
|
-
}
|
|
1187
|
+
name: 'Breakout session 3',
|
|
1188
|
+
assignedEmails: ['c@c.com'],
|
|
1189
|
+
anyoneCanJoin: false,
|
|
1190
|
+
},
|
|
1171
1191
|
],
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
"d@d.com"
|
|
1175
|
-
]
|
|
1192
|
+
unassignedInvitees: {
|
|
1193
|
+
emails: ['d@d.com'],
|
|
1176
1194
|
},
|
|
1177
|
-
|
|
1178
|
-
}
|
|
1179
|
-
]
|
|
1180
|
-
}
|
|
1195
|
+
type: 'BREAKOUT',
|
|
1196
|
+
},
|
|
1197
|
+
],
|
|
1198
|
+
},
|
|
1181
1199
|
})
|
|
1182
1200
|
);
|
|
1183
1201
|
breakouts.shouldFetchPreassignments = false;
|
|
1184
1202
|
const result = await breakouts.queryPreAssignments();
|
|
1185
1203
|
const arg = webex.request.getCall(0).args[0];
|
|
1186
1204
|
assert.equal(arg.uri, 'url/preassignments');
|
|
1187
|
-
assert.equal(breakouts.groups[0].unassignedInvitees.emails[0],'d@d.com');
|
|
1188
|
-
assert.equal(breakouts.groups[0].sessions[0].name,'Breakout session 1');
|
|
1189
|
-
assert.equal(breakouts.groups[0].sessions[0].anyoneCanJoin,false);
|
|
1190
|
-
assert.equal(
|
|
1191
|
-
|
|
1192
|
-
|
|
1205
|
+
assert.equal(breakouts.groups[0].unassignedInvitees.emails[0], 'd@d.com');
|
|
1206
|
+
assert.equal(breakouts.groups[0].sessions[0].name, 'Breakout session 1');
|
|
1207
|
+
assert.equal(breakouts.groups[0].sessions[0].anyoneCanJoin, false);
|
|
1208
|
+
assert.equal(
|
|
1209
|
+
breakouts.groups[0].sessions[0].assignedEmails.toString(),
|
|
1210
|
+
['a@a.com', 'b@b.com', 'jial2@cisco.com'].toString()
|
|
1211
|
+
);
|
|
1212
|
+
assert.equal(breakouts.groups[0].sessions[1].name, 'Breakout session 2');
|
|
1213
|
+
assert.equal(breakouts.groups[0].sessions[1].anyoneCanJoin, false);
|
|
1193
1214
|
assert.equal(breakouts.groups[0].sessions[1].assignedEmails, undefined);
|
|
1194
|
-
assert.equal(breakouts.groups[0].sessions[2].name,'Breakout session 3');
|
|
1195
|
-
assert.equal(breakouts.groups[0].sessions[2].anyoneCanJoin,false);
|
|
1215
|
+
assert.equal(breakouts.groups[0].sessions[2].name, 'Breakout session 3');
|
|
1216
|
+
assert.equal(breakouts.groups[0].sessions[2].anyoneCanJoin, false);
|
|
1196
1217
|
assert.equal(breakouts.groups[0].sessions[2].assignedEmails[0], 'c@c.com');
|
|
1197
|
-
assert.equal(breakouts.groups[0].unassignedInvitees.emails[0],'d@d.com');
|
|
1198
|
-
assert.equal(breakouts.groups[0].type,'BREAKOUT');
|
|
1218
|
+
assert.equal(breakouts.groups[0].unassignedInvitees.emails[0], 'd@d.com');
|
|
1219
|
+
assert.equal(breakouts.groups[0].type, 'BREAKOUT');
|
|
1199
1220
|
assert.equal(breakouts.shouldFetchPreassignments, true);
|
|
1200
1221
|
});
|
|
1201
1222
|
|
|
@@ -1204,7 +1225,7 @@ describe('plugin-meetings', () => {
|
|
|
1204
1225
|
statusCode: 404,
|
|
1205
1226
|
body: {
|
|
1206
1227
|
errorCode: 201404004,
|
|
1207
|
-
message: 'No pre-assignments created for this meeting'
|
|
1228
|
+
message: 'No pre-assignments created for this meeting',
|
|
1208
1229
|
},
|
|
1209
1230
|
};
|
|
1210
1231
|
webex.request.rejects(response);
|
|
@@ -1216,8 +1237,8 @@ describe('plugin-meetings', () => {
|
|
|
1216
1237
|
'Meeting:breakouts#queryPreAssignments failed',
|
|
1217
1238
|
response
|
|
1218
1239
|
);
|
|
1219
|
-
|
|
1220
|
-
|
|
1240
|
+
});
|
|
1241
|
+
});
|
|
1221
1242
|
|
|
1222
1243
|
describe('#dynamicAssign', () => {
|
|
1223
1244
|
it('should make a PUT request with correct body and return the result', async () => {
|
|
@@ -1247,6 +1268,5 @@ describe('plugin-meetings', () => {
|
|
|
1247
1268
|
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
1248
1269
|
});
|
|
1249
1270
|
});
|
|
1250
|
-
|
|
1251
1271
|
});
|
|
1252
1272
|
});
|
|
@@ -4720,6 +4720,7 @@ describe('plugin-meetings', () => {
|
|
|
4720
4720
|
meeting.controlsOptionsManager = {setLocusUrl: sinon.stub().returns(undefined)};
|
|
4721
4721
|
|
|
4722
4722
|
meeting.breakouts.locusUrlUpdate = sinon.stub();
|
|
4723
|
+
meeting.annotation.locusUrlUpdate = sinon.stub();
|
|
4723
4724
|
|
|
4724
4725
|
meeting.locusInfo.emit(
|
|
4725
4726
|
{function: 'test', file: 'test'},
|
|
@@ -4728,6 +4729,7 @@ describe('plugin-meetings', () => {
|
|
|
4728
4729
|
);
|
|
4729
4730
|
assert.calledWith(meeting.members.locusUrlUpdate, newLocusUrl);
|
|
4730
4731
|
assert.calledOnceWithExactly(meeting.breakouts.locusUrlUpdate, newLocusUrl);
|
|
4732
|
+
assert.calledOnceWithExactly(meeting.annotation.locusUrlUpdate, newLocusUrl);
|
|
4731
4733
|
assert.calledWith(meeting.members.locusUrlUpdate, newLocusUrl);
|
|
4732
4734
|
assert.calledWith(meeting.recordingController.setLocusUrl, newLocusUrl);
|
|
4733
4735
|
assert.calledWith(meeting.controlsOptionsManager.setLocusUrl, newLocusUrl);
|
|
@@ -4744,6 +4746,9 @@ describe('plugin-meetings', () => {
|
|
|
4744
4746
|
record: {
|
|
4745
4747
|
url: 'url',
|
|
4746
4748
|
},
|
|
4749
|
+
approval: {
|
|
4750
|
+
url: 'url',
|
|
4751
|
+
},
|
|
4747
4752
|
},
|
|
4748
4753
|
};
|
|
4749
4754
|
|
|
@@ -4751,6 +4756,9 @@ describe('plugin-meetings', () => {
|
|
|
4751
4756
|
setServiceUrl: sinon.stub().returns(undefined),
|
|
4752
4757
|
setSessionId: sinon.stub().returns(undefined),
|
|
4753
4758
|
};
|
|
4759
|
+
meeting.annotation = {
|
|
4760
|
+
approvalUrlUpdate: sinon.stub().returns(undefined),
|
|
4761
|
+
};
|
|
4754
4762
|
|
|
4755
4763
|
meeting.locusInfo.emit(
|
|
4756
4764
|
{function: 'test', file: 'test'},
|
|
@@ -4760,7 +4768,11 @@ describe('plugin-meetings', () => {
|
|
|
4760
4768
|
|
|
4761
4769
|
assert.calledWith(
|
|
4762
4770
|
meeting.recordingController.setServiceUrl,
|
|
4763
|
-
newLocusServices.services.record.url
|
|
4771
|
+
newLocusServices.services.record.url,
|
|
4772
|
+
);
|
|
4773
|
+
assert.calledWith(
|
|
4774
|
+
meeting.annotation.approvalUrlUpdate,
|
|
4775
|
+
newLocusServices.services.approval.url,
|
|
4764
4776
|
);
|
|
4765
4777
|
assert.calledOnce(meeting.recordingController.setSessionId);
|
|
4766
4778
|
done();
|