@webex/plugin-meetings 3.8.0-next.70 → 3.8.0-next.72
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 +70 -6
- package/dist/breakouts/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +12 -11
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +53 -26
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/types/locus-info/index.d.ts +2 -3
- package/dist/types/locus-info/selfUtils.d.ts +19 -50
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/breakouts/index.ts +69 -0
- package/src/locus-info/index.ts +15 -11
- package/src/locus-info/selfUtils.ts +73 -23
- package/test/unit/spec/breakouts/index.ts +167 -95
- package/test/unit/spec/locus-info/index.js +113 -73
- package/test/unit/spec/locus-info/selfUtils.js +98 -24
@@ -836,7 +836,7 @@ describe('plugin-meetings', () => {
|
|
836
836
|
selfWithBrbChanged.controls.brb = enabled;
|
837
837
|
|
838
838
|
locusInfo.emitScoped = sinon.stub();
|
839
|
-
locusInfo.updateSelf(selfWithBrbChanged
|
839
|
+
locusInfo.updateSelf(selfWithBrbChanged);
|
840
840
|
|
841
841
|
assert.calledWith(
|
842
842
|
locusInfo.emitScoped,
|
@@ -856,14 +856,15 @@ describe('plugin-meetings', () => {
|
|
856
856
|
|
857
857
|
const selfWithBrbChanged = cloneDeep(self);
|
858
858
|
selfWithBrbChanged.controls.brb = value;
|
859
|
-
|
859
|
+
|
860
|
+
locusInfo.updateSelf(selfWithBrbChanged);
|
860
861
|
|
861
862
|
locusInfo.emitScoped = sinon.stub();
|
862
863
|
|
863
864
|
const newSelf = cloneDeep(self);
|
864
865
|
newSelf.controls.brb = value;
|
865
866
|
|
866
|
-
locusInfo.updateSelf(newSelf
|
867
|
+
locusInfo.updateSelf(newSelf);
|
867
868
|
|
868
869
|
assert.neverCalledWith(
|
869
870
|
locusInfo.emitScoped,
|
@@ -880,14 +881,14 @@ describe('plugin-meetings', () => {
|
|
880
881
|
it('should not trigger SELF_MEETING_BRB_CHANGED when brb state is undefined', () => {
|
881
882
|
const selfWithBrbChanged = cloneDeep(self);
|
882
883
|
selfWithBrbChanged.controls.brb = false;
|
883
|
-
locusInfo.
|
884
|
+
locusInfo.updateSelf(selfWithBrbChanged);
|
884
885
|
|
885
886
|
locusInfo.emitScoped = sinon.stub();
|
886
887
|
|
887
888
|
const newSelf = cloneDeep(self);
|
888
889
|
newSelf.controls.brb = undefined;
|
889
890
|
|
890
|
-
locusInfo.updateSelf(newSelf
|
891
|
+
locusInfo.updateSelf(newSelf);
|
891
892
|
|
892
893
|
assert.neverCalledWith(
|
893
894
|
locusInfo.emitScoped,
|
@@ -910,7 +911,7 @@ describe('plugin-meetings', () => {
|
|
910
911
|
];
|
911
912
|
|
912
913
|
locusInfo.emitScoped = sinon.stub();
|
913
|
-
locusInfo.updateSelf(selfWithLayoutChanged
|
914
|
+
locusInfo.updateSelf(selfWithLayoutChanged);
|
914
915
|
|
915
916
|
assert.calledWith(
|
916
917
|
locusInfo.emitScoped,
|
@@ -936,11 +937,11 @@ describe('plugin-meetings', () => {
|
|
936
937
|
];
|
937
938
|
|
938
939
|
// Set the layout prior to stubbing to validate it does not change.
|
939
|
-
locusInfo.updateSelf(selfWithLayoutChanged
|
940
|
+
locusInfo.updateSelf(selfWithLayoutChanged);
|
940
941
|
|
941
942
|
locusInfo.emitScoped = sinon.stub();
|
942
943
|
|
943
|
-
locusInfo.updateSelf(selfWithLayoutChanged
|
944
|
+
locusInfo.updateSelf(selfWithLayoutChanged);
|
944
945
|
|
945
946
|
assert.neverCalledWith(
|
946
947
|
locusInfo.emitScoped,
|
@@ -954,11 +955,11 @@ describe('plugin-meetings', () => {
|
|
954
955
|
});
|
955
956
|
|
956
957
|
it('should trigger MEDIA_INACTIVITY on server media inactivity', () => {
|
957
|
-
locusInfo.self = self;
|
958
|
-
|
959
958
|
locusInfo.webex.internal.device.url = selfWithInactivity.deviceUrl;
|
959
|
+
locusInfo.updateSelf(self);
|
960
|
+
|
960
961
|
locusInfo.emitScoped = sinon.stub();
|
961
|
-
locusInfo.updateSelf(selfWithInactivity
|
962
|
+
locusInfo.updateSelf(selfWithInactivity);
|
962
963
|
|
963
964
|
assert.calledWith(
|
964
965
|
locusInfo.emitScoped,
|
@@ -980,7 +981,7 @@ describe('plugin-meetings', () => {
|
|
980
981
|
|
981
982
|
locusInfo.webex.internal.device.url = self.deviceUrl;
|
982
983
|
locusInfo.emitScoped = sinon.stub();
|
983
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
984
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
984
985
|
|
985
986
|
assert.calledWith(
|
986
987
|
locusInfo.emitScoped,
|
@@ -993,10 +994,10 @@ describe('plugin-meetings', () => {
|
|
993
994
|
);
|
994
995
|
|
995
996
|
// but sometimes "previous self" is defined, but without controls.audio.muted, so we test this here:
|
996
|
-
locusInfo.
|
997
|
+
locusInfo.updateSelf(self);
|
997
998
|
locusInfo.self.controls.audio = {};
|
998
999
|
|
999
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
1000
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1000
1001
|
assert.calledWith(
|
1001
1002
|
locusInfo.emitScoped,
|
1002
1003
|
{
|
@@ -1016,7 +1017,7 @@ describe('plugin-meetings', () => {
|
|
1016
1017
|
|
1017
1018
|
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1018
1019
|
locusInfo.emitScoped = sinon.stub();
|
1019
|
-
locusInfo.updateSelf(selfWithMutedByOthersFalse
|
1020
|
+
locusInfo.updateSelf(selfWithMutedByOthersFalse);
|
1020
1021
|
|
1021
1022
|
// we might get some calls to emitScoped, but we need to check that none of them are for SELF_REMOTE_MUTE_STATUS_UPDATED
|
1022
1023
|
locusInfo.emitScoped.getCalls().forEach((x) => {
|
@@ -1025,20 +1026,20 @@ describe('plugin-meetings', () => {
|
|
1025
1026
|
});
|
1026
1027
|
|
1027
1028
|
it('should not trigger SELF_REMOTE_MUTE_STATUS_UPDATED when being removed from meeting', () => {
|
1029
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1028
1030
|
const selfWithMutedByOthers = cloneDeep(self);
|
1029
1031
|
|
1030
1032
|
selfWithMutedByOthers.controls.audio.muted = true;
|
1031
1033
|
|
1032
|
-
locusInfo.
|
1034
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1033
1035
|
|
1034
1036
|
// when user gets removed from meeting we receive a Locus DTO without any self.controls
|
1035
1037
|
const selfWithoutControls = cloneDeep(self);
|
1036
1038
|
|
1037
1039
|
selfWithoutControls.controls = undefined;
|
1038
1040
|
|
1039
|
-
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1040
1041
|
locusInfo.emitScoped = sinon.stub();
|
1041
|
-
locusInfo.updateSelf(selfWithoutControls
|
1042
|
+
locusInfo.updateSelf(selfWithoutControls);
|
1042
1043
|
|
1043
1044
|
// we might get some calls to emitScoped, but we need to check that none of them are for SELF_REMOTE_MUTE_STATUS_UPDATED
|
1044
1045
|
locusInfo.emitScoped.getCalls().forEach((x) => {
|
@@ -1047,14 +1048,14 @@ describe('plugin-meetings', () => {
|
|
1047
1048
|
});
|
1048
1049
|
|
1049
1050
|
it('should trigger SELF_REMOTE_MUTE_STATUS_UPDATED on othersMuted', () => {
|
1050
|
-
locusInfo.
|
1051
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1052
|
+
locusInfo.updateSelf(self);
|
1051
1053
|
const selfWithMutedByOthers = cloneDeep(self);
|
1052
1054
|
|
1053
1055
|
selfWithMutedByOthers.controls.audio.muted = true;
|
1054
1056
|
|
1055
|
-
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1056
1057
|
locusInfo.emitScoped = sinon.stub();
|
1057
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
1058
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1058
1059
|
|
1059
1060
|
assert.calledWith(
|
1060
1061
|
locusInfo.emitScoped,
|
@@ -1078,7 +1079,7 @@ describe('plugin-meetings', () => {
|
|
1078
1079
|
|
1079
1080
|
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1080
1081
|
locusInfo.emitScoped = sinon.stub();
|
1081
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
1082
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1082
1083
|
|
1083
1084
|
assert.calledWith(
|
1084
1085
|
locusInfo.emitScoped,
|
@@ -1091,10 +1092,10 @@ describe('plugin-meetings', () => {
|
|
1091
1092
|
);
|
1092
1093
|
|
1093
1094
|
// but sometimes "previous self" is defined, but without controls.audio.muted, so we test this here:
|
1094
|
-
locusInfo.
|
1095
|
+
locusInfo.updateSelf(self);
|
1095
1096
|
locusInfo.self.controls.video = {};
|
1096
1097
|
|
1097
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
1098
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1098
1099
|
assert.calledWith(
|
1099
1100
|
locusInfo.emitScoped,
|
1100
1101
|
{
|
@@ -1114,7 +1115,7 @@ describe('plugin-meetings', () => {
|
|
1114
1115
|
|
1115
1116
|
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1116
1117
|
locusInfo.emitScoped = sinon.stub();
|
1117
|
-
locusInfo.updateSelf(selfWithMutedByOthersFalse
|
1118
|
+
locusInfo.updateSelf(selfWithMutedByOthersFalse);
|
1118
1119
|
|
1119
1120
|
// we might get some calls to emitScoped, but we need to check that none of them are for SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED
|
1120
1121
|
locusInfo.emitScoped.getCalls().forEach((x) => {
|
@@ -1123,14 +1124,14 @@ describe('plugin-meetings', () => {
|
|
1123
1124
|
});
|
1124
1125
|
|
1125
1126
|
it('should emit event when remoteVideoMuted changed', () => {
|
1126
|
-
locusInfo.
|
1127
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1128
|
+
locusInfo.updateSelf(self);
|
1127
1129
|
const selfWithMutedByOthers = cloneDeep(self);
|
1128
1130
|
|
1129
1131
|
selfWithMutedByOthers.controls.video.muted = true;
|
1130
1132
|
|
1131
|
-
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1132
1133
|
locusInfo.emitScoped = sinon.stub();
|
1133
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
1134
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1134
1135
|
|
1135
1136
|
assert.calledWith(
|
1136
1137
|
locusInfo.emitScoped,
|
@@ -1145,13 +1146,13 @@ describe('plugin-meetings', () => {
|
|
1145
1146
|
});
|
1146
1147
|
|
1147
1148
|
it('should trigger SELF_MEETING_BREAKOUTS_CHANGED when breakouts changed', () => {
|
1148
|
-
locusInfo.self
|
1149
|
+
locusInfo.updateSelf(self);
|
1149
1150
|
const selfWithBreakoutsChanged = cloneDeep(self);
|
1150
1151
|
|
1151
1152
|
selfWithBreakoutsChanged.controls.breakout.sessions.active[0].name = 'new name';
|
1152
1153
|
|
1153
1154
|
locusInfo.emitScoped = sinon.stub();
|
1154
|
-
locusInfo.updateSelf(selfWithBreakoutsChanged
|
1155
|
+
locusInfo.updateSelf(selfWithBreakoutsChanged);
|
1155
1156
|
|
1156
1157
|
assert.calledWith(
|
1157
1158
|
locusInfo.emitScoped,
|
@@ -1184,16 +1185,16 @@ describe('plugin-meetings', () => {
|
|
1184
1185
|
});
|
1185
1186
|
|
1186
1187
|
it('should trigger SELF_REMOTE_MUTE_STATUS_UPDATED if muted and disallowUnmute changed', () => {
|
1187
|
-
locusInfo.
|
1188
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1189
|
+
locusInfo.updateSelf(self);
|
1188
1190
|
const selfWithMutedByOthersAndDissalowUnmute = cloneDeep(self);
|
1189
1191
|
|
1190
1192
|
// first simulate remote mute
|
1191
1193
|
selfWithMutedByOthersAndDissalowUnmute.controls.audio.muted = true;
|
1192
1194
|
selfWithMutedByOthersAndDissalowUnmute.controls.audio.disallowUnmute = true;
|
1193
1195
|
|
1194
|
-
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1195
1196
|
locusInfo.emitScoped = sinon.stub();
|
1196
|
-
locusInfo.updateSelf(selfWithMutedByOthersAndDissalowUnmute
|
1197
|
+
locusInfo.updateSelf(selfWithMutedByOthersAndDissalowUnmute);
|
1197
1198
|
|
1198
1199
|
assert.calledWith(
|
1199
1200
|
locusInfo.emitScoped,
|
@@ -1211,7 +1212,7 @@ describe('plugin-meetings', () => {
|
|
1211
1212
|
selfWithMutedByOthers.controls.audio.muted = true;
|
1212
1213
|
selfWithMutedByOthers.controls.audio.disallowUnmute = false;
|
1213
1214
|
|
1214
|
-
locusInfo.updateSelf(selfWithMutedByOthers
|
1215
|
+
locusInfo.updateSelf(selfWithMutedByOthers);
|
1215
1216
|
|
1216
1217
|
assert.calledWith(
|
1217
1218
|
locusInfo.emitScoped,
|
@@ -1225,15 +1226,15 @@ describe('plugin-meetings', () => {
|
|
1225
1226
|
});
|
1226
1227
|
|
1227
1228
|
it('should trigger LOCAL_UNMUTE_REQUIRED on localAudioUnmuteRequired', () => {
|
1228
|
-
locusInfo.
|
1229
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1230
|
+
locusInfo.updateSelf(self);
|
1229
1231
|
const selfWithLocalUnmuteRequired = cloneDeep(self);
|
1230
1232
|
|
1231
1233
|
selfWithLocalUnmuteRequired.controls.audio.muted = false;
|
1232
1234
|
selfWithLocalUnmuteRequired.controls.audio.localAudioUnmuteRequired = true;
|
1233
1235
|
|
1234
|
-
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1235
1236
|
locusInfo.emitScoped = sinon.stub();
|
1236
|
-
locusInfo.updateSelf(selfWithLocalUnmuteRequired
|
1237
|
+
locusInfo.updateSelf(selfWithLocalUnmuteRequired);
|
1237
1238
|
|
1238
1239
|
assert.calledWith(
|
1239
1240
|
locusInfo.emitScoped,
|
@@ -1250,16 +1251,16 @@ describe('plugin-meetings', () => {
|
|
1250
1251
|
});
|
1251
1252
|
|
1252
1253
|
it('should trigger LOCAL_UNMUTE_REQUESTED when receiving requestedToUnmute=true', () => {
|
1253
|
-
locusInfo.
|
1254
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1255
|
+
locusInfo.updateSelf(self);
|
1254
1256
|
const selfWithRequestedToUnmute = cloneDeep(self);
|
1255
1257
|
|
1256
1258
|
selfWithRequestedToUnmute.controls.audio.requestedToUnmute = true;
|
1257
1259
|
selfWithRequestedToUnmute.controls.audio.lastModifiedRequestedToUnmute =
|
1258
1260
|
'2023-06-16T19:25:04.369Z';
|
1259
1261
|
|
1260
|
-
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1261
1262
|
locusInfo.emitScoped = sinon.stub();
|
1262
|
-
locusInfo.updateSelf(selfWithRequestedToUnmute
|
1263
|
+
locusInfo.updateSelf(selfWithRequestedToUnmute);
|
1263
1264
|
|
1264
1265
|
assert.calledWith(
|
1265
1266
|
locusInfo.emitScoped,
|
@@ -1277,7 +1278,7 @@ describe('plugin-meetings', () => {
|
|
1277
1278
|
selfWithoutRequestedToUnmute.controls.audio.requestedToUnmute = false;
|
1278
1279
|
|
1279
1280
|
locusInfo.emitScoped.resetHistory();
|
1280
|
-
locusInfo.updateSelf(selfWithoutRequestedToUnmute
|
1281
|
+
locusInfo.updateSelf(selfWithoutRequestedToUnmute);
|
1281
1282
|
|
1282
1283
|
assert.neverCalledWith(
|
1283
1284
|
locusInfo.emitScoped,
|
@@ -1291,15 +1292,14 @@ describe('plugin-meetings', () => {
|
|
1291
1292
|
});
|
1292
1293
|
|
1293
1294
|
it('should trigger SELF_OBSERVING when moving meeting to DX', () => {
|
1294
|
-
locusInfo.
|
1295
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1296
|
+
locusInfo.updateSelf(self);
|
1295
1297
|
const selfInitiatedMove = cloneDeep(self);
|
1296
1298
|
|
1297
1299
|
// Inital move meeting is iniated
|
1298
1300
|
selfInitiatedMove.devices[0].intent.type = 'MOVE_MEDIA';
|
1299
1301
|
|
1300
|
-
locusInfo.
|
1301
|
-
|
1302
|
-
locusInfo.updateSelf(selfInitiatedMove, []);
|
1302
|
+
locusInfo.updateSelf(selfInitiatedMove);
|
1303
1303
|
|
1304
1304
|
locusInfo.emitScoped = sinon.stub();
|
1305
1305
|
// When dx joined the meeting after move
|
@@ -1307,7 +1307,7 @@ describe('plugin-meetings', () => {
|
|
1307
1307
|
|
1308
1308
|
selfAfterDxJoins.devices[0].intent.type = 'OBSERVE';
|
1309
1309
|
|
1310
|
-
locusInfo.updateSelf(selfAfterDxJoins
|
1310
|
+
locusInfo.updateSelf(selfAfterDxJoins);
|
1311
1311
|
|
1312
1312
|
assert.calledWith(
|
1313
1313
|
locusInfo.emitScoped,
|
@@ -1325,11 +1325,11 @@ describe('plugin-meetings', () => {
|
|
1325
1325
|
selfClone.canNotViewTheParticipantList = false; // same
|
1326
1326
|
|
1327
1327
|
// Set the layout prior to stubbing to validate it does not change.
|
1328
|
-
locusInfo.updateSelf(self
|
1328
|
+
locusInfo.updateSelf(self);
|
1329
1329
|
|
1330
1330
|
locusInfo.emitScoped = sinon.stub();
|
1331
1331
|
|
1332
|
-
locusInfo.updateSelf(selfClone
|
1332
|
+
locusInfo.updateSelf(selfClone);
|
1333
1333
|
|
1334
1334
|
assert.neverCalledWith(
|
1335
1335
|
locusInfo.emitScoped,
|
@@ -1348,11 +1348,11 @@ describe('plugin-meetings', () => {
|
|
1348
1348
|
selfClone.canNotViewTheParticipantList = true; // different
|
1349
1349
|
|
1350
1350
|
// Set the layout prior to stubbing to validate it does not change.
|
1351
|
-
locusInfo.updateSelf(self
|
1351
|
+
locusInfo.updateSelf(self);
|
1352
1352
|
|
1353
1353
|
locusInfo.emitScoped = sinon.stub();
|
1354
1354
|
|
1355
|
-
locusInfo.updateSelf(selfClone
|
1355
|
+
locusInfo.updateSelf(selfClone);
|
1356
1356
|
|
1357
1357
|
assert.calledWith(
|
1358
1358
|
locusInfo.emitScoped,
|
@@ -1371,11 +1371,11 @@ describe('plugin-meetings', () => {
|
|
1371
1371
|
selfClone.isSharingBlocked = false; // same
|
1372
1372
|
|
1373
1373
|
// Set the layout prior to stubbing to validate it does not change.
|
1374
|
-
locusInfo.updateSelf(self
|
1374
|
+
locusInfo.updateSelf(self);
|
1375
1375
|
|
1376
1376
|
locusInfo.emitScoped = sinon.stub();
|
1377
1377
|
|
1378
|
-
locusInfo.updateSelf(selfClone
|
1378
|
+
locusInfo.updateSelf(selfClone);
|
1379
1379
|
|
1380
1380
|
assert.neverCalledWith(
|
1381
1381
|
locusInfo.emitScoped,
|
@@ -1394,11 +1394,11 @@ describe('plugin-meetings', () => {
|
|
1394
1394
|
selfClone.isSharingBlocked = true; // different
|
1395
1395
|
|
1396
1396
|
// Set the layout prior to stubbing to validate it does not change.
|
1397
|
-
locusInfo.updateSelf(self
|
1397
|
+
locusInfo.updateSelf(self);
|
1398
1398
|
|
1399
1399
|
locusInfo.emitScoped = sinon.stub();
|
1400
1400
|
|
1401
|
-
locusInfo.updateSelf(selfClone
|
1401
|
+
locusInfo.updateSelf(selfClone);
|
1402
1402
|
|
1403
1403
|
assert.calledWith(
|
1404
1404
|
locusInfo.emitScoped,
|
@@ -1412,12 +1412,12 @@ describe('plugin-meetings', () => {
|
|
1412
1412
|
});
|
1413
1413
|
|
1414
1414
|
it('should trigger SELF_ROLES_CHANGED if self roles changed', () => {
|
1415
|
-
locusInfo.self
|
1415
|
+
locusInfo.updateSelf(self);
|
1416
1416
|
locusInfo.emitScoped = sinon.stub();
|
1417
1417
|
const sampleNewSelf = cloneDeep(self);
|
1418
1418
|
sampleNewSelf.controls.role.roles = [{type: 'COHOST', hasRole: true}];
|
1419
1419
|
|
1420
|
-
locusInfo.updateSelf(sampleNewSelf
|
1420
|
+
locusInfo.updateSelf(sampleNewSelf);
|
1421
1421
|
|
1422
1422
|
assert.calledWith(
|
1423
1423
|
locusInfo.emitScoped,
|
@@ -1431,12 +1431,12 @@ describe('plugin-meetings', () => {
|
|
1431
1431
|
});
|
1432
1432
|
|
1433
1433
|
it('should not trigger SELF_ROLES_CHANGED if self roles not changed', () => {
|
1434
|
-
locusInfo.self
|
1434
|
+
locusInfo.updateSelf(self);
|
1435
1435
|
locusInfo.emitScoped = sinon.stub();
|
1436
1436
|
const sampleNewSelf = cloneDeep(self);
|
1437
1437
|
sampleNewSelf.controls.role.roles = [{type: 'PRESENTER', hasRole: true}];
|
1438
1438
|
|
1439
|
-
locusInfo.updateSelf(sampleNewSelf
|
1439
|
+
locusInfo.updateSelf(sampleNewSelf);
|
1440
1440
|
|
1441
1441
|
assert.neverCalledWith(
|
1442
1442
|
locusInfo.emitScoped,
|
@@ -1450,12 +1450,12 @@ describe('plugin-meetings', () => {
|
|
1450
1450
|
});
|
1451
1451
|
|
1452
1452
|
it('should trigger SELF_MEETING_INTERPRETATION_CHANGED if self interpretation info changed', () => {
|
1453
|
-
locusInfo.self
|
1453
|
+
locusInfo.updateSelf(self);
|
1454
1454
|
locusInfo.emitScoped = sinon.stub();
|
1455
1455
|
const sampleNewSelf = cloneDeep(self);
|
1456
1456
|
sampleNewSelf.controls.interpretation.targetLanguage = 'it';
|
1457
1457
|
|
1458
|
-
locusInfo.updateSelf(sampleNewSelf
|
1458
|
+
locusInfo.updateSelf(sampleNewSelf);
|
1459
1459
|
|
1460
1460
|
assert.calledWith(
|
1461
1461
|
locusInfo.emitScoped,
|
@@ -1472,12 +1472,12 @@ describe('plugin-meetings', () => {
|
|
1472
1472
|
});
|
1473
1473
|
|
1474
1474
|
it('should not trigger SELF_MEETING_INTERPRETATION_CHANGED if self interpretation info not changed', () => {
|
1475
|
-
locusInfo.self
|
1475
|
+
locusInfo.updateSelf(self);
|
1476
1476
|
locusInfo.emitScoped = sinon.stub();
|
1477
1477
|
const sampleNewSelf = cloneDeep(self);
|
1478
1478
|
sampleNewSelf.controls.interpretation.targetLanguage = 'cn'; // same with previous one
|
1479
1479
|
|
1480
|
-
locusInfo.updateSelf(sampleNewSelf
|
1480
|
+
locusInfo.updateSelf(sampleNewSelf);
|
1481
1481
|
|
1482
1482
|
assert.neverCalledWith(
|
1483
1483
|
locusInfo.emitScoped,
|
@@ -1494,12 +1494,12 @@ describe('plugin-meetings', () => {
|
|
1494
1494
|
});
|
1495
1495
|
|
1496
1496
|
it('should not trigger any events if controls is undefined', () => {
|
1497
|
-
locusInfo.self
|
1497
|
+
locusInfo.updateSelf(self);
|
1498
1498
|
locusInfo.emitScoped = sinon.stub();
|
1499
1499
|
const newSelf = cloneDeep(self);
|
1500
1500
|
newSelf.controls = undefined;
|
1501
1501
|
|
1502
|
-
locusInfo.updateSelf(newSelf
|
1502
|
+
locusInfo.updateSelf(newSelf);
|
1503
1503
|
|
1504
1504
|
const eventsSet = new Set([
|
1505
1505
|
LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED,
|
@@ -1516,6 +1516,31 @@ describe('plugin-meetings', () => {
|
|
1516
1516
|
assert.isFalse(eventsSet.has(eventName));
|
1517
1517
|
});
|
1518
1518
|
});
|
1519
|
+
|
1520
|
+
it('calls getSelves with correct parameters', () => {
|
1521
|
+
const getSelvesStub = sinon.stub(SelfUtils, 'getSelves').returns({
|
1522
|
+
current: {},
|
1523
|
+
previous: {},
|
1524
|
+
updates: {},
|
1525
|
+
});
|
1526
|
+
|
1527
|
+
locusInfo.webex.internal.device.url = self.deviceUrl;
|
1528
|
+
locusInfo.participants = [{id: '1'}, {id: '2'}];
|
1529
|
+
locusInfo.parsedLocus.self = {id: 'fake parsed locus self id'};
|
1530
|
+
|
1531
|
+
const parsedLocusSelf = locusInfo.parsedLocus.self; // need to store it before it's updated in updateSelf
|
1532
|
+
locusInfo.updateSelf(self);
|
1533
|
+
|
1534
|
+
assert.calledWith(
|
1535
|
+
getSelvesStub,
|
1536
|
+
parsedLocusSelf,
|
1537
|
+
self,
|
1538
|
+
locusInfo.webex.internal.device.url,
|
1539
|
+
locusInfo.participants
|
1540
|
+
);
|
1541
|
+
|
1542
|
+
getSelvesStub.restore();
|
1543
|
+
});
|
1519
1544
|
});
|
1520
1545
|
|
1521
1546
|
describe('#updateMeetingInfo', () => {
|
@@ -1782,11 +1807,11 @@ describe('plugin-meetings', () => {
|
|
1782
1807
|
});
|
1783
1808
|
|
1784
1809
|
it('should update media shares and emit LOCUS_INFO_UPDATE_MEDIA_SHARES when mediaShares change', () => {
|
1785
|
-
const initialMediaShares = {
|
1786
|
-
const newMediaShares = {
|
1810
|
+
const initialMediaShares = {audio: true, video: false};
|
1811
|
+
const newMediaShares = {audio: false, video: true};
|
1787
1812
|
|
1788
1813
|
locusInfo.mediaShares = initialMediaShares;
|
1789
|
-
locusInfo.parsedLocus = {
|
1814
|
+
locusInfo.parsedLocus = {mediaShares: null};
|
1790
1815
|
|
1791
1816
|
const parsedMediaShares = {
|
1792
1817
|
current: newMediaShares,
|
@@ -1823,9 +1848,9 @@ describe('plugin-meetings', () => {
|
|
1823
1848
|
});
|
1824
1849
|
|
1825
1850
|
it('should force update media shares and emit LOCUS_INFO_UPDATE_MEDIA_SHARES even if shares are the same', () => {
|
1826
|
-
const initialMediaShares = {
|
1851
|
+
const initialMediaShares = {audio: true, video: false};
|
1827
1852
|
locusInfo.mediaShares = initialMediaShares;
|
1828
|
-
locusInfo.parsedLocus = {
|
1853
|
+
locusInfo.parsedLocus = {mediaShares: null};
|
1829
1854
|
|
1830
1855
|
const parsedMediaShares = {
|
1831
1856
|
current: initialMediaShares,
|
@@ -1857,7 +1882,7 @@ describe('plugin-meetings', () => {
|
|
1857
1882
|
});
|
1858
1883
|
|
1859
1884
|
it('should not emit LOCUS_INFO_UPDATE_MEDIA_SHARES if mediaShares do not change and forceUpdate is false', () => {
|
1860
|
-
const initialMediaShares = {
|
1885
|
+
const initialMediaShares = {audio: true, video: false};
|
1861
1886
|
locusInfo.mediaShares = initialMediaShares;
|
1862
1887
|
|
1863
1888
|
// Call the function with the same mediaShares and forceUpdate = false
|
@@ -1871,11 +1896,11 @@ describe('plugin-meetings', () => {
|
|
1871
1896
|
});
|
1872
1897
|
|
1873
1898
|
it('should update internal state correctly when mediaShares are updated', () => {
|
1874
|
-
const initialMediaShares = {
|
1875
|
-
const newMediaShares = {
|
1899
|
+
const initialMediaShares = {audio: true, video: false};
|
1900
|
+
const newMediaShares = {audio: false, video: true};
|
1876
1901
|
|
1877
1902
|
locusInfo.mediaShares = initialMediaShares;
|
1878
|
-
locusInfo.parsedLocus = {
|
1903
|
+
locusInfo.parsedLocus = {mediaShares: null};
|
1879
1904
|
|
1880
1905
|
const parsedMediaShares = {
|
1881
1906
|
current: newMediaShares,
|
@@ -2414,6 +2439,21 @@ describe('plugin-meetings', () => {
|
|
2414
2439
|
locusInfo.onDeltaLocus(fakeLocus);
|
2415
2440
|
assert.calledWith(locusInfo.updateParticipants, {}, true);
|
2416
2441
|
});
|
2442
|
+
|
2443
|
+
it('onDeltaLocus merges delta participants with existing participants', () => {
|
2444
|
+
const FAKE_DELTA_PARTICIPANTS = [
|
2445
|
+
{id: '1111'}, {id: '2222'}
|
2446
|
+
]
|
2447
|
+
fakeLocus.participants = FAKE_DELTA_PARTICIPANTS;
|
2448
|
+
|
2449
|
+
sinon.spy(locusInfo, 'mergeParticipants');
|
2450
|
+
locusInfo.updateParticipants = sinon.stub();
|
2451
|
+
const existingParticipants = locusInfo.participants;
|
2452
|
+
|
2453
|
+
locusInfo.onDeltaLocus(fakeLocus);
|
2454
|
+
assert.calledOnceWithExactly(locusInfo.mergeParticipants, existingParticipants, FAKE_DELTA_PARTICIPANTS);
|
2455
|
+
assert.calledWith(locusInfo.updateParticipants, FAKE_DELTA_PARTICIPANTS, false);
|
2456
|
+
});
|
2417
2457
|
});
|
2418
2458
|
|
2419
2459
|
describe('#updateLocusCache', () => {
|