@webex/plugin-meetings 3.0.0-beta.180 → 3.0.0-beta.181

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.
@@ -1,518 +1,582 @@
1
- import { DISPLAY_HINTS } from '@webex/plugin-meetings/src/constants';
1
+ import {DISPLAY_HINTS} from '@webex/plugin-meetings/src/constants';
2
2
  import ControlsOptionsUtil from '@webex/plugin-meetings/src/controls-options-manager/util';
3
- import { assert } from 'chai';
3
+ import {assert} from 'chai';
4
4
  import sinon from 'sinon';
5
5
 
6
6
  describe('plugin-meetings', () => {
7
- describe('controls-option-manager tests', () => {
8
- describe('util tests', () => {
9
-
10
- let locusInfo;
11
-
12
- beforeEach(() => {
13
- sinon.restore();
14
-
15
- locusInfo = {
16
- parsedLocus: {
17
- info: {
18
- userDisplayHints: [],
19
- },
20
- },
21
- };
22
- });
23
-
24
- describe('hasHints()', () => {
25
- it('should return true if all hints are found', () => {
26
- const hints = ['EXAMPLE_HINT_A', 'EXAMPLE_HINT_B']
27
-
28
- locusInfo.parsedLocus.info.userDisplayHints.push(...hints);
29
-
30
- assert.isTrue(ControlsOptionsUtil.hasHints({requiredHints: hints, displayHints: hints}));
31
- });
32
-
33
- it('should return false if all hints are not found', () => {
34
- const hints = ['EXAMPLE_HINT_A', 'EXAMPLE_HINT_B']
35
-
36
- locusInfo.parsedLocus.info.userDisplayHints.push(...hints);
37
-
38
- assert.isFalse(ControlsOptionsUtil.hasHints({requiredHints: hints, displayHints: []}));
39
- });
40
- });
41
-
42
- describe('canUpdateAudio()', () => {
43
- beforeEach(() => {
44
- ControlsOptionsUtil.hasHints = sinon.stub().returns(true);
45
- });
46
-
47
- it('should call hasHints() with proper hints when `muted` is true', () => {
48
- ControlsOptionsUtil.canUpdateAudio({properties: {muted: true}}, [])
49
-
50
- assert.calledWith(ControlsOptionsUtil.hasHints, {
51
- requiredHints: [DISPLAY_HINTS.MUTE_ALL],
52
- displayHints: [],
53
- });
54
- });
55
-
56
- it('should call hasHints() with proper hints when `muted` is false', () => {
57
- ControlsOptionsUtil.canUpdateAudio({properties: {muted: false}}, [])
58
-
59
- assert.calledWith(ControlsOptionsUtil.hasHints, {
60
- requiredHints: [DISPLAY_HINTS.UNMUTE_ALL],
61
- displayHints: [],
62
- });
63
- });
64
-
65
- it('should call hasHints() with proper hints when `disallowUnmute` is true', () => {
66
- ControlsOptionsUtil.canUpdateAudio({properties: {disallowUnmute: true}}, [])
67
-
68
- assert.calledWith(ControlsOptionsUtil.hasHints, {
69
- requiredHints: [DISPLAY_HINTS.ENABLE_HARD_MUTE],
70
- displayHints: [],
71
- });
72
- });
73
-
74
- it('should call hasHints() with proper hints when `disallowUnmute` is false', () => {
75
- ControlsOptionsUtil.canUpdateAudio({properties: {disallowUnmute: false}}, [])
76
-
77
- assert.calledWith(ControlsOptionsUtil.hasHints, {
78
- requiredHints: [DISPLAY_HINTS.DISABLE_HARD_MUTE],
79
- displayHints: [],
80
- });
81
- });
82
-
83
- it('should call hasHints() with proper hints when `muteOnEntry` is true', () => {
84
- ControlsOptionsUtil.canUpdateAudio({properties: {muteOnEntry: true}}, [])
85
-
86
- assert.calledWith(ControlsOptionsUtil.hasHints, {
87
- requiredHints: [DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY],
88
- displayHints: [],
89
- });
90
- });
91
-
92
- it('should call hasHints() with proper hints when `muteOnEntry` is false', () => {
93
- ControlsOptionsUtil.canUpdateAudio({properties: {muteOnEntry: false}}, [])
94
-
95
- assert.calledWith(ControlsOptionsUtil.hasHints, {
96
- requiredHints: [DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY],
97
- displayHints: [],
98
- });
99
- });
100
-
101
- it('should call hasHints() with all properties after negotiating hints', () => {
102
- const properties = {
103
- muted: true,
104
- disallowUnmute: true,
105
- muteOnEntry: true,
106
- };
107
-
108
- ControlsOptionsUtil.canUpdateAudio({properties}, []);
109
-
110
- assert.calledWith(ControlsOptionsUtil.hasHints, {
111
- requiredHints: [
112
- DISPLAY_HINTS.MUTE_ALL,
113
- DISPLAY_HINTS.ENABLE_HARD_MUTE,
114
- DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY,
115
- ],
116
- displayHints: [],
117
- });
118
- });
119
-
120
- it('should return the resolution of hasHints()', () => {
121
- const expected = 'example-return-value'
122
- ControlsOptionsUtil.hasHints = sinon.stub().returns(expected);
123
-
124
- const results = ControlsOptionsUtil.canUpdateAudio({properties: {}}, []);
125
-
126
- assert.calledOnce(ControlsOptionsUtil.hasHints);
127
- assert.equal(results, expected);
128
- });
129
- });
130
-
131
- describe('canUpdateRaiseHand()', () => {
132
- beforeEach(() => {
133
- ControlsOptionsUtil.hasHints = sinon.stub().returns(true);
134
- });
135
-
136
- it('should call hasHints() with proper hints when `enabled` is true', () => {
137
- ControlsOptionsUtil.canUpdateRaiseHand({properties: {enabled: true}}, [])
138
-
139
- assert.calledWith(ControlsOptionsUtil.hasHints, {
140
- requiredHints: [DISPLAY_HINTS.ENABLE_RAISE_HAND],
141
- displayHints: [],
142
- });
143
- });
144
-
145
- it('should call hasHints() with proper hints when `enabled` is false', () => {
146
- ControlsOptionsUtil.canUpdateRaiseHand({properties: {enabled: false}}, [])
147
-
148
- assert.calledWith(ControlsOptionsUtil.hasHints, {
149
- requiredHints: [DISPLAY_HINTS.DISABLE_RAISE_HAND],
150
- displayHints: [],
151
- });
152
- });
153
-
154
- it('should return the resolution of hasHints()', () => {
155
- const expected = 'example-return-value'
156
- ControlsOptionsUtil.hasHints = sinon.stub().returns(expected);
157
-
158
- const results = ControlsOptionsUtil.canUpdateRaiseHand({properties: {}}, []);
159
-
160
- assert.calledOnce(ControlsOptionsUtil.hasHints);
161
- assert.equal(results, expected);
162
- });
163
- });
164
-
165
- describe('canUpdateReactions()', () => {
166
- beforeEach(() => {
167
- ControlsOptionsUtil.hasHints = sinon.stub().returns(true);
168
- });
169
-
170
- it('should call hasHints() with proper hints when `enabled` is true', () => {
171
- ControlsOptionsUtil.canUpdateReactions({properties: {enabled: true}}, [])
172
-
173
- assert.calledWith(ControlsOptionsUtil.hasHints, {
174
- requiredHints: [DISPLAY_HINTS.ENABLE_REACTIONS],
175
- displayHints: [],
176
- });
177
- });
178
-
179
- it('should call hasHints() with proper hints when `enabled` is false', () => {
180
- ControlsOptionsUtil.canUpdateReactions({properties: {enabled: false}}, [])
181
-
182
- assert.calledWith(ControlsOptionsUtil.hasHints, {
183
- requiredHints: [DISPLAY_HINTS.DISABLE_REACTIONS],
184
- displayHints: [],
185
- });
186
- });
187
-
188
- it('should call hasHints() with proper hints when `showDisplayNameWithReactions` is true', () => {
189
- ControlsOptionsUtil.canUpdateReactions({properties: {showDisplayNameWithReactions: true}}, [])
190
-
191
- assert.calledWith(ControlsOptionsUtil.hasHints, {
192
- requiredHints: [DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME],
193
- displayHints: [],
194
- });
195
- });
196
-
197
- it('should call hasHints() with proper hints when `showDisplayNameWithReactions` is false', () => {
198
- ControlsOptionsUtil.canUpdateReactions({properties: {showDisplayNameWithReactions: false}}, [])
199
-
200
- assert.calledWith(ControlsOptionsUtil.hasHints, {
201
- requiredHints: [DISPLAY_HINTS.DISABLE_SHOW_DISPLAY_NAME],
202
- displayHints: [],
203
- });
204
- });
205
-
206
- it('should call hasHints() with only enabled hints when respective property is provided', () => {
207
- const properties = {
208
- enabled: true,
209
- };
210
-
211
- ControlsOptionsUtil.canUpdateReactions({properties}, []);
212
-
213
- assert.calledWith(ControlsOptionsUtil.hasHints, {
214
- requiredHints: [
215
- DISPLAY_HINTS.ENABLE_REACTIONS,
216
- ],
217
- displayHints: [],
218
- });
219
- });
220
-
221
- it('should call hasHints() with only display name hints when respective property is provided', () => {
222
- const properties = {
223
- enabled: true,
224
- showDisplayNameWithReactions: true,
225
- };
226
-
227
- ControlsOptionsUtil.canUpdateReactions({properties}, []);
228
-
229
- assert.calledWith(ControlsOptionsUtil.hasHints, {
230
- requiredHints: [
231
- DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME,
232
- ],
233
- displayHints: [],
234
- });
235
- });
236
-
237
- it('should return the resolution of hasHints()', () => {
238
- const expected = 'example-return-value'
239
- ControlsOptionsUtil.hasHints = sinon.stub().returns(expected);
240
-
241
- const results = ControlsOptionsUtil.canUpdateReactions({properties: {}}, []);
242
-
243
- assert.calledOnce(ControlsOptionsUtil.hasHints);
244
- assert.equal(results, expected);
245
- });
246
- });
247
-
248
- describe('canUpdateShareControl()', () => {
249
- beforeEach(() => {
250
- ControlsOptionsUtil.hasHints = sinon.stub().returns(true);
251
- });
252
-
253
- it('should call hasHints() with proper hints', () => {
254
- ControlsOptionsUtil.canUpdateShareControl([])
255
-
256
- assert.calledWith(ControlsOptionsUtil.hasHints, {
257
- requiredHints: [DISPLAY_HINTS.SHARE_CONTROL],
258
- displayHints: [],
259
- });
260
- });
261
-
262
- it('should return the resolution of hasHints()', () => {
263
- const expected = 'example-return-value'
264
- ControlsOptionsUtil.hasHints = sinon.stub().returns(expected);
265
-
266
- const results = ControlsOptionsUtil.canUpdateShareControl([]);
267
-
268
- assert.calledOnce(ControlsOptionsUtil.hasHints);
269
- assert.equal(results, expected);
270
- });
271
- });
272
-
273
- describe('canUpdateVideo()', () => {
274
- beforeEach(() => {
275
- ControlsOptionsUtil.hasHints = sinon.stub().returns(true);
276
- });
277
-
278
- it('should call hasHints() with proper hints when `enabled` is true', () => {
279
- ControlsOptionsUtil.canUpdateVideo({properties: {enabled: true}}, [])
280
-
281
- assert.calledWith(ControlsOptionsUtil.hasHints, {
282
- requiredHints: [DISPLAY_HINTS.ENABLE_VIDEO],
283
- displayHints: [],
284
- });
285
- });
286
-
287
- it('should call hasHints() with proper hints when `enabled` is false', () => {
288
- ControlsOptionsUtil.canUpdateVideo({properties: {enabled: false}}, [])
289
-
290
- assert.calledWith(ControlsOptionsUtil.hasHints, {
291
- requiredHints: [DISPLAY_HINTS.DISABLE_VIDEO],
292
- displayHints: [],
293
- });
294
- });
295
-
296
- it('should return the resolution of hasHints()', () => {
297
- const expected = 'example-return-value'
298
- ControlsOptionsUtil.hasHints = sinon.stub().returns(expected);
299
-
300
- const results = ControlsOptionsUtil.canUpdateVideo({properties: {}}, []);
301
-
302
- assert.calledOnce(ControlsOptionsUtil.hasHints);
303
- assert.equal(results, expected);
304
- });
305
- });
306
-
307
- describe('canUpdateViewTheParticipantsList()', () => {
308
- beforeEach(() => {
309
- ControlsOptionsUtil.hasHints = sinon.stub().returns(true);
310
- });
311
-
312
- it('should call hasHints() with proper hints when `enabled` is true', () => {
313
- ControlsOptionsUtil.canUpdateViewTheParticipantsList({properties: {enabled: true}}, [])
314
-
315
- assert.calledWith(ControlsOptionsUtil.hasHints, {
316
- requiredHints: [DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST],
317
- displayHints: [],
318
- });
319
- });
320
-
321
- it('should call hasHints() with proper hints when `enabled` is false', () => {
322
- ControlsOptionsUtil.canUpdateViewTheParticipantsList({properties: {enabled: false}}, [])
323
-
324
- assert.calledWith(ControlsOptionsUtil.hasHints, {
325
- requiredHints: [DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST],
326
- displayHints: [],
327
- });
328
- });
329
-
330
- it('should return the resolution of hasHints()', () => {
331
- const expected = 'example-return-value'
332
- ControlsOptionsUtil.hasHints = sinon.stub().returns(expected);
333
-
334
- const results = ControlsOptionsUtil.canUpdateViewTheParticipantsList({properties: {}}, []);
335
-
336
- assert.calledOnce(ControlsOptionsUtil.hasHints);
337
- assert.equal(results, expected);
338
- });
339
- });
340
-
341
- describe('canUpdate()', () => {
342
- const displayHints = [];
343
-
344
- beforeEach(() => {
345
- ControlsOptionsUtil.canUpdateAudio = sinon.stub().returns(true);
346
- ControlsOptionsUtil.canUpdateRaiseHand = sinon.stub().returns(true);
347
- ControlsOptionsUtil.canUpdateReactions = sinon.stub().returns(true);
348
- ControlsOptionsUtil.canUpdateShareControl = sinon.stub().returns(true);
349
- ControlsOptionsUtil.canUpdateVideo = sinon.stub().returns(true);
350
- ControlsOptionsUtil.canUpdateViewTheParticipantsList = sinon.stub().returns(true);
351
- });
352
-
353
- it('should only call canUpdateAudio() if the scope is audio', () => {
354
- const control = { scope: 'audio' };
355
-
356
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
357
-
358
- assert.calledWith(ControlsOptionsUtil.canUpdateAudio, control, displayHints);
359
- assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
360
- assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
361
- assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
362
- assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
363
- assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
364
- assert.isTrue(results);
365
- });
366
-
367
- it('should only call canUpdateRaiseHand() if the scope is raiseHand', () => {
368
- const control = { scope: 'raiseHand' };
369
-
370
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
371
-
372
- assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
373
- assert.calledWith(ControlsOptionsUtil.canUpdateRaiseHand, control, displayHints);
374
- assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
375
- assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
376
- assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
377
- assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
378
- assert.isTrue(results);
379
- })
380
-
381
- it('should only call canUpdateReactions() if the scope is reactions', () => {
382
- const control = { scope: 'reactions' };
383
-
384
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
385
-
386
- assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
387
- assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
388
- assert.calledWith(ControlsOptionsUtil.canUpdateReactions, control, displayHints);
389
- assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
390
- assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
391
- assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
392
- assert.isTrue(results);
393
- });
394
-
395
- it('should only call canUpdateShareControl() if the scope is shareControl', () => {
396
- const control = { scope: 'shareControl' };
397
-
398
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
399
-
400
- assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
401
- assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
402
- assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
403
- assert.calledWith(ControlsOptionsUtil.canUpdateShareControl, displayHints);
404
- assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
405
- assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
406
- assert.isTrue(results);
407
- });
408
-
409
- it('should only call canUpdateVideo() if the scope is video', () => {
410
- const control = { scope: 'video' };
411
-
412
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
413
-
414
- assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
415
- assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
416
- assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
417
- assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
418
- assert.calledWith(ControlsOptionsUtil.canUpdateVideo, control, displayHints);
419
- assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
420
- assert.isTrue(results);
421
- });
422
-
423
- it('should only call canUpdateViewTheParticipantsList() if the scope is viewTheParticipantList', () => {
424
- const control = { scope: 'viewTheParticipantList' };
425
-
426
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
427
-
428
- assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
429
- assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
430
- assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
431
- assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
432
- assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
433
- assert.calledWith(ControlsOptionsUtil.canUpdateViewTheParticipantsList, control, displayHints);
434
- assert.isTrue(results);
435
- });
436
-
437
- it('should return false when the provided control scope is not supported', () => {
438
- const control = { scope: 'invalid' };
439
-
440
- const results = ControlsOptionsUtil.canUpdate(control, displayHints);
441
-
442
- assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
443
- assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
444
- assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
445
- assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
446
- assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
447
- assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
448
- assert.isFalse(results);
449
- });
450
- });
451
-
452
- describe('canUserSetMuteOnEntry', () => {
453
- it('can set mute on entry enable', () => {
454
- locusInfo.parsedLocus.info.userDisplayHints.push('ENABLE_MUTE_ON_ENTRY');
455
-
456
- assert.equal(ControlsOptionsUtil.canSetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints), true);
457
- });
458
-
459
- it('can set mute on entry disable', () => {
460
- locusInfo.parsedLocus.info.userDisplayHints.push('DISABLE_MUTE_ON_ENTRY');
461
-
462
- assert.equal(ControlsOptionsUtil.canUnsetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints), true);
463
- });
464
-
465
- it('rejects when correct display hint is not present for setting mute on entry', () => {
466
- assert.equal(ControlsOptionsUtil.canSetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints), false);
467
- });
468
-
469
- it('rejects when correct display hint is not present for unsetting mute on entry', () => {
470
- assert.equal(ControlsOptionsUtil.canUnsetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints), false);
471
- });
472
- });
473
-
474
- describe('canSetDisallowUnmute', () => {
475
- it('can set disallow unmute enable', () => {
476
- locusInfo.parsedLocus.info.userDisplayHints.push('ENABLE_HARD_MUTE');
477
-
478
- assert.equal(ControlsOptionsUtil.canSetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints), true);
479
- });
480
-
481
- it('can set disallow unmute disable', () => {
482
- locusInfo.parsedLocus.info.userDisplayHints.push('DISABLE_HARD_MUTE');
483
-
484
- assert.equal(ControlsOptionsUtil.canUnsetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints), true);
485
- });
486
-
487
- it('rejects when correct display hint is not present', () => {
488
- assert.equal(ControlsOptionsUtil.canSetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints), false);
489
- });
490
-
491
- it('rejects when correct display hint is not present', () => {
492
- assert.equal(ControlsOptionsUtil.canUnsetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints), false);
493
- });
494
- });
495
-
496
- describe('canSetMuteAll', () => {
497
- it('can mute all', () => {
498
- locusInfo.parsedLocus.info.userDisplayHints.push('MUTE_ALL');
499
-
500
- assert.equal(ControlsOptionsUtil.canSetMuted(locusInfo.parsedLocus.info.userDisplayHints), true);
501
- });
502
-
503
- it('can unmute all', () => {
504
- locusInfo.parsedLocus.info.userDisplayHints.push('UNMUTE_ALL');
505
-
506
- assert.equal(ControlsOptionsUtil.canUnsetMuted(locusInfo.parsedLocus.info.userDisplayHints), true);
507
- });
508
- it('rejects when correct display hint is not present', () => {
509
- assert.equal(ControlsOptionsUtil.canSetMuted(locusInfo.parsedLocus.info.userDisplayHints), false);
510
- });
511
-
512
- it('rejects when correct display hint is not present', () => {
513
- assert.equal(ControlsOptionsUtil.canUnsetMuted(locusInfo.parsedLocus.info.userDisplayHints), false);
514
- });
515
- });
7
+ describe('controls-option-manager tests', () => {
8
+ describe('util tests', () => {
9
+ let locusInfo;
10
+
11
+ beforeEach(() => {
12
+ sinon.restore();
13
+
14
+ locusInfo = {
15
+ parsedLocus: {
16
+ info: {
17
+ userDisplayHints: [],
18
+ },
19
+ },
20
+ };
21
+ });
22
+
23
+ describe('hasHints()', () => {
24
+ it('should return true if all hints are found', () => {
25
+ const hints = ['EXAMPLE_HINT_A', 'EXAMPLE_HINT_B'];
26
+
27
+ locusInfo.parsedLocus.info.userDisplayHints.push(...hints);
28
+
29
+ assert.isTrue(ControlsOptionsUtil.hasHints({requiredHints: hints, displayHints: hints}));
30
+ });
31
+
32
+ it('should return false if all hints are not found', () => {
33
+ const hints = ['EXAMPLE_HINT_A', 'EXAMPLE_HINT_B'];
34
+
35
+ locusInfo.parsedLocus.info.userDisplayHints.push(...hints);
36
+
37
+ assert.isFalse(ControlsOptionsUtil.hasHints({requiredHints: hints, displayHints: []}));
38
+ });
39
+ });
40
+
41
+ describe('hasPolicies()', () => {
42
+ it('should return true if all policies are found', () => {
43
+ assert.isTrue(
44
+ ControlsOptionsUtil.hasPolicies({
45
+ requiredPolicies: ['EXAMPLE_POLICY_A', 'EXAMPLE_POLICY_B'],
46
+ policies: {EXAMPLE_POLICY_A: true, EXAMPLE_POLICY_B: true, EXAMPLE_POLICY_C: true},
47
+ })
48
+ );
49
+ });
50
+
51
+ it('should return false if all policies are not found', () => {
52
+ assert.isFalse(
53
+ ControlsOptionsUtil.hasPolicies({
54
+ requiredPolicies: ['EXAMPLE_POLICY_A', 'EXAMPLE_POLICY_C'],
55
+ policies: {EXAMPLE_POLICY_A: true, EXAMPLE_POLICY_B: true},
56
+ })
57
+ );
58
+ });
59
+ });
60
+
61
+ describe('canUpdateAudio()', () => {
62
+ beforeEach(() => {
63
+ sinon.stub(ControlsOptionsUtil, 'hasHints').returns(true);
64
+ });
65
+
66
+ it('should call hasHints() with proper hints when `muted` is true', () => {
67
+ ControlsOptionsUtil.canUpdateAudio({properties: {muted: true}}, []);
68
+
69
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
70
+ requiredHints: [DISPLAY_HINTS.MUTE_ALL],
71
+ displayHints: [],
72
+ });
73
+ });
74
+
75
+ it('should call hasHints() with proper hints when `muted` is false', () => {
76
+ ControlsOptionsUtil.canUpdateAudio({properties: {muted: false}}, []);
77
+
78
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
79
+ requiredHints: [DISPLAY_HINTS.UNMUTE_ALL],
80
+ displayHints: [],
81
+ });
82
+ });
83
+
84
+ it('should call hasHints() with proper hints when `disallowUnmute` is true', () => {
85
+ ControlsOptionsUtil.canUpdateAudio({properties: {disallowUnmute: true}}, []);
86
+
87
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
88
+ requiredHints: [DISPLAY_HINTS.ENABLE_HARD_MUTE],
89
+ displayHints: [],
90
+ });
91
+ });
92
+
93
+ it('should call hasHints() with proper hints when `disallowUnmute` is false', () => {
94
+ ControlsOptionsUtil.canUpdateAudio({properties: {disallowUnmute: false}}, []);
95
+
96
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
97
+ requiredHints: [DISPLAY_HINTS.DISABLE_HARD_MUTE],
98
+ displayHints: [],
99
+ });
100
+ });
101
+
102
+ it('should call hasHints() with proper hints when `muteOnEntry` is true', () => {
103
+ ControlsOptionsUtil.canUpdateAudio({properties: {muteOnEntry: true}}, []);
104
+
105
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
106
+ requiredHints: [DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY],
107
+ displayHints: [],
108
+ });
109
+ });
110
+
111
+ it('should call hasHints() with proper hints when `muteOnEntry` is false', () => {
112
+ ControlsOptionsUtil.canUpdateAudio({properties: {muteOnEntry: false}}, []);
113
+
114
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
115
+ requiredHints: [DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY],
116
+ displayHints: [],
117
+ });
118
+ });
119
+
120
+ it('should call hasHints() with all properties after negotiating hints', () => {
121
+ const properties = {
122
+ muted: true,
123
+ disallowUnmute: true,
124
+ muteOnEntry: true,
125
+ };
126
+
127
+ ControlsOptionsUtil.canUpdateAudio({properties}, []);
128
+
129
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
130
+ requiredHints: [
131
+ DISPLAY_HINTS.MUTE_ALL,
132
+ DISPLAY_HINTS.ENABLE_HARD_MUTE,
133
+ DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY,
134
+ ],
135
+ displayHints: [],
136
+ });
137
+ });
138
+
139
+ it('should return the resolution of hasHints()', () => {
140
+ const expected = 'example-return-value';
141
+ ControlsOptionsUtil.hasHints.returns(expected);
142
+
143
+ const results = ControlsOptionsUtil.canUpdateAudio({properties: {}}, []);
144
+
145
+ assert.calledOnce(ControlsOptionsUtil.hasHints);
146
+ assert.equal(results, expected);
147
+ });
148
+ });
149
+
150
+ describe('canUpdateRaiseHand()', () => {
151
+ beforeEach(() => {
152
+ sinon.stub(ControlsOptionsUtil, 'hasHints').returns(true);
153
+ });
154
+
155
+ it('should call hasHints() with proper hints when `enabled` is true', () => {
156
+ ControlsOptionsUtil.canUpdateRaiseHand({properties: {enabled: true}}, []);
157
+
158
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
159
+ requiredHints: [DISPLAY_HINTS.ENABLE_RAISE_HAND],
160
+ displayHints: [],
161
+ });
162
+ });
163
+
164
+ it('should call hasHints() with proper hints when `enabled` is false', () => {
165
+ ControlsOptionsUtil.canUpdateRaiseHand({properties: {enabled: false}}, []);
166
+
167
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
168
+ requiredHints: [DISPLAY_HINTS.DISABLE_RAISE_HAND],
169
+ displayHints: [],
170
+ });
171
+ });
172
+
173
+ it('should return the resolution of hasHints()', () => {
174
+ const expected = 'example-return-value';
175
+ ControlsOptionsUtil.hasHints.returns(expected);
176
+
177
+ const results = ControlsOptionsUtil.canUpdateRaiseHand({properties: {}}, []);
178
+
179
+ assert.calledOnce(ControlsOptionsUtil.hasHints);
180
+ assert.equal(results, expected);
181
+ });
182
+ });
183
+
184
+ describe('canUpdateReactions()', () => {
185
+ beforeEach(() => {
186
+ sinon.stub(ControlsOptionsUtil, 'hasHints').returns(true);
187
+ });
188
+
189
+ it('should call hasHints() with proper hints when `enabled` is true', () => {
190
+ ControlsOptionsUtil.canUpdateReactions({properties: {enabled: true}}, []);
191
+
192
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
193
+ requiredHints: [DISPLAY_HINTS.ENABLE_REACTIONS],
194
+ displayHints: [],
195
+ });
196
+ });
197
+
198
+ it('should call hasHints() with proper hints when `enabled` is false', () => {
199
+ ControlsOptionsUtil.canUpdateReactions({properties: {enabled: false}}, []);
200
+
201
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
202
+ requiredHints: [DISPLAY_HINTS.DISABLE_REACTIONS],
203
+ displayHints: [],
204
+ });
205
+ });
206
+
207
+ it('should call hasHints() with proper hints when `showDisplayNameWithReactions` is true', () => {
208
+ ControlsOptionsUtil.canUpdateReactions(
209
+ {properties: {showDisplayNameWithReactions: true}},
210
+ []
211
+ );
212
+
213
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
214
+ requiredHints: [DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME],
215
+ displayHints: [],
216
+ });
217
+ });
218
+
219
+ it('should call hasHints() with proper hints when `showDisplayNameWithReactions` is false', () => {
220
+ ControlsOptionsUtil.canUpdateReactions(
221
+ {properties: {showDisplayNameWithReactions: false}},
222
+ []
223
+ );
224
+
225
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
226
+ requiredHints: [DISPLAY_HINTS.DISABLE_SHOW_DISPLAY_NAME],
227
+ displayHints: [],
228
+ });
229
+ });
230
+
231
+ it('should call hasHints() with only enabled hints when respective property is provided', () => {
232
+ const properties = {
233
+ enabled: true,
234
+ };
235
+
236
+ ControlsOptionsUtil.canUpdateReactions({properties}, []);
237
+
238
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
239
+ requiredHints: [DISPLAY_HINTS.ENABLE_REACTIONS],
240
+ displayHints: [],
241
+ });
242
+ });
243
+
244
+ it('should call hasHints() with only display name hints when respective property is provided', () => {
245
+ const properties = {
246
+ enabled: true,
247
+ showDisplayNameWithReactions: true,
248
+ };
249
+
250
+ ControlsOptionsUtil.canUpdateReactions({properties}, []);
251
+
252
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
253
+ requiredHints: [DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME],
254
+ displayHints: [],
255
+ });
256
+ });
257
+
258
+ it('should return the resolution of hasHints()', () => {
259
+ const expected = 'example-return-value';
260
+ ControlsOptionsUtil.hasHints.returns(expected);
261
+
262
+ const results = ControlsOptionsUtil.canUpdateReactions({properties: {}}, []);
263
+
264
+ assert.calledOnce(ControlsOptionsUtil.hasHints);
265
+ assert.equal(results, expected);
266
+ });
267
+ });
268
+
269
+ describe('canUpdateShareControl()', () => {
270
+ beforeEach(() => {
271
+ sinon.stub(ControlsOptionsUtil, 'hasHints').returns(true);
272
+ });
273
+
274
+ it('should call hasHints() with proper hints', () => {
275
+ ControlsOptionsUtil.canUpdateShareControl([]);
276
+
277
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
278
+ requiredHints: [DISPLAY_HINTS.SHARE_CONTROL],
279
+ displayHints: [],
280
+ });
281
+ });
282
+
283
+ it('should return the resolution of hasHints()', () => {
284
+ const expected = 'example-return-value';
285
+ ControlsOptionsUtil.hasHints.returns(expected);
286
+
287
+ const results = ControlsOptionsUtil.canUpdateShareControl([]);
288
+
289
+ assert.calledOnce(ControlsOptionsUtil.hasHints);
290
+ assert.equal(results, expected);
291
+ });
292
+ });
293
+
294
+ describe('canUpdateVideo()', () => {
295
+ beforeEach(() => {
296
+ sinon.stub(ControlsOptionsUtil, 'hasHints').returns(true);
297
+ });
298
+
299
+ it('should call hasHints() with proper hints when `enabled` is true', () => {
300
+ ControlsOptionsUtil.canUpdateVideo({properties: {enabled: true}}, []);
301
+
302
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
303
+ requiredHints: [DISPLAY_HINTS.ENABLE_VIDEO],
304
+ displayHints: [],
305
+ });
306
+ });
307
+
308
+ it('should call hasHints() with proper hints when `enabled` is false', () => {
309
+ ControlsOptionsUtil.canUpdateVideo({properties: {enabled: false}}, []);
310
+
311
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
312
+ requiredHints: [DISPLAY_HINTS.DISABLE_VIDEO],
313
+ displayHints: [],
314
+ });
315
+ });
316
+
317
+ it('should return the resolution of hasHints()', () => {
318
+ const expected = 'example-return-value';
319
+ ControlsOptionsUtil.hasHints.returns(expected);
320
+
321
+ const results = ControlsOptionsUtil.canUpdateVideo({properties: {}}, []);
322
+
323
+ assert.calledOnce(ControlsOptionsUtil.hasHints);
324
+ assert.equal(results, expected);
325
+ });
326
+ });
327
+
328
+ describe('canUpdateViewTheParticipantsList()', () => {
329
+ beforeEach(() => {
330
+ sinon.stub(ControlsOptionsUtil, 'hasHints').returns(true);
331
+ });
332
+
333
+ it('should call hasHints() with proper hints when `enabled` is true', () => {
334
+ ControlsOptionsUtil.canUpdateViewTheParticipantsList({properties: {enabled: true}}, []);
335
+
336
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
337
+ requiredHints: [DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST],
338
+ displayHints: [],
339
+ });
340
+ });
341
+
342
+ it('should call hasHints() with proper hints when `enabled` is false', () => {
343
+ ControlsOptionsUtil.canUpdateViewTheParticipantsList({properties: {enabled: false}}, []);
344
+
345
+ assert.calledWith(ControlsOptionsUtil.hasHints, {
346
+ requiredHints: [DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST],
347
+ displayHints: [],
348
+ });
349
+ });
350
+
351
+ it('should return the resolution of hasHints()', () => {
352
+ const expected = 'example-return-value';
353
+ ControlsOptionsUtil.hasHints.returns(expected);
354
+
355
+ const results = ControlsOptionsUtil.canUpdateViewTheParticipantsList(
356
+ {properties: {}},
357
+ []
358
+ );
359
+
360
+ assert.calledOnce(ControlsOptionsUtil.hasHints);
361
+ assert.equal(results, expected);
362
+ });
363
+ });
364
+
365
+ describe('canUpdate()', () => {
366
+ const displayHints = [];
367
+
368
+ beforeEach(() => {
369
+ ControlsOptionsUtil.canUpdateAudio = sinon.stub().returns(true);
370
+ ControlsOptionsUtil.canUpdateRaiseHand = sinon.stub().returns(true);
371
+ ControlsOptionsUtil.canUpdateReactions = sinon.stub().returns(true);
372
+ ControlsOptionsUtil.canUpdateShareControl = sinon.stub().returns(true);
373
+ ControlsOptionsUtil.canUpdateVideo = sinon.stub().returns(true);
374
+ ControlsOptionsUtil.canUpdateViewTheParticipantsList = sinon.stub().returns(true);
375
+ });
376
+
377
+ it('should only call canUpdateAudio() if the scope is audio', () => {
378
+ const control = {scope: 'audio'};
379
+
380
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
381
+
382
+ assert.calledWith(ControlsOptionsUtil.canUpdateAudio, control, displayHints);
383
+ assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
384
+ assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
385
+ assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
386
+ assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
387
+ assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
388
+ assert.isTrue(results);
389
+ });
390
+
391
+ it('should only call canUpdateRaiseHand() if the scope is raiseHand', () => {
392
+ const control = {scope: 'raiseHand'};
393
+
394
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
395
+
396
+ assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
397
+ assert.calledWith(ControlsOptionsUtil.canUpdateRaiseHand, control, displayHints);
398
+ assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
399
+ assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
400
+ assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
401
+ assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
402
+ assert.isTrue(results);
403
+ });
404
+
405
+ it('should only call canUpdateReactions() if the scope is reactions', () => {
406
+ const control = {scope: 'reactions'};
407
+
408
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
409
+
410
+ assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
411
+ assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
412
+ assert.calledWith(ControlsOptionsUtil.canUpdateReactions, control, displayHints);
413
+ assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
414
+ assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
415
+ assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
416
+ assert.isTrue(results);
417
+ });
418
+
419
+ it('should only call canUpdateShareControl() if the scope is shareControl', () => {
420
+ const control = {scope: 'shareControl'};
421
+
422
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
423
+
424
+ assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
425
+ assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
426
+ assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
427
+ assert.calledWith(ControlsOptionsUtil.canUpdateShareControl, displayHints);
428
+ assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
429
+ assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
430
+ assert.isTrue(results);
431
+ });
432
+
433
+ it('should only call canUpdateVideo() if the scope is video', () => {
434
+ const control = {scope: 'video'};
435
+
436
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
437
+
438
+ assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
439
+ assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
440
+ assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
441
+ assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
442
+ assert.calledWith(ControlsOptionsUtil.canUpdateVideo, control, displayHints);
443
+ assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
444
+ assert.isTrue(results);
445
+ });
446
+
447
+ it('should only call canUpdateViewTheParticipantsList() if the scope is viewTheParticipantList', () => {
448
+ const control = {scope: 'viewTheParticipantList'};
449
+
450
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
451
+
452
+ assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
453
+ assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
454
+ assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
455
+ assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
456
+ assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
457
+ assert.calledWith(
458
+ ControlsOptionsUtil.canUpdateViewTheParticipantsList,
459
+ control,
460
+ displayHints
461
+ );
462
+ assert.isTrue(results);
463
+ });
464
+
465
+ it('should return false when the provided control scope is not supported', () => {
466
+ const control = {scope: 'invalid'};
467
+
468
+ const results = ControlsOptionsUtil.canUpdate(control, displayHints);
469
+
470
+ assert.callCount(ControlsOptionsUtil.canUpdateAudio, 0);
471
+ assert.callCount(ControlsOptionsUtil.canUpdateRaiseHand, 0);
472
+ assert.callCount(ControlsOptionsUtil.canUpdateReactions, 0);
473
+ assert.callCount(ControlsOptionsUtil.canUpdateShareControl, 0);
474
+ assert.callCount(ControlsOptionsUtil.canUpdateVideo, 0);
475
+ assert.callCount(ControlsOptionsUtil.canUpdateViewTheParticipantsList, 0);
476
+ assert.isFalse(results);
477
+ });
478
+ });
479
+
480
+ describe('canUserSetMuteOnEntry', () => {
481
+ it('can set mute on entry enable', () => {
482
+ locusInfo.parsedLocus.info.userDisplayHints.push('ENABLE_MUTE_ON_ENTRY');
483
+
484
+ assert.equal(
485
+ ControlsOptionsUtil.canSetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints),
486
+ true
487
+ );
488
+ });
489
+
490
+ it('can set mute on entry disable', () => {
491
+ locusInfo.parsedLocus.info.userDisplayHints.push('DISABLE_MUTE_ON_ENTRY');
492
+
493
+ assert.equal(
494
+ ControlsOptionsUtil.canUnsetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints),
495
+ true
496
+ );
497
+ });
498
+
499
+ it('rejects when correct display hint is not present for setting mute on entry', () => {
500
+ assert.equal(
501
+ ControlsOptionsUtil.canSetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints),
502
+ false
503
+ );
504
+ });
505
+
506
+ it('rejects when correct display hint is not present for unsetting mute on entry', () => {
507
+ assert.equal(
508
+ ControlsOptionsUtil.canUnsetMuteOnEntry(locusInfo.parsedLocus.info.userDisplayHints),
509
+ false
510
+ );
511
+ });
512
+ });
513
+
514
+ describe('canSetDisallowUnmute', () => {
515
+ it('can set disallow unmute enable', () => {
516
+ locusInfo.parsedLocus.info.userDisplayHints.push('ENABLE_HARD_MUTE');
517
+
518
+ assert.equal(
519
+ ControlsOptionsUtil.canSetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints),
520
+ true
521
+ );
522
+ });
523
+
524
+ it('can set disallow unmute disable', () => {
525
+ locusInfo.parsedLocus.info.userDisplayHints.push('DISABLE_HARD_MUTE');
526
+
527
+ assert.equal(
528
+ ControlsOptionsUtil.canUnsetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints),
529
+ true
530
+ );
531
+ });
532
+
533
+ it('rejects when correct display hint is not present', () => {
534
+ assert.equal(
535
+ ControlsOptionsUtil.canSetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints),
536
+ false
537
+ );
538
+ });
539
+
540
+ it('rejects when correct display hint is not present', () => {
541
+ assert.equal(
542
+ ControlsOptionsUtil.canUnsetDisallowUnmute(locusInfo.parsedLocus.info.userDisplayHints),
543
+ false
544
+ );
545
+ });
546
+ });
547
+
548
+ describe('canSetMuteAll', () => {
549
+ it('can mute all', () => {
550
+ locusInfo.parsedLocus.info.userDisplayHints.push('MUTE_ALL');
551
+
552
+ assert.equal(
553
+ ControlsOptionsUtil.canSetMuted(locusInfo.parsedLocus.info.userDisplayHints),
554
+ true
555
+ );
556
+ });
557
+
558
+ it('can unmute all', () => {
559
+ locusInfo.parsedLocus.info.userDisplayHints.push('UNMUTE_ALL');
560
+
561
+ assert.equal(
562
+ ControlsOptionsUtil.canUnsetMuted(locusInfo.parsedLocus.info.userDisplayHints),
563
+ true
564
+ );
565
+ });
566
+ it('rejects when correct display hint is not present', () => {
567
+ assert.equal(
568
+ ControlsOptionsUtil.canSetMuted(locusInfo.parsedLocus.info.userDisplayHints),
569
+ false
570
+ );
571
+ });
572
+
573
+ it('rejects when correct display hint is not present', () => {
574
+ assert.equal(
575
+ ControlsOptionsUtil.canUnsetMuted(locusInfo.parsedLocus.info.userDisplayHints),
576
+ false
577
+ );
516
578
  });
579
+ });
517
580
  });
518
- });
581
+ });
582
+ });