@webex/plugin-meetings 2.30.2 → 2.31.1
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/constants.js +7 -1
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +9 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +32 -0
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +13 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/meeting/index.js +38 -12
- package/dist/meeting/index.js.map +1 -1
- package/package.json +17 -17
- package/src/constants.ts +7 -1
- package/src/locus-info/controlsUtils.js +10 -2
- package/src/locus-info/index.js +40 -0
- package/src/locus-info/selfUtils.js +10 -1
- package/src/meeting/index.js +41 -0
- package/test/unit/spec/locus-info/controlsUtils.js +82 -0
- package/test/unit/spec/locus-info/index.js +122 -0
- package/test/unit/spec/locus-info/selfConstant.js +3 -1
- package/test/unit/spec/locus-info/selfUtils.js +74 -1
- package/test/unit/spec/meetings/index.js +82 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -24,29 +24,29 @@
|
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@webex/plugin-meetings": "2.
|
|
28
|
-
"@webex/test-helper-chai": "2.
|
|
29
|
-
"@webex/test-helper-mocha": "2.
|
|
30
|
-
"@webex/test-helper-mock-webex": "2.
|
|
31
|
-
"@webex/test-helper-retry": "2.
|
|
32
|
-
"@webex/test-helper-test-users": "2.
|
|
27
|
+
"@webex/plugin-meetings": "2.31.1",
|
|
28
|
+
"@webex/test-helper-chai": "2.31.1",
|
|
29
|
+
"@webex/test-helper-mocha": "2.31.1",
|
|
30
|
+
"@webex/test-helper-mock-webex": "2.31.1",
|
|
31
|
+
"@webex/test-helper-retry": "2.31.1",
|
|
32
|
+
"@webex/test-helper-test-users": "2.31.1",
|
|
33
33
|
"chai": "^4.3.4",
|
|
34
34
|
"chai-as-promised": "^7.1.1",
|
|
35
35
|
"jsdom-global": "3.0.2",
|
|
36
36
|
"sinon": "^9.2.4"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@webex/common": "2.
|
|
39
|
+
"@webex/common": "2.31.1",
|
|
40
40
|
"@webex/internal-media-core": "^0.0.7-beta",
|
|
41
|
-
"@webex/internal-plugin-conversation": "2.
|
|
42
|
-
"@webex/internal-plugin-device": "2.
|
|
43
|
-
"@webex/internal-plugin-mercury": "2.
|
|
44
|
-
"@webex/internal-plugin-metrics": "2.
|
|
45
|
-
"@webex/internal-plugin-support": "2.
|
|
46
|
-
"@webex/internal-plugin-user": "2.
|
|
47
|
-
"@webex/plugin-people": "2.
|
|
48
|
-
"@webex/plugin-rooms": "2.
|
|
49
|
-
"@webex/webex-core": "2.
|
|
41
|
+
"@webex/internal-plugin-conversation": "2.31.1",
|
|
42
|
+
"@webex/internal-plugin-device": "2.31.1",
|
|
43
|
+
"@webex/internal-plugin-mercury": "2.31.1",
|
|
44
|
+
"@webex/internal-plugin-metrics": "2.31.1",
|
|
45
|
+
"@webex/internal-plugin-support": "2.31.1",
|
|
46
|
+
"@webex/internal-plugin-user": "2.31.1",
|
|
47
|
+
"@webex/plugin-people": "2.31.1",
|
|
48
|
+
"@webex/plugin-rooms": "2.31.1",
|
|
49
|
+
"@webex/webex-core": "2.31.1",
|
|
50
50
|
"bowser": "^2.11.0",
|
|
51
51
|
"btoa": "^1.2.1",
|
|
52
52
|
"dotenv": "^4.0.0",
|
package/src/constants.ts
CHANGED
|
@@ -286,7 +286,10 @@ export const EVENT_TRIGGERS = {
|
|
|
286
286
|
MEETING_SELF_UNMUTED_BY_OTHERS: 'meeting:self:unmutedByOthers',
|
|
287
287
|
MEETING_SELF_REQUESTED_TO_UNMUTE: 'meeting:self:requestedToUnmute',
|
|
288
288
|
MEETING_SELF_PHONE_AUDIO_UPDATE: 'meeting:self:phoneAudioUpdate',
|
|
289
|
+
MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST: 'meeting:self:cannotViewParticipantList',
|
|
290
|
+
MEETING_SELF_IS_SHARING_BLOCKED: 'meeting:self:isSharingBlocked',
|
|
289
291
|
MEETING_CONTROLS_LAYOUT_UPDATE: 'meeting:layout:update',
|
|
292
|
+
MEETING_ENTRY_EXIT_TONE_UPDATE: 'meeting:entryExitTone:update',
|
|
290
293
|
MEMBERS_UPDATE: 'members:update',
|
|
291
294
|
MEMBERS_CONTENT_UPDATE: 'members:content:update',
|
|
292
295
|
MEMBERS_HOST_UPDATE: 'members:host:update',
|
|
@@ -494,6 +497,7 @@ export const LOCUSINFO = {
|
|
|
494
497
|
CONTROLS_RECORDING_UPDATED: 'CONTROLS_RECORDING_UPDATED',
|
|
495
498
|
CONTROLS_MEETING_TRANSCRIBE_UPDATED: 'CONTROLS_MEETING_TRANSCRIBE_UPDATED',
|
|
496
499
|
CONTROLS_MEETING_CONTAINER_UPDATED: 'CONTROLS_MEETING_CONTAINER_UPDATED',
|
|
500
|
+
CONTROLS_ENTRY_EXIT_TONE_UPDATED: 'CONTROLS_ENTRY_EXIT_TONE_UPDATED',
|
|
497
501
|
SELF_UNADMITTED_GUEST: 'SELF_UNADMITTED_GUEST',
|
|
498
502
|
SELF_ADMITTED_GUEST: 'SELF_ADMITTED_GUEST',
|
|
499
503
|
SELF_REMOTE_MUTE_STATUS_UPDATED: 'SELF_REMOTE_MUTE_STATUS_UPDATED',
|
|
@@ -510,7 +514,9 @@ export const LOCUSINFO = {
|
|
|
510
514
|
MEETING_UNLOCKED: 'MEETING_UNLOCKED',
|
|
511
515
|
SELF_OBSERVING: 'SELF_OBSERVING',
|
|
512
516
|
DISCONNECT_DUE_TO_INACTIVITY: 'DISCONNECT_DUE_TO_INACTIVITY',
|
|
513
|
-
EMBEDDED_APPS_UPDATED: 'EMBEDDED_APPS_UPDATED'
|
|
517
|
+
EMBEDDED_APPS_UPDATED: 'EMBEDDED_APPS_UPDATED',
|
|
518
|
+
SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE: 'SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE',
|
|
519
|
+
SELF_IS_SHARING_BLOCKED_CHANGE: 'SELF_IS_SHARING_BLOCKED_CHANGE',
|
|
514
520
|
}
|
|
515
521
|
};
|
|
516
522
|
|
|
@@ -42,13 +42,17 @@ ControlsUtils.parse = (controls) => {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
if (controls && controls.entryExitTone) {
|
|
46
|
+
parsedControls.entryExitTone = controls.entryExitTone.enabled ? controls.entryExitTone.mode : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
return parsedControls;
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
* parses and returns previous state vs current state and triggers the changes.
|
|
50
|
-
* @param {
|
|
51
|
-
* @param {
|
|
54
|
+
* @param {LocusControls} oldControls previous state
|
|
55
|
+
* @param {LocusControls} newControls current state
|
|
52
56
|
* @returns {Object} combination of state plus the changes
|
|
53
57
|
*/
|
|
54
58
|
ControlsUtils.getControls = (oldControls, newControls) => {
|
|
@@ -74,6 +78,10 @@ ControlsUtils.getControls = (oldControls, newControls) => {
|
|
|
74
78
|
hasTranscribeChanged: current?.transcribe &&
|
|
75
79
|
!isEqual(previous?.transcribe?.transcribing, current?.transcribe?.transcribing) && // upon first join, previous?.record?.recording = undefined; thus, never going to be equal and will always return true
|
|
76
80
|
(previous?.transcribe?.transcribing || current?.transcribe?.transcribing), // therefore, condition added to prevent false firings of #meeting:recording:stopped upon first joining a meeting
|
|
81
|
+
|
|
82
|
+
hasEntryExitToneChanged: !!(newControls.entryExitTone &&
|
|
83
|
+
!isEqual(previous?.entryExitTone, current?.entryExitTone) &&
|
|
84
|
+
(previous?.entryExitTone || current?.entryExitTone)),
|
|
77
85
|
}
|
|
78
86
|
};
|
|
79
87
|
};
|
package/src/locus-info/index.js
CHANGED
|
@@ -645,6 +645,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
645
645
|
hasRecordingPausedChanged,
|
|
646
646
|
hasMeetingContainerChanged,
|
|
647
647
|
hasTranscribeChanged,
|
|
648
|
+
hasEntryExitToneChanged,
|
|
648
649
|
},
|
|
649
650
|
current,
|
|
650
651
|
} = ControlsUtils.getControls(this.controls, controls);
|
|
@@ -710,6 +711,23 @@ export default class LocusInfo extends EventsScope {
|
|
|
710
711
|
);
|
|
711
712
|
}
|
|
712
713
|
|
|
714
|
+
if (hasEntryExitToneChanged) {
|
|
715
|
+
const {entryExitTone} = current;
|
|
716
|
+
|
|
717
|
+
this.emitScoped(
|
|
718
|
+
{
|
|
719
|
+
file: 'locus-info',
|
|
720
|
+
function: 'updateControls',
|
|
721
|
+
},
|
|
722
|
+
LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED,
|
|
723
|
+
{
|
|
724
|
+
entryExitTone
|
|
725
|
+
}
|
|
726
|
+
);
|
|
727
|
+
|
|
728
|
+
this.updateMeeting({entryExitTone});
|
|
729
|
+
}
|
|
730
|
+
|
|
713
731
|
this.controls = controls;
|
|
714
732
|
}
|
|
715
733
|
}
|
|
@@ -1116,6 +1134,28 @@ export default class LocusInfo extends EventsScope {
|
|
|
1116
1134
|
);
|
|
1117
1135
|
}
|
|
1118
1136
|
|
|
1137
|
+
if (parsedSelves.updates.canNotViewTheParticipantListChanged) {
|
|
1138
|
+
this.emitScoped(
|
|
1139
|
+
{
|
|
1140
|
+
file: 'locus-info',
|
|
1141
|
+
function: 'updateSelf',
|
|
1142
|
+
},
|
|
1143
|
+
LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
|
|
1144
|
+
{canNotViewTheParticipantList: parsedSelves.current.canNotViewTheParticipantList}
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
if (parsedSelves.updates.isSharingBlockedChanged) {
|
|
1149
|
+
this.emitScoped(
|
|
1150
|
+
{
|
|
1151
|
+
file: 'locus-info',
|
|
1152
|
+
function: 'updateSelf',
|
|
1153
|
+
},
|
|
1154
|
+
LOCUSINFO.EVENTS.SELF_IS_SHARING_BLOCKED_CHANGE,
|
|
1155
|
+
{isSharingBlocked: parsedSelves.current.isSharingBlocked}
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1119
1159
|
this.emitScoped(
|
|
1120
1160
|
{
|
|
1121
1161
|
file: 'locus-info',
|
|
@@ -58,7 +58,9 @@ SelfUtils.parse = (self, deviceId) => {
|
|
|
58
58
|
removed: self.removed,
|
|
59
59
|
roles: SelfUtils.getRoles(self),
|
|
60
60
|
isUserUnadmitted: self.state === _IDLE_ && joinedWith?.intent?.type === _WAIT_,
|
|
61
|
-
layout: SelfUtils.getLayout(self)
|
|
61
|
+
layout: SelfUtils.getLayout(self),
|
|
62
|
+
canNotViewTheParticipantList: SelfUtils.canNotViewTheParticipantList(self),
|
|
63
|
+
isSharingBlocked: SelfUtils.isSharingBlocked(self)
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
|
|
@@ -75,6 +77,10 @@ SelfUtils.getRoles = (self) => (self?.controls?.role?.roles || []).reduce((roles
|
|
|
75
77
|
return roles;
|
|
76
78
|
}, []);
|
|
77
79
|
|
|
80
|
+
SelfUtils.canNotViewTheParticipantList = (self) => !!self?.canNotViewTheParticipantList;
|
|
81
|
+
|
|
82
|
+
SelfUtils.isSharingBlocked = (self) => !!self?.isSharingBlocked;
|
|
83
|
+
|
|
78
84
|
SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
|
|
79
85
|
const previous = oldSelf && SelfUtils.parse(oldSelf, deviceId);
|
|
80
86
|
const current = newSelf && SelfUtils.parse(newSelf, deviceId);
|
|
@@ -95,6 +101,9 @@ SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
|
|
|
95
101
|
updates.videoStateChange = previous?.currentMediaStatus.video !== current.currentMediaStatus.video;
|
|
96
102
|
updates.shareStateChange = previous?.currentMediaStatus.share !== current.currentMediaStatus.share;
|
|
97
103
|
|
|
104
|
+
updates.canNotViewTheParticipantListChanged = previous?.canNotViewTheParticipantList !== current.canNotViewTheParticipantList;
|
|
105
|
+
updates.isSharingBlockedChanged = previous?.isSharingBlocked !== current.isSharingBlocked;
|
|
106
|
+
|
|
98
107
|
return {
|
|
99
108
|
previous,
|
|
100
109
|
current,
|
package/src/meeting/index.js
CHANGED
|
@@ -1589,6 +1589,19 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1589
1589
|
);
|
|
1590
1590
|
}
|
|
1591
1591
|
});
|
|
1592
|
+
|
|
1593
|
+
this.locusInfo.on(LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED,
|
|
1594
|
+
({entryExitTone}) => {
|
|
1595
|
+
Trigger.trigger(
|
|
1596
|
+
this,
|
|
1597
|
+
{
|
|
1598
|
+
file: 'meeting/index',
|
|
1599
|
+
function: 'setupLocusControlsListener'
|
|
1600
|
+
},
|
|
1601
|
+
EVENT_TRIGGERS.MEETING_ENTRY_EXIT_TONE_UPDATE,
|
|
1602
|
+
{entryExitTone}
|
|
1603
|
+
);
|
|
1604
|
+
});
|
|
1592
1605
|
}
|
|
1593
1606
|
|
|
1594
1607
|
/**
|
|
@@ -2072,6 +2085,34 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
2072
2085
|
});
|
|
2073
2086
|
}
|
|
2074
2087
|
});
|
|
2088
|
+
|
|
2089
|
+
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE, (payload) => {
|
|
2090
|
+
Trigger.trigger(
|
|
2091
|
+
this,
|
|
2092
|
+
{
|
|
2093
|
+
file: 'meeting/index',
|
|
2094
|
+
function: 'setUpLocusInfoSelfListener'
|
|
2095
|
+
},
|
|
2096
|
+
EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST,
|
|
2097
|
+
{
|
|
2098
|
+
payload
|
|
2099
|
+
}
|
|
2100
|
+
);
|
|
2101
|
+
});
|
|
2102
|
+
|
|
2103
|
+
this.locusInfo.on(LOCUSINFO.EVENTS.SELF_IS_SHARING_BLOCKED_CHANGE, (payload) => {
|
|
2104
|
+
Trigger.trigger(
|
|
2105
|
+
this,
|
|
2106
|
+
{
|
|
2107
|
+
file: 'meeting/index',
|
|
2108
|
+
function: 'setUpLocusInfoSelfListener'
|
|
2109
|
+
},
|
|
2110
|
+
EVENT_TRIGGERS.MEETING_SELF_IS_SHARING_BLOCKED,
|
|
2111
|
+
{
|
|
2112
|
+
payload
|
|
2113
|
+
}
|
|
2114
|
+
);
|
|
2115
|
+
});
|
|
2075
2116
|
}
|
|
2076
2117
|
|
|
2077
2118
|
/**
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {assert} from '@webex/test-helper-chai';
|
|
2
|
+
import ControlsUtils from '@webex/plugin-meetings/src/locus-info/controlsUtils';
|
|
3
|
+
|
|
4
|
+
const defaultControls = {
|
|
5
|
+
entryExitTone: {
|
|
6
|
+
enabled: true,
|
|
7
|
+
mode: 'foo',
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe('plugin-meetings', () => {
|
|
12
|
+
describe('controlsUtils', () => {
|
|
13
|
+
describe('parse', () => {
|
|
14
|
+
it('parses entryExitTone', () => {
|
|
15
|
+
const parsedControls = ControlsUtils.parse(defaultControls);
|
|
16
|
+
|
|
17
|
+
assert.equal(parsedControls.entryExitTone, 'foo');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('parses entryExitTone when disabled', () => {
|
|
21
|
+
const parsedControls = ControlsUtils.parse({
|
|
22
|
+
entryExitTone: {
|
|
23
|
+
enabled: false,
|
|
24
|
+
mode: 'foo',
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
assert.equal(parsedControls.entryExitTone, null);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('handles no entryExitTone', () => {
|
|
32
|
+
const parsedControls = ControlsUtils.parse({});
|
|
33
|
+
|
|
34
|
+
assert.equal(parsedControls.entryExitTone, null);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('handles no controls', () => {
|
|
38
|
+
const parsedControls = ControlsUtils.parse();
|
|
39
|
+
|
|
40
|
+
assert.equal(parsedControls.entryExitTone, null);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('getControls', () => {
|
|
46
|
+
it('returns hasEntryExitToneChanged = true when mode changed', () => {
|
|
47
|
+
const newControls = {
|
|
48
|
+
entryExitTone: {
|
|
49
|
+
enabled: true,
|
|
50
|
+
mode: 'bar',
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const {updates} = ControlsUtils.getControls(defaultControls, newControls);
|
|
54
|
+
|
|
55
|
+
assert.equal(updates.hasEntryExitToneChanged, true);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('returns hasEntryExitToneChanged = true when enabled changed', () => {
|
|
59
|
+
const newControls = {
|
|
60
|
+
entryExitTone: {
|
|
61
|
+
enabled: false,
|
|
62
|
+
mode: 'foo',
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const {updates} = ControlsUtils.getControls(defaultControls, newControls);
|
|
66
|
+
|
|
67
|
+
assert.equal(updates.hasEntryExitToneChanged, true);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('returns hasEntryExitToneChanged = false when nothing changed', () => {
|
|
71
|
+
const newControls = {
|
|
72
|
+
entryExitTone: {
|
|
73
|
+
enabled: true,
|
|
74
|
+
mode: 'foo',
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const {updates} = ControlsUtils.getControls(defaultControls, newControls);
|
|
78
|
+
|
|
79
|
+
assert.equal(updates.hasEntryExitToneChanged, false);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -81,6 +81,7 @@ describe('plugin-meetings', () => {
|
|
|
81
81
|
meetingContainer: {
|
|
82
82
|
meetingContainerUrl: 'http://new-url.com',
|
|
83
83
|
},
|
|
84
|
+
entryExitTone: {enabled: true, mode: 'foo'},
|
|
84
85
|
};
|
|
85
86
|
});
|
|
86
87
|
|
|
@@ -368,6 +369,35 @@ describe('plugin-meetings', () => {
|
|
|
368
369
|
{meetingContainerUrl: 'http://new-url.com'}
|
|
369
370
|
);
|
|
370
371
|
});
|
|
372
|
+
|
|
373
|
+
it('should update the entryExitTone when changed', () => {
|
|
374
|
+
locusInfo.controls = {};
|
|
375
|
+
|
|
376
|
+
locusInfo.emitScoped = sinon.stub();
|
|
377
|
+
locusInfo.updateControls(newControls);
|
|
378
|
+
|
|
379
|
+
assert.calledWith(
|
|
380
|
+
locusInfo.emitScoped,
|
|
381
|
+
{
|
|
382
|
+
file: 'locus-info',
|
|
383
|
+
function: 'updateControls',
|
|
384
|
+
},
|
|
385
|
+
LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED,
|
|
386
|
+
{entryExitTone: 'foo'}
|
|
387
|
+
);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('should not update the entryExitTone when unchanged', () => {
|
|
391
|
+
locusInfo.controls = {entryExitTone: {enabled: true, mode: 'foo'}};
|
|
392
|
+
|
|
393
|
+
locusInfo.emitScoped = sinon.stub();
|
|
394
|
+
locusInfo.updateControls(newControls);
|
|
395
|
+
|
|
396
|
+
locusInfo.emitScoped.getCalls().forEach((x) => {
|
|
397
|
+
// check that no calls in emitScoped are for CONTROLS_ENTRY_EXIT_TONE_UPDATED
|
|
398
|
+
assert.notEqual(x.args[1], LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED);
|
|
399
|
+
});
|
|
400
|
+
});
|
|
371
401
|
});
|
|
372
402
|
|
|
373
403
|
describe('#updateParticipants()', () => {
|
|
@@ -767,6 +797,98 @@ describe('plugin-meetings', () => {
|
|
|
767
797
|
LOCUSINFO.EVENTS.SELF_OBSERVING
|
|
768
798
|
);
|
|
769
799
|
});
|
|
800
|
+
|
|
801
|
+
it('should not trigger SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE when not updated', () => {
|
|
802
|
+
const selfClone = cloneDeep(self);
|
|
803
|
+
|
|
804
|
+
selfClone.canNotViewTheParticipantList = false; // same
|
|
805
|
+
|
|
806
|
+
// Set the layout prior to stubbing to validate it does not change.
|
|
807
|
+
locusInfo.updateSelf(self, []);
|
|
808
|
+
|
|
809
|
+
locusInfo.emitScoped = sinon.stub();
|
|
810
|
+
|
|
811
|
+
locusInfo.updateSelf(selfClone, []);
|
|
812
|
+
|
|
813
|
+
assert.neverCalledWith(
|
|
814
|
+
locusInfo.emitScoped,
|
|
815
|
+
{
|
|
816
|
+
file: 'locus-info',
|
|
817
|
+
function: 'updateSelf',
|
|
818
|
+
},
|
|
819
|
+
LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
|
|
820
|
+
{canNotViewTheParticipantList: false}
|
|
821
|
+
);
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
it('should trigger SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE when updated', () => {
|
|
825
|
+
const selfClone = cloneDeep(self);
|
|
826
|
+
|
|
827
|
+
selfClone.canNotViewTheParticipantList = true; // different
|
|
828
|
+
|
|
829
|
+
// Set the layout prior to stubbing to validate it does not change.
|
|
830
|
+
locusInfo.updateSelf(self, []);
|
|
831
|
+
|
|
832
|
+
locusInfo.emitScoped = sinon.stub();
|
|
833
|
+
|
|
834
|
+
locusInfo.updateSelf(selfClone, []);
|
|
835
|
+
|
|
836
|
+
assert.calledWith(
|
|
837
|
+
locusInfo.emitScoped,
|
|
838
|
+
{
|
|
839
|
+
file: 'locus-info',
|
|
840
|
+
function: 'updateSelf',
|
|
841
|
+
},
|
|
842
|
+
LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
|
|
843
|
+
{canNotViewTheParticipantList: true}
|
|
844
|
+
);
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
it('should not trigger SELF_IS_SHARING_BLOCKED_CHANGE when not updated', () => {
|
|
848
|
+
const selfClone = cloneDeep(self);
|
|
849
|
+
|
|
850
|
+
selfClone.isSharingBlocked = false; // same
|
|
851
|
+
|
|
852
|
+
// Set the layout prior to stubbing to validate it does not change.
|
|
853
|
+
locusInfo.updateSelf(self, []);
|
|
854
|
+
|
|
855
|
+
locusInfo.emitScoped = sinon.stub();
|
|
856
|
+
|
|
857
|
+
locusInfo.updateSelf(selfClone, []);
|
|
858
|
+
|
|
859
|
+
assert.neverCalledWith(
|
|
860
|
+
locusInfo.emitScoped,
|
|
861
|
+
{
|
|
862
|
+
file: 'locus-info',
|
|
863
|
+
function: 'updateSelf',
|
|
864
|
+
},
|
|
865
|
+
LOCUSINFO.EVENTS.SELF_IS_SHARING_BLOCKED_CHANGE,
|
|
866
|
+
{isSharingBlocked: false}
|
|
867
|
+
);
|
|
868
|
+
});
|
|
869
|
+
|
|
870
|
+
it('should trigger SELF_IS_SHARING_BLOCKED_CHANGE when updated', () => {
|
|
871
|
+
const selfClone = cloneDeep(self);
|
|
872
|
+
|
|
873
|
+
selfClone.isSharingBlocked = true; // different
|
|
874
|
+
|
|
875
|
+
// Set the layout prior to stubbing to validate it does not change.
|
|
876
|
+
locusInfo.updateSelf(self, []);
|
|
877
|
+
|
|
878
|
+
locusInfo.emitScoped = sinon.stub();
|
|
879
|
+
|
|
880
|
+
locusInfo.updateSelf(selfClone, []);
|
|
881
|
+
|
|
882
|
+
assert.calledWith(
|
|
883
|
+
locusInfo.emitScoped,
|
|
884
|
+
{
|
|
885
|
+
file: 'locus-info',
|
|
886
|
+
function: 'updateSelf',
|
|
887
|
+
},
|
|
888
|
+
LOCUSINFO.EVENTS.SELF_IS_SHARING_BLOCKED_CHANGE,
|
|
889
|
+
{isSharingBlocked: true}
|
|
890
|
+
);
|
|
891
|
+
});
|
|
770
892
|
});
|
|
771
893
|
|
|
772
894
|
describe('#updateMeetingInfo', () => {
|
|
@@ -154,7 +154,9 @@ export const self = {
|
|
|
154
154
|
resourceGuest: false,
|
|
155
155
|
moderator: true,
|
|
156
156
|
panelist: false,
|
|
157
|
-
mediaBaseUrl: 'https://locus.meet-a.prod.meetapi.webex.com/locus/api/v1/loci/4e073f82-f5b6-31e5-93b3/participant/e0d54e94-226c-3290-b75a-/media'
|
|
157
|
+
mediaBaseUrl: 'https://locus.meet-a.prod.meetapi.webex.com/locus/api/v1/loci/4e073f82-f5b6-31e5-93b3/participant/e0d54e94-226c-3290-b75a-/media',
|
|
158
|
+
canNotViewTheParticipantList: false,
|
|
159
|
+
isSharingBlocked: false,
|
|
158
160
|
};
|
|
159
161
|
|
|
160
162
|
export const selfWithInactivity = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
|
2
2
|
import Sinon from 'sinon';
|
|
3
3
|
import {cloneDeep} from 'lodash';
|
|
4
|
-
|
|
5
4
|
import SelfUtils from '@webex/plugin-meetings/src/locus-info/selfUtils';
|
|
6
5
|
|
|
7
6
|
import {self} from './selfConstant';
|
|
@@ -59,6 +58,34 @@ describe('plugin-meetings', () => {
|
|
|
59
58
|
});
|
|
60
59
|
});
|
|
61
60
|
|
|
61
|
+
describe('canNotViewTheParticipantList', () => {
|
|
62
|
+
it('should return the correct value', () => {
|
|
63
|
+
assert.equal(SelfUtils.canNotViewTheParticipantList(self), self.canNotViewTheParticipantList);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should return false if the new self does not have a value', () => {
|
|
67
|
+
const mutatedSelf = cloneDeep(self);
|
|
68
|
+
|
|
69
|
+
delete mutatedSelf.canNotViewTheParticipantList;
|
|
70
|
+
|
|
71
|
+
assert.equal(SelfUtils.canNotViewTheParticipantList(mutatedSelf), false);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('isSharingBlocked', () => {
|
|
76
|
+
it('should return the correct value', () => {
|
|
77
|
+
assert.equal(SelfUtils.isSharingBlocked(self), self.isSharingBlocked);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should return false if the new self does not have a value', () => {
|
|
81
|
+
const mutatedSelf = cloneDeep(self);
|
|
82
|
+
|
|
83
|
+
delete mutatedSelf.isSharingBlocked;
|
|
84
|
+
|
|
85
|
+
assert.equal(SelfUtils.isSharingBlocked(mutatedSelf), false);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
62
89
|
describe('getRoles', () => {
|
|
63
90
|
it('get roles works', () => {
|
|
64
91
|
assert.deepEqual(SelfUtils.getRoles(self), ['PRESENTER']);
|
|
@@ -79,6 +106,52 @@ describe('plugin-meetings', () => {
|
|
|
79
106
|
assert.deepEqual(SelfUtils.getRoles(), []);
|
|
80
107
|
});
|
|
81
108
|
});
|
|
109
|
+
|
|
110
|
+
describe('getSelves', () => {
|
|
111
|
+
describe('canNotViewTheParticipantListChanged', () => {
|
|
112
|
+
it('should return canNotViewTheParticipantListChanged = true when changed', () => {
|
|
113
|
+
const clonedSelf = cloneDeep(self);
|
|
114
|
+
|
|
115
|
+
clonedSelf.canNotViewTheParticipantList = true; // different
|
|
116
|
+
|
|
117
|
+
const {updates} = SelfUtils.getSelves(self, clonedSelf);
|
|
118
|
+
|
|
119
|
+
assert.equal(updates.canNotViewTheParticipantListChanged, true);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should return canNotViewTheParticipantListChanged = false when unchanged', () => {
|
|
123
|
+
const clonedSelf = cloneDeep(self);
|
|
124
|
+
|
|
125
|
+
clonedSelf.canNotViewTheParticipantList = false; // same
|
|
126
|
+
|
|
127
|
+
const {updates} = SelfUtils.getSelves(self, clonedSelf);
|
|
128
|
+
|
|
129
|
+
assert.equal(updates.canNotViewTheParticipantListChanged, false);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe('isSharingBlocked', () => {
|
|
135
|
+
it('should return isSharingBlockedChanged = true when changed', () => {
|
|
136
|
+
const clonedSelf = cloneDeep(self);
|
|
137
|
+
|
|
138
|
+
clonedSelf.isSharingBlocked = true; // different
|
|
139
|
+
|
|
140
|
+
const {updates} = SelfUtils.getSelves(self, clonedSelf);
|
|
141
|
+
|
|
142
|
+
assert.equal(updates.isSharingBlockedChanged, true);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('should return isSharingBlockedChanged = false when unchanged', () => {
|
|
146
|
+
const clonedSelf = cloneDeep(self);
|
|
147
|
+
|
|
148
|
+
clonedSelf.isSharingBlocked = false; // same
|
|
149
|
+
|
|
150
|
+
const {updates} = SelfUtils.getSelves(self, clonedSelf);
|
|
151
|
+
|
|
152
|
+
assert.equal(updates.isSharingBlockedChanged, false);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
82
155
|
});
|
|
83
156
|
|
|
84
157
|
describe('isJoined', () => {
|