@webex/plugin-meetings 2.30.2 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,6 @@ import {assert} from '@webex/test-helper-chai';
9
9
  import MockWebex from '@webex/test-helper-mock-webex';
10
10
  import sinon from 'sinon';
11
11
  import uuid from 'uuid';
12
-
13
12
  import StaticConfig from '@webex/plugin-meetings/src/common/config';
14
13
  import TriggerProxy from '@webex/plugin-meetings/src/common/events/trigger-proxy';
15
14
  import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
@@ -27,7 +26,9 @@ import {
27
26
  LOCUSEVENT,
28
27
  OFFLINE,
29
28
  ONLINE,
30
- ROAP
29
+ ROAP,
30
+ LOCUSINFO,
31
+ EVENT_TRIGGERS
31
32
  } from '../../../../src/constants';
32
33
 
33
34
  describe('plugin-meetings', () => {
@@ -1110,5 +1111,84 @@ describe('plugin-meetings', () => {
1110
1111
  });
1111
1112
  });
1112
1113
  });
1114
+
1115
+ describe('#setupLocusControlListeners', () => {
1116
+ let meeting;
1117
+
1118
+ beforeEach(async () => {
1119
+ MediaUtil.createPeerConnection = sinon.stub().returns(true);
1120
+ webex.internal.device.userId = uuid1;
1121
+ webex.internal.device.url = url1;
1122
+ MeetingCollection.set = sinon.stub().returns(true);
1123
+ MeetingsUtil.getMeetingAddedType = sinon.stub().returns('test meeting added type');
1124
+ TriggerProxy.trigger.reset();
1125
+ // clock = sinon.useFakeTimers();
1126
+ // setTimeoutSpy = sinon.spy(clock, 'setTimeout');
1127
+ webex.meetings.meetingInfo.fetchMeetingInfo = sinon.stub().returns(Promise.resolve({
1128
+ body: {
1129
+ permissionToken: 'PT', meetingJoinUrl: 'meetingJoinUrl'
1130
+ }
1131
+ }));
1132
+
1133
+ meeting = await webex.meetings.createMeeting('test destination', 'test type');
1134
+
1135
+ TriggerProxy.trigger.reset();
1136
+ });
1137
+
1138
+ it('triggers correct event when CONTROLS_ENTRY_EXIT_TONE_UPDATED emitted', async () => {
1139
+ await meeting.locusInfo.emitScoped(
1140
+ {},
1141
+ LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED,
1142
+ {entryExitTone: 'foo'}
1143
+ );
1144
+
1145
+ assert.calledOnce(TriggerProxy.trigger);
1146
+ assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meeting),
1147
+ {
1148
+ file: 'meeting/index',
1149
+ function: 'setupLocusControlsListener'
1150
+ },
1151
+ EVENT_TRIGGERS.MEETING_ENTRY_EXIT_TONE_UPDATE,
1152
+ {entryExitTone: 'foo'});
1153
+ });
1154
+
1155
+ const checkSelfTrigger = async (inEvent, outEvent) => {
1156
+ await meeting.locusInfo.emitScoped(
1157
+ {},
1158
+ inEvent,
1159
+ {foo: 'bar'}
1160
+ );
1161
+
1162
+ assert.calledOnce(TriggerProxy.trigger);
1163
+ assert.calledWith(TriggerProxy.trigger, sinon.match.instanceOf(Meeting),
1164
+ {
1165
+ file: 'meeting/index',
1166
+ function: 'setUpLocusInfoSelfListener'
1167
+ },
1168
+ outEvent,
1169
+ {payload: {foo: 'bar'}});
1170
+ };
1171
+
1172
+ it('triggers correct event when SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE emitted', async () => {
1173
+ checkSelfTrigger(
1174
+ LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE,
1175
+ EVENT_TRIGGERS.MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST
1176
+ );
1177
+ });
1178
+
1179
+ it('triggers correct event when SELF_IS_SHARING_BLOCKED_CHANGE emitted', async () => {
1180
+ checkSelfTrigger(
1181
+ LOCUSINFO.EVENTS.SELF_IS_SHARING_BLOCKED_CHANGE,
1182
+ EVENT_TRIGGERS.MEETING_SELF_IS_SHARING_BLOCKED
1183
+ );
1184
+ });
1185
+
1186
+ it('triggers correct event when LOCAL_UNMUTE_REQUESTED emitted', async () => {
1187
+ checkSelfTrigger(
1188
+ LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUESTED,
1189
+ EVENT_TRIGGERS.MEETING_SELF_REQUESTED_TO_UNMUTE
1190
+ );
1191
+ });
1192
+ });
1113
1193
  });
1114
1194
  });