@webex/plugin-meetings 3.0.0-beta.182 → 3.0.0-beta.183

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.
@@ -5531,25 +5531,27 @@ describe('plugin-meetings', () => {
5531
5531
 
5532
5532
  checkParseMeetingInfo(expectedInfoToParse);
5533
5533
  });
5534
- it('should set hostSIEnabled correctly depend on the toggle statue in site setting', () => {
5535
- const updateHostSIEnabledSpy = sinon.spy(meeting.simultaneousInterpretation, 'updateHostSIEnabled');
5534
+ it('should parse interpretation info correctly', () => {
5535
+ const parseInterpretationInfo = sinon.spy(MeetingUtil, 'parseInterpretationInfo');
5536
5536
  const mockToggleOnData = {
5537
5537
  body: {
5538
5538
  meetingSiteSetting: {
5539
5539
  enableHostInterpreterControlSI: true,
5540
+ },
5541
+ turnOnSimultaneousInterpretation: true,
5542
+ simultaneousInterpretation: {
5543
+ currentSIInterpreter: false,
5544
+ siLanguages: [
5545
+ {
5546
+ languageCode: "ar",
5547
+ languageGroupId: 4,
5548
+ },
5549
+ ]
5540
5550
  }
5541
5551
  }
5542
5552
  };
5543
5553
  meeting.parseMeetingInfo(mockToggleOnData);
5544
- assert.calledWith(updateHostSIEnabledSpy, true);
5545
-
5546
- const mockToggleOffData = {
5547
- body: {
5548
- meetingSiteSetting: {}
5549
- }
5550
- };
5551
- meeting.parseMeetingInfo(mockToggleOffData);
5552
- assert.calledWith(updateHostSIEnabledSpy, false);
5554
+ assert.calledOnceWithExactly(parseInterpretationInfo, meeting, mockToggleOnData.body);
5553
5555
  });
5554
5556
  });
5555
5557
 
@@ -740,5 +740,67 @@ describe('plugin-meetings', () => {
740
740
  assert.deepEqual(MeetingUtil.isBreakoutPreassignmentsEnabled([]), true);
741
741
  });
742
742
  });
743
+
744
+
745
+ describe('parseInterpretationInfo', () => {
746
+ let meetingInfo = {};
747
+ beforeEach(() => {
748
+ meeting.simultaneousInterpretation = {
749
+ updateMeetingSIEnabled: sinon.stub(),
750
+ updateHostSIEnabled: sinon.stub(),
751
+ updateInterpretation: sinon.stub(),
752
+ siLanguages: [],
753
+ };
754
+ });
755
+ it('should update simultaneous interpretation settings with SI and host enabled', () => {
756
+ meetingInfo.turnOnSimultaneousInterpretation = true;
757
+ meetingInfo.meetingSiteSetting = {
758
+ enableHostInterpreterControlSI: true,
759
+ };
760
+ meetingInfo.simultaneousInterpretation = {
761
+ currentSIInterpreter: true,
762
+ siLanguages: [
763
+ { languageCode: 'en', languageGroupId: 1 },
764
+ { languageCode: 'es', languageGroupId: 2 },
765
+ ],
766
+ };
767
+
768
+ MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
769
+ assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, true);
770
+ assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, true);
771
+ assert.calledWith(meeting.simultaneousInterpretation.updateInterpretation, [
772
+ { languageName: 'en', languageCode: 1 },
773
+ { languageName: 'es', languageCode: 2 },
774
+ ]);
775
+ });
776
+
777
+ it('should update simultaneous interpretation settings with host SI disabled', () => {
778
+ meetingInfo.meetingSiteSetting.enableHostInterpreterControlSI = false;
779
+ meetingInfo.simultaneousInterpretation.currentSIInterpreter = false;
780
+ MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
781
+ assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, false);
782
+ assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, false);
783
+ assert.calledWith(meeting.simultaneousInterpretation.updateInterpretation, [
784
+ { languageName: 'en', languageCode: 1 },
785
+ { languageName: 'es', languageCode: 2 },
786
+ ]);
787
+ });
788
+ it('should update simultaneous interpretation settings with SI disabled', () => {
789
+ meetingInfo.turnOnSimultaneousInterpretation = false;
790
+ MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
791
+ assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, false, false);
792
+ assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, false);
793
+ });
794
+
795
+ it('should not update simultaneous interpretation settings for invalid input', () => {
796
+ // Call the function with invalid inputs
797
+ MeetingUtil.parseInterpretationInfo(null, null);
798
+
799
+ // Ensure that the update functions are not called
800
+ assert.notCalled(meeting.simultaneousInterpretation.updateMeetingSIEnabled);
801
+ assert.notCalled(meeting.simultaneousInterpretation.updateHostSIEnabled);
802
+ assert.notCalled(meeting.simultaneousInterpretation.updateInterpretation);
803
+ });
804
+ });
743
805
  });
744
806
  });
@@ -1085,7 +1085,7 @@ describe('plugin-meetings', () => {
1085
1085
  assert.calledOnce(webex.meetings.meetingInfo.fetchMeetingInfo);
1086
1086
  assert.calledOnce(MeetingsUtil.getMeetingAddedType);
1087
1087
  assert.notCalled(setTimeoutSpy);
1088
- assert.calledThrice(TriggerProxy.trigger);
1088
+ assert.callCount(TriggerProxy.trigger, 4);
1089
1089
  assert.calledWith(webex.meetings.meetingInfo.fetchMeetingInfo, destination, type, null, null, undefined, undefined, extraParams, {meetingId: meeting.id});
1090
1090
  assert.calledWith(MeetingsUtil.getMeetingAddedType, 'test type');
1091
1091