@webex/plugin-meetings 2.2.4 → 2.3.0
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/README.md +17 -6
- package/dist/constants.js +12 -10
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/index.js +6 -2
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +54 -19
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +18 -5
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +32 -26
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +18 -39
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +24 -26
- package/dist/meeting/util.js.map +1 -1
- package/package.json +6 -6
- package/src/constants.js +9 -7
- package/src/locus-info/index.js +4 -4
- package/src/locus-info/infoUtils.js +30 -22
- package/src/locus-info/selfUtils.js +10 -1
- package/src/meeting/in-meeting-actions.js +25 -16
- package/src/meeting/index.js +25 -48
- package/src/meeting/util.js +18 -29
- package/test/unit/spec/locus-info/index.js +87 -1
- package/test/unit/spec/locus-info/infoUtils.js +122 -0
- package/test/unit/spec/locus-info/selfUtils.js +43 -0
- package/test/unit/spec/meeting/in-meeting-actions.js +55 -0
- package/test/unit/spec/meeting/index.js +120 -0
- package/test/unit/spec/meeting/utils.js +187 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import sinon from 'sinon';
|
|
2
2
|
import {assert} from '@webex/test-helper-chai';
|
|
3
|
+
|
|
3
4
|
import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
|
|
4
5
|
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
5
6
|
import LoggerConfig
|
|
@@ -173,6 +174,192 @@ describe('plugin-meetings', () => {
|
|
|
173
174
|
assert.equal(parameter.meetingNumber, 'meetingNumber');
|
|
174
175
|
});
|
|
175
176
|
});
|
|
177
|
+
|
|
178
|
+
describe('getUserDisplayHintsFromLocusInfo', () => {
|
|
179
|
+
it('returns display hints', () => {
|
|
180
|
+
assert.deepEqual(MeetingUtil.getUserDisplayHintsFromLocusInfo(), []);
|
|
181
|
+
|
|
182
|
+
assert.deepEqual(
|
|
183
|
+
MeetingUtil.getUserDisplayHintsFromLocusInfo({}),
|
|
184
|
+
[]
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
assert.deepEqual(
|
|
188
|
+
MeetingUtil.getUserDisplayHintsFromLocusInfo({parsedLocus: {}}),
|
|
189
|
+
[]
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
assert.deepEqual(
|
|
193
|
+
MeetingUtil.getUserDisplayHintsFromLocusInfo({parsedLocus: {info: {}}}),
|
|
194
|
+
[]
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
assert.deepEqual(
|
|
198
|
+
MeetingUtil.getUserDisplayHintsFromLocusInfo({parsedLocus: {info: {userDisplayHints: []}}}),
|
|
199
|
+
[]
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
assert.deepEqual(
|
|
203
|
+
MeetingUtil.getUserDisplayHintsFromLocusInfo({
|
|
204
|
+
parsedLocus: {
|
|
205
|
+
info: {
|
|
206
|
+
userDisplayHints: [
|
|
207
|
+
'HINT_1'
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
212
|
+
['HINT_1']
|
|
213
|
+
);
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
describe('canUserLock', () => {
|
|
218
|
+
it('works as expected', () => {
|
|
219
|
+
assert.deepEqual(MeetingUtil.canUserLock(['LOCK_CONTROL_LOCK', 'LOCK_STATUS_UNLOCKED']), true);
|
|
220
|
+
assert.deepEqual(MeetingUtil.canUserLock(['LOCK_CONTROL_LOCK']), false);
|
|
221
|
+
assert.deepEqual(MeetingUtil.canUserLock(['LOCK_STATUS_UNLOCKED']), false);
|
|
222
|
+
assert.deepEqual(MeetingUtil.canUserLock([]), false);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe('canUserUnlock', () => {
|
|
227
|
+
it('works as expected', () => {
|
|
228
|
+
assert.deepEqual(MeetingUtil.canUserUnlock(['LOCK_CONTROL_UNLOCK', 'LOCK_STATUS_LOCKED']), true);
|
|
229
|
+
assert.deepEqual(MeetingUtil.canUserUnlock(['LOCK_CONTROL_UNLOCK']), false);
|
|
230
|
+
assert.deepEqual(MeetingUtil.canUserUnlock(['LOCK_STATUS_LOCKED']), false);
|
|
231
|
+
assert.deepEqual(MeetingUtil.canUserUnlock([]), false);
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
describe('canUserRecord', () => {
|
|
236
|
+
it('works as expected', () => {
|
|
237
|
+
assert.deepEqual(MeetingUtil.canUserRecord(['RECORDING_CONTROL_START']), true);
|
|
238
|
+
assert.deepEqual(MeetingUtil.canUserRecord([]), false);
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
describe('canUserPause', () => {
|
|
243
|
+
it('works as expected', () => {
|
|
244
|
+
assert.deepEqual(MeetingUtil.canUserPause(['RECORDING_CONTROL_PAUSE']), true);
|
|
245
|
+
assert.deepEqual(MeetingUtil.canUserPause([]), false);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
describe('canUserResume', () => {
|
|
250
|
+
it('works as expected', () => {
|
|
251
|
+
assert.deepEqual(MeetingUtil.canUserResume(['RECORDING_CONTROL_RESUME']), true);
|
|
252
|
+
assert.deepEqual(MeetingUtil.canUserResume([]), false);
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
describe('canUserStop', () => {
|
|
257
|
+
it('works as expected', () => {
|
|
258
|
+
assert.deepEqual(MeetingUtil.canUserStop(['RECORDING_CONTROL_STOP']), true);
|
|
259
|
+
assert.deepEqual(MeetingUtil.canUserStop([]), false);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
describe('recording tests', () => {
|
|
264
|
+
let request;
|
|
265
|
+
let locusInfo;
|
|
266
|
+
const locusUrl = 'locusUrl';
|
|
267
|
+
|
|
268
|
+
beforeEach(() => {
|
|
269
|
+
locusInfo = {
|
|
270
|
+
parsedLocus: {
|
|
271
|
+
info: {
|
|
272
|
+
userDisplayHints: [
|
|
273
|
+
'RECORDING_CONTROL_START'
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
request = {
|
|
279
|
+
recordMeeting: sinon.stub().returns(Promise.resolve())
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
describe('startRecording', () => {
|
|
284
|
+
it('can start recording when the correct display hint is present', () => {
|
|
285
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_START');
|
|
286
|
+
|
|
287
|
+
const result = MeetingUtil.startRecording(request, locusUrl, locusInfo);
|
|
288
|
+
|
|
289
|
+
assert.calledWith(request.recordMeeting, {locusUrl, recording: true, paused: false});
|
|
290
|
+
|
|
291
|
+
assert.deepEqual(result, request.recordMeeting.firstCall.returnValue);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it('rejects when correct display hint is not present', () => {
|
|
295
|
+
const result = MeetingUtil.startRecording(request, locusUrl, {});
|
|
296
|
+
|
|
297
|
+
assert.notCalled(request.recordMeeting);
|
|
298
|
+
|
|
299
|
+
assert.isRejected(result);
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
describe('pauseRecording', () => {
|
|
304
|
+
it('can pause recording when the correct display hint is present', () => {
|
|
305
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_PAUSE');
|
|
306
|
+
|
|
307
|
+
const result = MeetingUtil.pauseRecording(request, locusUrl, locusInfo);
|
|
308
|
+
|
|
309
|
+
assert.calledWith(request.recordMeeting, {locusUrl, recording: true, paused: true});
|
|
310
|
+
|
|
311
|
+
assert.deepEqual(result, request.recordMeeting.firstCall.returnValue);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
it('rejects when correct display hint is not present', () => {
|
|
315
|
+
const result = MeetingUtil.pauseRecording(request, locusUrl, {});
|
|
316
|
+
|
|
317
|
+
assert.notCalled(request.recordMeeting);
|
|
318
|
+
|
|
319
|
+
assert.isRejected(result);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
describe('resumeRecording', () => {
|
|
324
|
+
it('can resume recording when the correct display hint is present', () => {
|
|
325
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_RESUME');
|
|
326
|
+
|
|
327
|
+
const result = MeetingUtil.resumeRecording(request, locusUrl, locusInfo);
|
|
328
|
+
|
|
329
|
+
assert.calledWith(request.recordMeeting, {locusUrl, recording: true, paused: false});
|
|
330
|
+
|
|
331
|
+
assert.deepEqual(result, request.recordMeeting.firstCall.returnValue);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it('rejects when correct display hint is not present', () => {
|
|
335
|
+
const result = MeetingUtil.resumeRecording(request, locusUrl, {});
|
|
336
|
+
|
|
337
|
+
assert.notCalled(request.recordMeeting);
|
|
338
|
+
|
|
339
|
+
assert.isRejected(result);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
describe('stopRecording', () => {
|
|
344
|
+
it('can stop recording when the correct display hint is present', () => {
|
|
345
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_STOP');
|
|
346
|
+
|
|
347
|
+
const result = MeetingUtil.stopRecording(request, locusUrl, locusInfo);
|
|
348
|
+
|
|
349
|
+
assert.calledWith(request.recordMeeting, {locusUrl, recording: false, paused: false});
|
|
350
|
+
|
|
351
|
+
assert.deepEqual(result, request.recordMeeting.firstCall.returnValue);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it('rejects when correct display hint is not present', () => {
|
|
355
|
+
const result = MeetingUtil.stopRecording(request, locusUrl, {});
|
|
356
|
+
|
|
357
|
+
assert.notCalled(request.recordMeeting);
|
|
358
|
+
|
|
359
|
+
assert.isRejected(result);
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
});
|
|
176
363
|
});
|
|
177
364
|
});
|
|
178
365
|
|