@webex/plugin-meetings 3.0.0-beta.71 → 3.0.0-beta.73
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/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +6 -2
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/index.js +5 -3
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +17 -12
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +6 -2
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +6 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -10
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +5 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/members/index.js +23 -0
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +33 -0
- package/dist/members/util.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +12 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -4
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +3 -0
- package/dist/types/locus-info/index.d.ts +1 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +2 -1
- package/dist/types/members/index.d.ts +10 -0
- package/dist/types/members/request.d.ts +11 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +6 -0
- package/package.json +18 -18
- package/src/config.ts +1 -0
- package/src/constants.ts +3 -0
- package/src/locus-info/index.ts +7 -2
- package/src/locus-info/selfUtils.ts +6 -4
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +7 -1
- package/src/meeting/util.ts +5 -0
- package/src/meeting-info/meeting-info-v2.ts +9 -2
- package/src/meeting-info/utilv2.ts +5 -1
- package/src/members/index.ts +35 -0
- package/src/members/request.ts +20 -0
- package/src/members/util.ts +38 -0
- package/src/multistream/mediaRequestManager.ts +10 -1
- package/src/reconnection-manager/index.ts +6 -3
- package/test/unit/spec/locus-info/index.js +31 -2
- package/test/unit/spec/locus-info/selfUtils.js +28 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -2
- package/test/unit/spec/meeting/index.js +15 -3
- package/test/unit/spec/meeting/utils.js +41 -9
- package/test/unit/spec/meeting-info/meetinginfov2.js +27 -0
- package/test/unit/spec/members/index.js +123 -15
- package/test/unit/spec/members/request.js +27 -1
- package/test/unit/spec/members/utils.js +54 -10
- package/test/unit/spec/multistream/mediaRequestManager.ts +36 -11
- package/test/unit/spec/reconnection-manager/index.js +8 -4
package/src/members/util.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
DIALER_REGEX,
|
|
10
10
|
SEND_DTMF_ENDPOINT,
|
|
11
11
|
_REMOVE_,
|
|
12
|
+
ALIAS,
|
|
12
13
|
} from '../constants';
|
|
13
14
|
|
|
14
15
|
import {RoleAssignmentOptions, RoleAssignmentRequest, ServerRoleShape} from './types';
|
|
@@ -174,6 +175,25 @@ MembersUtil.generateLowerAllHandsMemberOptions = (requestingParticipantId, locus
|
|
|
174
175
|
locusUrl,
|
|
175
176
|
});
|
|
176
177
|
|
|
178
|
+
/**
|
|
179
|
+
* @param {String} memberId id of the participant who is receiving request
|
|
180
|
+
* @param {String} requestingParticipantId id of the participant who is sending request (optional)
|
|
181
|
+
* @param {String} alias alias name
|
|
182
|
+
* @param {String} locusUrl url
|
|
183
|
+
* @returns {Object} consists of {memberID: string, requestingParticipantId: string, alias: string, locusUrl: string}
|
|
184
|
+
*/
|
|
185
|
+
MembersUtil.generateEditDisplayNameMemberOptions = (
|
|
186
|
+
memberId,
|
|
187
|
+
requestingParticipantId,
|
|
188
|
+
alias,
|
|
189
|
+
locusUrl
|
|
190
|
+
) => ({
|
|
191
|
+
memberId,
|
|
192
|
+
requestingParticipantId,
|
|
193
|
+
alias,
|
|
194
|
+
locusUrl,
|
|
195
|
+
});
|
|
196
|
+
|
|
177
197
|
MembersUtil.getMuteMemberRequestParams = (options) => {
|
|
178
198
|
const property = options.isAudio === false ? 'video' : 'audio';
|
|
179
199
|
const body = {
|
|
@@ -242,6 +262,24 @@ MembersUtil.getLowerAllHandsMemberRequestParams = (options) => {
|
|
|
242
262
|
};
|
|
243
263
|
};
|
|
244
264
|
|
|
265
|
+
/**
|
|
266
|
+
* @param {Object} options with format of {locusUrl: string, requestingParticipantId: string}
|
|
267
|
+
* @returns {Object} request parameters (method, uri, body) needed to make a editDisplayName request
|
|
268
|
+
*/
|
|
269
|
+
MembersUtil.editDisplayNameMemberRequestParams = (options) => {
|
|
270
|
+
const body = {
|
|
271
|
+
aliasValue: options.alias,
|
|
272
|
+
requestingParticipantId: options.requestingParticipantId,
|
|
273
|
+
};
|
|
274
|
+
const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${ALIAS}`;
|
|
275
|
+
|
|
276
|
+
return {
|
|
277
|
+
method: HTTP_VERBS.POST,
|
|
278
|
+
uri,
|
|
279
|
+
body,
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
|
|
245
283
|
MembersUtil.getTransferHostToMemberRequestParams = (options) => {
|
|
246
284
|
const body = {
|
|
247
285
|
role: {
|
|
@@ -175,6 +175,15 @@ export class MediaRequestManager {
|
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Clears the previous media requests.
|
|
180
|
+
*
|
|
181
|
+
* @returns {void}
|
|
182
|
+
*/
|
|
183
|
+
public clearPreviousRequests(): void {
|
|
184
|
+
this.previousWCMEMediaRequests = [];
|
|
185
|
+
}
|
|
186
|
+
|
|
178
187
|
private sendRequests() {
|
|
179
188
|
const wcmeMediaRequests: WcmeMediaRequest[] = [];
|
|
180
189
|
|
|
@@ -214,7 +223,7 @@ export class MediaRequestManager {
|
|
|
214
223
|
);
|
|
215
224
|
});
|
|
216
225
|
|
|
217
|
-
//! IMPORTANT: this is only a temporary fix. This will soon be done in the jmp layer (@webex/
|
|
226
|
+
//! IMPORTANT: this is only a temporary fix. This will soon be done in the jmp layer (@webex/json-multistream)
|
|
218
227
|
// https://jira-eng-gpk2.cisco.com/jira/browse/WEBEX-326713
|
|
219
228
|
if (!this.checkIsNewRequestsEqualToPrev(wcmeMediaRequests)) {
|
|
220
229
|
this.sendMediaRequestsCallback(wcmeMediaRequests);
|
|
@@ -22,6 +22,7 @@ import {eventType, reconnection, errorObjects} from '../metrics/config';
|
|
|
22
22
|
import Media from '../media';
|
|
23
23
|
import Metrics from '../metrics';
|
|
24
24
|
import Meeting from '../meeting';
|
|
25
|
+
import {MediaRequestManager} from '../multistream/mediaRequestManager';
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Used to indicate that the reconnect logic needs to be retried.
|
|
@@ -570,9 +571,11 @@ export default class ReconnectionManager {
|
|
|
570
571
|
|
|
571
572
|
// resend media requests
|
|
572
573
|
if (this.meeting.isMultistream) {
|
|
573
|
-
Object.values(this.meeting.mediaRequestManagers).forEach(
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
Object.values(this.meeting.mediaRequestManagers).forEach(
|
|
575
|
+
(mediaRequestManager: MediaRequestManager) => {
|
|
576
|
+
mediaRequestManager.clearPreviousRequests();
|
|
577
|
+
mediaRequestManager.commit();
|
|
578
|
+
}
|
|
576
579
|
);
|
|
577
580
|
}
|
|
578
581
|
}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
DISPLAY_HINTS,
|
|
19
19
|
} from '../../../../src/constants';
|
|
20
20
|
|
|
21
|
-
import {self, selfWithInactivity} from
|
|
21
|
+
import { self, selfWithInactivity } from "./selfConstant";
|
|
22
22
|
|
|
23
23
|
describe('plugin-meetings', () => {
|
|
24
24
|
describe('LocusInfo index', () => {
|
|
@@ -1190,7 +1190,7 @@ describe('plugin-meetings', () => {
|
|
|
1190
1190
|
function: 'updateMeetingInfo',
|
|
1191
1191
|
},
|
|
1192
1192
|
LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
|
|
1193
|
-
|
|
1193
|
+
{info: locusInfo.parsedLocus.info, self},
|
|
1194
1194
|
];
|
|
1195
1195
|
|
|
1196
1196
|
if (expected) {
|
|
@@ -1201,6 +1201,25 @@ describe('plugin-meetings', () => {
|
|
|
1201
1201
|
locusInfo.emitScoped.resetHistory();
|
|
1202
1202
|
};
|
|
1203
1203
|
|
|
1204
|
+
const checkMeetingInfoUpdatedCalledForRoles = (expected) => {
|
|
1205
|
+
const expectedArgs = [
|
|
1206
|
+
locusInfo.emitScoped,
|
|
1207
|
+
{
|
|
1208
|
+
file: 'locus-info',
|
|
1209
|
+
function: 'updateMeetingInfo',
|
|
1210
|
+
},
|
|
1211
|
+
LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
|
|
1212
|
+
];
|
|
1213
|
+
|
|
1214
|
+
if (expected) {
|
|
1215
|
+
assert.calledWith(...expectedArgs);
|
|
1216
|
+
} else {
|
|
1217
|
+
assert.neverCalledWith(...expectedArgs);
|
|
1218
|
+
}
|
|
1219
|
+
locusInfo.emitScoped.resetHistory();
|
|
1220
|
+
};
|
|
1221
|
+
|
|
1222
|
+
|
|
1204
1223
|
it('emits MEETING_INFO_UPDATED if the info changes', () => {
|
|
1205
1224
|
const initialInfo = cloneDeep(meetingInfo);
|
|
1206
1225
|
|
|
@@ -1226,6 +1245,16 @@ describe('plugin-meetings', () => {
|
|
|
1226
1245
|
|
|
1227
1246
|
// since the info is the same it should not call trigger the event
|
|
1228
1247
|
checkMeetingInfoUpdatedCalled(false);
|
|
1248
|
+
|
|
1249
|
+
// update it with the same info, but roles changed
|
|
1250
|
+
const updateSelf = cloneDeep(self);
|
|
1251
|
+
updateSelf?.controls?.role?.roles.push({
|
|
1252
|
+
type: 'COHOST',
|
|
1253
|
+
hasRole: true,
|
|
1254
|
+
});
|
|
1255
|
+
locusInfo.updateMeetingInfo(newInfo, updateSelf);
|
|
1256
|
+
// since the info is the same but roles changed, it should call trigger the event
|
|
1257
|
+
checkMeetingInfoUpdatedCalledForRoles(true);
|
|
1229
1258
|
});
|
|
1230
1259
|
|
|
1231
1260
|
it('gets roles from self if available', () => {
|
|
@@ -76,10 +76,10 @@ describe('plugin-meetings', () => {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
describe('
|
|
79
|
+
describe('getBreakoutSessions', () => {
|
|
80
80
|
it('should return breakout sessions', () => {
|
|
81
81
|
assert.deepEqual(
|
|
82
|
-
SelfUtils.
|
|
82
|
+
SelfUtils.getBreakoutSessions({controls: {breakout: {sessions: 'SESSIONS'}}}),
|
|
83
83
|
'SESSIONS'
|
|
84
84
|
);
|
|
85
85
|
});
|
|
@@ -98,6 +98,7 @@ describe('plugin-meetings', () => {
|
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
100
|
},
|
|
101
|
+
breakout: {},
|
|
101
102
|
};
|
|
102
103
|
const previous = {
|
|
103
104
|
breakoutSessions: {
|
|
@@ -110,6 +111,7 @@ describe('plugin-meetings', () => {
|
|
|
110
111
|
},
|
|
111
112
|
],
|
|
112
113
|
},
|
|
114
|
+
breakout: {},
|
|
113
115
|
};
|
|
114
116
|
|
|
115
117
|
assert.isTrue(SelfUtils.breakoutsChanged(previous, current));
|
|
@@ -127,6 +129,7 @@ describe('plugin-meetings', () => {
|
|
|
127
129
|
},
|
|
128
130
|
],
|
|
129
131
|
},
|
|
132
|
+
breakout: {},
|
|
130
133
|
};
|
|
131
134
|
const previous = {
|
|
132
135
|
breakoutSessions: {
|
|
@@ -139,6 +142,29 @@ describe('plugin-meetings', () => {
|
|
|
139
142
|
},
|
|
140
143
|
],
|
|
141
144
|
},
|
|
145
|
+
breakout: {},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
assert.isFalse(SelfUtils.breakoutsChanged(previous, current));
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('should return false if no breakouts in current', () => {
|
|
152
|
+
const current = {
|
|
153
|
+
breakoutSessions: {
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
const previous = {
|
|
157
|
+
breakoutSessions: {
|
|
158
|
+
active: [
|
|
159
|
+
{
|
|
160
|
+
name: 'Breakout session 2',
|
|
161
|
+
groupId: '0e73abb8-5584-49d8-be8d-806d2a8247ca',
|
|
162
|
+
sessionId: '1cf41ab1-2e57-4d95-b7e9-5613acddfb0f',
|
|
163
|
+
sessionType: 'BREAKOUT',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
breakout: {},
|
|
142
168
|
};
|
|
143
169
|
|
|
144
170
|
assert.isFalse(SelfUtils.breakoutsChanged(previous, current));
|
|
@@ -41,8 +41,10 @@ describe('plugin-meetings', () => {
|
|
|
41
41
|
canManageBreakout: null,
|
|
42
42
|
canAdmitLobbyToBreakout: null,
|
|
43
43
|
canUserAskForHelp: null,
|
|
44
|
+
canUserRenameSelfAndObserved: null,
|
|
45
|
+
canUserRenameOthers: null,
|
|
44
46
|
isBreakoutPreassignmentsEnabled: null,
|
|
45
|
-
...expected
|
|
47
|
+
...expected,
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
// Check get retuns all the correct values at once
|
|
@@ -88,7 +90,9 @@ describe('plugin-meetings', () => {
|
|
|
88
90
|
'canManageBreakout',
|
|
89
91
|
'canAdmitLobbyToBreakout',
|
|
90
92
|
'canUserAskForHelp',
|
|
91
|
-
'
|
|
93
|
+
'canUserRenameSelfAndObserved',
|
|
94
|
+
'canUserRenameOthers',
|
|
95
|
+
'isBreakoutPreassignmentsEnabled',
|
|
92
96
|
].forEach((key) => {
|
|
93
97
|
it(`get and set for ${key} work as expected`, () => {
|
|
94
98
|
const inMeetingActions = new InMeetingActions();
|
|
@@ -416,7 +416,10 @@ describe('plugin-meetings', () => {
|
|
|
416
416
|
assert.calledWith(meeting.members.admitMembers, [uuid1]);
|
|
417
417
|
});
|
|
418
418
|
it('should call from a breakout session if caller is in a breakout session', async () => {
|
|
419
|
-
const locusUrls = {
|
|
419
|
+
const locusUrls = {
|
|
420
|
+
authorizingLocusUrl: 'authorizingLocusUrl',
|
|
421
|
+
mainLocusUrl: 'mainLocusUrl',
|
|
422
|
+
};
|
|
420
423
|
await meeting.admit([uuid1], locusUrls);
|
|
421
424
|
assert.calledOnce(meeting.members.admitMembers);
|
|
422
425
|
assert.calledWith(meeting.members.admitMembers, [uuid1], locusUrls);
|
|
@@ -2220,7 +2223,7 @@ describe('plugin-meetings', () => {
|
|
|
2220
2223
|
meeting.isMultistream = true;
|
|
2221
2224
|
|
|
2222
2225
|
const result = await meeting.updateMedia({
|
|
2223
|
-
|
|
2226
|
+
mediaSettings,
|
|
2224
2227
|
});
|
|
2225
2228
|
|
|
2226
2229
|
assert.calledOnceWithExactly(
|
|
@@ -2942,6 +2945,7 @@ describe('plugin-meetings', () => {
|
|
|
2942
2945
|
const FAKE_CAPTCHA_IMAGE_URL = 'http://captchaimage';
|
|
2943
2946
|
const FAKE_CAPTCHA_AUDIO_URL = 'http://captchaaudio';
|
|
2944
2947
|
const FAKE_CAPTCHA_REFRESH_URL = 'http://captcharefresh';
|
|
2948
|
+
const FAKE_INSTALLED_ORG_ID = '123456';
|
|
2945
2949
|
const FAKE_MEETING_INFO = {
|
|
2946
2950
|
conversationUrl: 'some_convo_url',
|
|
2947
2951
|
locusUrl: 'some_locus_url',
|
|
@@ -2969,6 +2973,7 @@ describe('plugin-meetings', () => {
|
|
|
2969
2973
|
meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
|
|
2970
2974
|
meeting.destination = FAKE_DESTINATION;
|
|
2971
2975
|
meeting.destinationType = FAKE_TYPE;
|
|
2976
|
+
meeting.config.installedOrgID = FAKE_INSTALLED_ORG_ID;
|
|
2972
2977
|
meeting.parseMeetingInfo = sinon.stub().returns(undefined);
|
|
2973
2978
|
|
|
2974
2979
|
await meeting.fetchMeetingInfo({
|
|
@@ -2981,7 +2986,8 @@ describe('plugin-meetings', () => {
|
|
|
2981
2986
|
FAKE_DESTINATION,
|
|
2982
2987
|
FAKE_TYPE,
|
|
2983
2988
|
FAKE_PASSWORD,
|
|
2984
|
-
{code: FAKE_CAPTCHA_CODE, id: FAKE_CAPTCHA_ID}
|
|
2989
|
+
{code: FAKE_CAPTCHA_CODE, id: FAKE_CAPTCHA_ID},
|
|
2990
|
+
FAKE_INSTALLED_ORG_ID
|
|
2985
2991
|
);
|
|
2986
2992
|
|
|
2987
2993
|
assert.calledWith(meeting.parseMeetingInfo, {body: FAKE_MEETING_INFO}, FAKE_DESTINATION);
|
|
@@ -5075,6 +5081,8 @@ describe('plugin-meetings', () => {
|
|
|
5075
5081
|
let handleDataChannelUrlChangeSpy;
|
|
5076
5082
|
let canEnableReactionsSpy;
|
|
5077
5083
|
let canSendReactionsSpy;
|
|
5084
|
+
let canUserRenameSelfAndObservedSpy;
|
|
5085
|
+
let canUserRenameOthersSpy;
|
|
5078
5086
|
|
|
5079
5087
|
beforeEach(() => {
|
|
5080
5088
|
locusInfoOnSpy = sinon.spy(meeting.locusInfo, 'on');
|
|
@@ -5100,6 +5108,8 @@ describe('plugin-meetings', () => {
|
|
|
5100
5108
|
handleDataChannelUrlChangeSpy = sinon.spy(meeting, 'handleDataChannelUrlChange');
|
|
5101
5109
|
canEnableReactionsSpy = sinon.spy(MeetingUtil, 'canEnableReactions');
|
|
5102
5110
|
canSendReactionsSpy = sinon.spy(MeetingUtil, 'canSendReactions');
|
|
5111
|
+
canUserRenameSelfAndObservedSpy = sinon.spy(MeetingUtil, 'canUserRenameSelfAndObserved');
|
|
5112
|
+
canUserRenameOthersSpy = sinon.spy(MeetingUtil, 'canUserRenameOthers');
|
|
5103
5113
|
});
|
|
5104
5114
|
|
|
5105
5115
|
afterEach(() => {
|
|
@@ -5145,6 +5155,8 @@ describe('plugin-meetings', () => {
|
|
|
5145
5155
|
assert.calledWith(handleDataChannelUrlChangeSpy, payload.info.datachannelUrl);
|
|
5146
5156
|
assert.calledWith(canEnableReactionsSpy, null, payload.info.userDisplayHints);
|
|
5147
5157
|
assert.calledWith(canSendReactionsSpy, null, payload.info.userDisplayHints);
|
|
5158
|
+
assert.calledWith(canUserRenameSelfAndObservedSpy, payload.info.userDisplayHints);
|
|
5159
|
+
assert.calledWith(canUserRenameOthersSpy, payload.info.userDisplayHints);
|
|
5148
5160
|
|
|
5149
5161
|
assert.calledWith(
|
|
5150
5162
|
TriggerProxy.trigger,
|
|
@@ -73,7 +73,7 @@ describe('plugin-meetings', () => {
|
|
|
73
73
|
const mockTrack = {
|
|
74
74
|
underlyingTrack: {
|
|
75
75
|
getSettings: fakeDevice,
|
|
76
|
-
}
|
|
76
|
+
},
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
it('#log - should log [info, warn, error, log] to console', () => {
|
|
@@ -202,12 +202,14 @@ describe('plugin-meetings', () => {
|
|
|
202
202
|
|
|
203
203
|
it('#Should call meetingRequest.joinMeeting with breakoutsSupported=true when passed in as true', async () => {
|
|
204
204
|
const meeting = {
|
|
205
|
-
meetingRequest: {
|
|
205
|
+
meetingRequest: {
|
|
206
|
+
joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}})),
|
|
207
|
+
},
|
|
206
208
|
};
|
|
207
209
|
|
|
208
210
|
MeetingUtil.parseLocusJoin = sinon.stub();
|
|
209
211
|
await MeetingUtil.joinMeeting(meeting, {
|
|
210
|
-
breakoutsSupported: true
|
|
212
|
+
breakoutsSupported: true,
|
|
211
213
|
});
|
|
212
214
|
|
|
213
215
|
assert.calledOnce(meeting.meetingRequest.joinMeeting);
|
|
@@ -216,7 +218,6 @@ describe('plugin-meetings', () => {
|
|
|
216
218
|
assert.equal(parameter.breakoutsSupported, true);
|
|
217
219
|
});
|
|
218
220
|
|
|
219
|
-
|
|
220
221
|
it('#Should call meetingRequest.joinMeeting with preferTranscoding=false when multistream is enabled', async () => {
|
|
221
222
|
const meeting = {
|
|
222
223
|
isMultistream: true,
|
|
@@ -346,6 +347,23 @@ describe('plugin-meetings', () => {
|
|
|
346
347
|
});
|
|
347
348
|
});
|
|
348
349
|
|
|
350
|
+
describe('canUserRenameSelfAndObserved', () => {
|
|
351
|
+
it('works as expected', () => {
|
|
352
|
+
assert.deepEqual(
|
|
353
|
+
MeetingUtil.canUserRenameSelfAndObserved(['CAN_RENAME_SELF_AND_OBSERVED']),
|
|
354
|
+
true
|
|
355
|
+
);
|
|
356
|
+
assert.deepEqual(MeetingUtil.canUserRenameSelfAndObserved([]), false);
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
describe('canUserRenameOthers', () => {
|
|
361
|
+
it('works as expected', () => {
|
|
362
|
+
assert.deepEqual(MeetingUtil.canUserRenameOthers(['CAN_RENAME_OTHERS']), true);
|
|
363
|
+
assert.deepEqual(MeetingUtil.canUserRenameOthers([]), false);
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
|
|
349
367
|
describe('bothLeaveAndEndMeetingAvailable', () => {
|
|
350
368
|
it('works as expected', () => {
|
|
351
369
|
assert.deepEqual(
|
|
@@ -410,12 +428,20 @@ describe('plugin-meetings', () => {
|
|
|
410
428
|
|
|
411
429
|
describe('reactions', () => {
|
|
412
430
|
describe('canEnableReactions', () => {
|
|
413
|
-
[
|
|
431
|
+
[
|
|
432
|
+
[null, DISPLAY_HINTS.ENABLE_REACTIONS, true],
|
|
433
|
+
[null, DISPLAY_HINTS.DISABLE_REACTIONS, false],
|
|
434
|
+
[null, undefined, null],
|
|
435
|
+
].forEach(() => ([originalValue, displayHint, expected]) => {
|
|
414
436
|
assert.deepEqual(MeetingUtil.canEnableReactions(originalValue, [displayHint]), expected);
|
|
415
437
|
});
|
|
416
438
|
});
|
|
417
439
|
describe('canEnableReactions', () => {
|
|
418
|
-
[
|
|
440
|
+
[
|
|
441
|
+
[null, DISPLAY_HINTS.REACTIONS_ACTIVE, true],
|
|
442
|
+
[null, DISPLAY_HINTS.REACTIONS_INACTIVE, false],
|
|
443
|
+
[null, undefined, null],
|
|
444
|
+
].forEach(([originalValue, displayHint, expected]) => {
|
|
419
445
|
assert.deepEqual(MeetingUtil.canSendReactions(originalValue, [displayHint]), expected);
|
|
420
446
|
});
|
|
421
447
|
});
|
|
@@ -430,7 +456,10 @@ describe('plugin-meetings', () => {
|
|
|
430
456
|
|
|
431
457
|
describe('isSuppressBreakoutSupport', () => {
|
|
432
458
|
it('works as expected', () => {
|
|
433
|
-
assert.deepEqual(
|
|
459
|
+
assert.deepEqual(
|
|
460
|
+
MeetingUtil.isSuppressBreakoutSupport(['UCF_SUPPRESS_BREAKOUTS_SUPPORT']),
|
|
461
|
+
true
|
|
462
|
+
);
|
|
434
463
|
assert.deepEqual(MeetingUtil.isSuppressBreakoutSupport([]), false);
|
|
435
464
|
});
|
|
436
465
|
});
|
|
@@ -451,9 +480,12 @@ describe('plugin-meetings', () => {
|
|
|
451
480
|
|
|
452
481
|
describe('isBreakoutPreassignmentsEnabled', () => {
|
|
453
482
|
it('works as expected', () => {
|
|
454
|
-
assert.deepEqual(
|
|
483
|
+
assert.deepEqual(
|
|
484
|
+
MeetingUtil.isBreakoutPreassignmentsEnabled(['DISABLE_BREAKOUT_PREASSIGNMENTS']),
|
|
485
|
+
false
|
|
486
|
+
);
|
|
455
487
|
assert.deepEqual(MeetingUtil.isBreakoutPreassignmentsEnabled([]), true);
|
|
456
488
|
});
|
|
457
489
|
});
|
|
458
|
-
})
|
|
490
|
+
});
|
|
459
491
|
});
|
|
@@ -211,6 +211,33 @@ describe('plugin-meetings', () => {
|
|
|
211
211
|
);
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
+
it('should fetch meeting info with provided installedOrgID', async () => {
|
|
215
|
+
const requestResponse = {statusCode: 200, body: {meetingKey: '1234323'}};
|
|
216
|
+
const installedOrgID = '123456';
|
|
217
|
+
|
|
218
|
+
webex.request.resolves(requestResponse);
|
|
219
|
+
|
|
220
|
+
const result = await meetingInfo.fetchMeetingInfo('1234323', _MEETING_ID_, null, null, installedOrgID);
|
|
221
|
+
|
|
222
|
+
assert.calledWith(webex.request, {
|
|
223
|
+
method: 'POST',
|
|
224
|
+
service: WBXAPPAPI_SERVICE,
|
|
225
|
+
resource: 'meetingInfo',
|
|
226
|
+
body: {
|
|
227
|
+
supportHostKey: true,
|
|
228
|
+
supportCountryList: true,
|
|
229
|
+
meetingKey: '1234323',
|
|
230
|
+
installedOrgID,
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
assert.deepEqual(result, requestResponse);
|
|
234
|
+
assert(Metrics.sendBehavioralMetric.calledOnce);
|
|
235
|
+
assert.calledWith(
|
|
236
|
+
Metrics.sendBehavioralMetric,
|
|
237
|
+
BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
|
|
214
241
|
it('create adhoc meeting when conversationUrl passed with enableAdhocMeetings toggle', async () => {
|
|
215
242
|
sinon.stub(meetingInfo, 'createAdhocSpaceMeeting').returns(Promise.resolve());
|
|
216
243
|
await meetingInfo.fetchMeetingInfo('conversationUrl', _CONVERSATION_URL_);
|
|
@@ -15,7 +15,7 @@ import Meetings from '@webex/plugin-meetings';
|
|
|
15
15
|
import Members from '@webex/plugin-meetings/src/members';
|
|
16
16
|
import MembersUtil from '@webex/plugin-meetings/src/members/util';
|
|
17
17
|
import Trigger from '@webex/plugin-meetings/src/common/events/trigger-proxy';
|
|
18
|
-
import {EVENT_TRIGGERS} from
|
|
18
|
+
import {EVENT_TRIGGERS} from '@webex/plugin-meetings/src/constants';
|
|
19
19
|
|
|
20
20
|
const {assert} = chai;
|
|
21
21
|
|
|
@@ -214,10 +214,16 @@ describe('plugin-meetings', () => {
|
|
|
214
214
|
Trigger.trigger = sinon.stub();
|
|
215
215
|
members.clearMembers();
|
|
216
216
|
assert.deepEqual(members.membersCollection.members, {});
|
|
217
|
-
assert.calledWith(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
assert.calledWith(
|
|
218
|
+
Trigger.trigger,
|
|
219
|
+
members,
|
|
220
|
+
{
|
|
221
|
+
file: 'members',
|
|
222
|
+
function: 'clearMembers',
|
|
223
|
+
},
|
|
224
|
+
EVENT_TRIGGERS.MEMBERS_CLEAR,
|
|
225
|
+
{}
|
|
226
|
+
);
|
|
221
227
|
});
|
|
222
228
|
});
|
|
223
229
|
describe('#locusParticipantsUpdate', () => {
|
|
@@ -233,14 +239,20 @@ describe('plugin-meetings', () => {
|
|
|
233
239
|
|
|
234
240
|
members.locusParticipantsUpdate(fakePayload);
|
|
235
241
|
|
|
236
|
-
assert.calledWith(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
assert.calledWith(
|
|
243
|
+
Trigger.trigger,
|
|
244
|
+
members,
|
|
245
|
+
{
|
|
246
|
+
file: 'members',
|
|
247
|
+
function: 'locusParticipantsUpdate',
|
|
248
|
+
},
|
|
249
|
+
EVENT_TRIGGERS.MEMBERS_UPDATE,
|
|
250
|
+
{
|
|
251
|
+
delta: {added: [], updated: []},
|
|
252
|
+
full: {},
|
|
253
|
+
isReplace: true,
|
|
254
|
+
}
|
|
255
|
+
);
|
|
244
256
|
});
|
|
245
257
|
});
|
|
246
258
|
describe('#sendDialPadKey', () => {
|
|
@@ -375,9 +387,23 @@ describe('plugin-meetings', () => {
|
|
|
375
387
|
const memberId = uuid.v4();
|
|
376
388
|
const {members, spies} = setup(url1);
|
|
377
389
|
|
|
378
|
-
const resultPromise = members.assignRoles(memberId, [
|
|
390
|
+
const resultPromise = members.assignRoles(memberId, [
|
|
391
|
+
{type: 'PRESENTER', hasRole: true},
|
|
392
|
+
{type: 'MODERATOR', hasRole: false},
|
|
393
|
+
{type: 'COHOST', hasRole: true},
|
|
394
|
+
]);
|
|
379
395
|
|
|
380
|
-
await checkValid(
|
|
396
|
+
await checkValid(
|
|
397
|
+
resultPromise,
|
|
398
|
+
spies,
|
|
399
|
+
memberId,
|
|
400
|
+
[
|
|
401
|
+
{type: 'PRESENTER', hasRole: true},
|
|
402
|
+
{type: 'MODERATOR', hasRole: false},
|
|
403
|
+
{type: 'COHOST', hasRole: true},
|
|
404
|
+
],
|
|
405
|
+
url1
|
|
406
|
+
);
|
|
381
407
|
});
|
|
382
408
|
});
|
|
383
409
|
|
|
@@ -550,6 +576,88 @@ describe('plugin-meetings', () => {
|
|
|
550
576
|
});
|
|
551
577
|
});
|
|
552
578
|
|
|
579
|
+
describe('#editDisplayName', () => {
|
|
580
|
+
const setup = (locusUrl) => {
|
|
581
|
+
const members = createMembers({url: locusUrl});
|
|
582
|
+
|
|
583
|
+
const spies = {
|
|
584
|
+
generateEditDisplayNameMemberOptions: sandbox.spy(
|
|
585
|
+
MembersUtil,
|
|
586
|
+
'generateEditDisplayNameMemberOptions'
|
|
587
|
+
),
|
|
588
|
+
editDisplayNameMember: sandbox.spy(members.membersRequest, 'editDisplayNameMember'),
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
return {members, spies};
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
const checkInvalid = async (resultPromise, expectedMessage, spies) => {
|
|
595
|
+
await assert.isRejected(resultPromise, ParameterError, expectedMessage);
|
|
596
|
+
assert.notCalled(spies.generateEditDisplayNameMemberOptions);
|
|
597
|
+
assert.notCalled(spies.editDisplayNameMember);
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
const checkValid = async (
|
|
601
|
+
resultPromise,
|
|
602
|
+
spies,
|
|
603
|
+
expectedMemberId,
|
|
604
|
+
expectedRequestingParticipantId,
|
|
605
|
+
expectedAlias,
|
|
606
|
+
expectedLocusUrl
|
|
607
|
+
) => {
|
|
608
|
+
await assert.isFulfilled(resultPromise);
|
|
609
|
+
assert.calledOnceWithExactly(
|
|
610
|
+
spies.generateEditDisplayNameMemberOptions,
|
|
611
|
+
expectedMemberId,
|
|
612
|
+
expectedRequestingParticipantId,
|
|
613
|
+
expectedAlias,
|
|
614
|
+
expectedLocusUrl
|
|
615
|
+
);
|
|
616
|
+
assert.calledOnceWithExactly(spies.editDisplayNameMember, {
|
|
617
|
+
memberId: expectedMemberId,
|
|
618
|
+
requestingParticipantId: expectedRequestingParticipantId,
|
|
619
|
+
alias: expectedAlias,
|
|
620
|
+
locusUrl: expectedLocusUrl,
|
|
621
|
+
});
|
|
622
|
+
assert.strictEqual(resultPromise, spies.editDisplayNameMember.getCall(0).returnValue);
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
it('should not make a request if there is no memberId', async () => {
|
|
626
|
+
const {members, spies} = setup(url1);
|
|
627
|
+
|
|
628
|
+
const resultPromise = members.editDisplayName();
|
|
629
|
+
|
|
630
|
+
await checkInvalid(
|
|
631
|
+
resultPromise,
|
|
632
|
+
'The member id must be defined to edit display name of the member.',
|
|
633
|
+
spies
|
|
634
|
+
);
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
it('should not make a request if there is no locus url', async () => {
|
|
638
|
+
const {members, spies} = setup();
|
|
639
|
+
|
|
640
|
+
const resultPromise = members.editDisplayName(uuid.v4());
|
|
641
|
+
|
|
642
|
+
await checkInvalid(
|
|
643
|
+
resultPromise,
|
|
644
|
+
'The associated locus url for this meetings members object must be defined.',
|
|
645
|
+
spies
|
|
646
|
+
);
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
it('should make the correct request when called with respective parameters', async () => {
|
|
650
|
+
const requestingParticipantId = uuid.v4();
|
|
651
|
+
const memberId = uuid.v4();
|
|
652
|
+
const alias = 'aliasName';
|
|
653
|
+
const {members, spies} = setup(url1);
|
|
654
|
+
|
|
655
|
+
const resultPromise = members.editDisplayName(memberId, requestingParticipantId, alias);
|
|
656
|
+
|
|
657
|
+
await checkValid(resultPromise, spies, memberId, requestingParticipantId, alias, url1);
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
|
|
553
661
|
describe('findMemberByCsi()', () => {
|
|
554
662
|
let members;
|
|
555
663
|
|
|
@@ -107,7 +107,11 @@ describe('plugin-meetings', () => {
|
|
|
107
107
|
it('sends a PATCH to the locus endpoint', async () => {
|
|
108
108
|
const locusUrl = url1;
|
|
109
109
|
const memberId = 'test1';
|
|
110
|
-
const roles = [
|
|
110
|
+
const roles = [
|
|
111
|
+
{type: 'PRESENTER', hasRole: true},
|
|
112
|
+
{type: 'MODERATOR', hasRole: false},
|
|
113
|
+
{type: 'COHOST', hasRole: true},
|
|
114
|
+
];
|
|
111
115
|
|
|
112
116
|
const options = {
|
|
113
117
|
memberId,
|
|
@@ -217,5 +221,27 @@ describe('plugin-meetings', () => {
|
|
|
217
221
|
});
|
|
218
222
|
});
|
|
219
223
|
});
|
|
224
|
+
|
|
225
|
+
describe('#editDisplayName', () => {
|
|
226
|
+
it('sends a POST request to the locus endpoint', async () => {
|
|
227
|
+
const locusUrl = url1;
|
|
228
|
+
const memberId = 'test1';
|
|
229
|
+
const requestingParticipantId = 'test2';
|
|
230
|
+
const aliasValue = 'alias';
|
|
231
|
+
|
|
232
|
+
const options = {
|
|
233
|
+
memberId,
|
|
234
|
+
requestingParticipantId,
|
|
235
|
+
aliasValue,
|
|
236
|
+
locusUrl,
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
await membersRequest.editDisplayNameMember(options);
|
|
240
|
+
const requestParams = membersRequest.request.getCall(0).args[0];
|
|
241
|
+
|
|
242
|
+
assert.equal(requestParams.method, 'POST');
|
|
243
|
+
assert.equal(requestParams.uri, `${locusUrl}/participant/${memberId}/alias`);
|
|
244
|
+
});
|
|
245
|
+
});
|
|
220
246
|
});
|
|
221
247
|
});
|