@webex/calling 3.12.0-next.100 → 3.12.0-next.102

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.
@@ -12,6 +12,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
12
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
13
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
14
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
15
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
15
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
16
17
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
17
18
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
@@ -438,9 +439,24 @@ describe('CallingClient Tests', function () {
438
439
  });
439
440
  describe('Mobius Server discovery tests', function () {
440
441
  var callingClient;
442
+ var defaultMobiusServiceUrl = webex.internal.services._serviceUrls.mobius;
443
+ var usMobiusServiceLink = 'https://mobius-us-east-1.prod.infra.webex.com/api/v1';
444
+ var usRegionPayload = {
445
+ statusCode: 200,
446
+ body: _objectSpread(_objectSpread({}, _callingClientFixtures.regionBody), {}, {
447
+ clientRegion: 'US-EAST',
448
+ countryCode: 'US',
449
+ regionCode: 'US-EAST'
450
+ })
451
+ };
452
+ var networkBlockedPayload = {
453
+ statusCode: 500
454
+ };
441
455
  afterEach(function () {
442
456
  jest.clearAllTimers();
443
457
  jest.clearAllMocks();
458
+ webex.internal.services._serviceUrls.mobius = defaultMobiusServiceUrl;
459
+ webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockUSServiceHosts);
444
460
  callingClient.removeAllListeners();
445
461
  callManager.removeAllListeners();
446
462
  callingClient = undefined;
@@ -552,84 +568,266 @@ describe('CallingClient Tests', function () {
552
568
  }
553
569
  }, _callee15);
554
570
  })));
571
+ it('US account connects using the U2C serviceLinks mobius URL and does not query catalog clusters', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
572
+ var requestedUris;
573
+ return _regenerator.default.wrap(function (_context16) {
574
+ while (1) switch (_context16.prev = _context16.next) {
575
+ case 0:
576
+ webex.internal.services._serviceUrls.mobius = usMobiusServiceLink;
577
+ webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockUSServiceHosts);
578
+ webex.request.mockResolvedValueOnce(usRegionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
579
+ _context16.next = 1;
580
+ return (0, _CallingClient.createClient)(webex, {
581
+ logger: {
582
+ level: _types.LOGGER.INFO
583
+ }
584
+ });
585
+ case 1:
586
+ callingClient = _context16.sent;
587
+ expect(webex.request).toBeCalledTimes(2);
588
+ expect(callingClient['mobiusHost']).toBe(usMobiusServiceLink);
589
+ expect(webex.request).nthCalledWith(2, _objectSpread(_objectSpread({
590
+ method: 'GET'
591
+ }, (0, _testUtil.getMockRequestTemplate)()), {}, {
592
+ uri: "".concat(usMobiusServiceLink).concat(_constants.URL_ENDPOINT, "?regionCode=US-EAST&countryCode=US")
593
+ }));
594
+ requestedUris = webex.request.mock.calls.map(function (_ref17) {
595
+ var _ref18 = (0, _slicedToArray2.default)(_ref17, 1),
596
+ uri = _ref18[0].uri;
597
+ return uri;
598
+ });
599
+ expect(requestedUris.some(function (uri) {
600
+ return uri === null || uri === void 0 ? void 0 : uri.includes('mobius-eu-central-1');
601
+ })).toBe(false);
602
+ expect(requestedUris.some(function (uri) {
603
+ return uri === null || uri === void 0 ? void 0 : uri.includes('mobius-ca-central-1');
604
+ })).toBe(false);
605
+ expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
606
+ case 2:
607
+ case "end":
608
+ return _context16.stop();
609
+ }
610
+ }, _callee16);
611
+ })));
612
+ it('SDK config for a different region still uses the U2C mobius link as host and connects to the config cluster', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
613
+ var euDiscoveryPayload;
614
+ return _regenerator.default.wrap(function (_context17) {
615
+ while (1) switch (_context17.prev = _context17.next) {
616
+ case 0:
617
+ webex.internal.services._serviceUrls.mobius = usMobiusServiceLink;
618
+ webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockUSServiceHosts);
619
+ euDiscoveryPayload = {
620
+ statusCode: 200,
621
+ body: {
622
+ primary: {
623
+ region: 'EU-CENTRAL',
624
+ uris: ['https://mobius-fra.webex.com/api/v1']
625
+ },
626
+ backup: {
627
+ region: 'EU-WEST',
628
+ uris: ['https://mobius-lon.webex.com/api/v1']
629
+ }
630
+ }
631
+ };
632
+ webex.request.mockResolvedValueOnce(euDiscoveryPayload);
633
+ _context17.next = 1;
634
+ return (0, _CallingClient.createClient)(webex, {
635
+ discovery: {
636
+ region: 'EU-CENTRAL',
637
+ country: 'DE'
638
+ },
639
+ logger: {
640
+ level: _types.LOGGER.INFO
641
+ }
642
+ });
643
+ case 1:
644
+ callingClient = _context17.sent;
645
+ expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({
646
+ method: 'GET'
647
+ }, (0, _testUtil.getMockRequestTemplate)()), {}, {
648
+ uri: "".concat(usMobiusServiceLink).concat(_constants.URL_ENDPOINT, "?regionCode=EU-CENTRAL&countryCode=DE")
649
+ }));
650
+ expect(callingClient['mobiusHost']).toBe(usMobiusServiceLink);
651
+ expect(callingClient.primaryMobiusUris).toEqual(['https://mobius-fra.webex.com/api/v1/calling/web/']);
652
+ expect(handleErrorSpy).not.toHaveBeenCalled();
653
+ case 2:
654
+ case "end":
655
+ return _context17.stop();
656
+ }
657
+ }, _callee17);
658
+ })));
659
+ it('when the U2C service link has no region, discovery uses SDK config region and country', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
660
+ var regionlessServiceLink, apDiscoveryPayload, requestedUris;
661
+ return _regenerator.default.wrap(function (_context18) {
662
+ while (1) switch (_context18.prev = _context18.next) {
663
+ case 0:
664
+ regionlessServiceLink = 'https://mobius.webex.com/api/v1';
665
+ webex.internal.services._serviceUrls.mobius = regionlessServiceLink;
666
+ webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockUSServiceHosts);
667
+ apDiscoveryPayload = {
668
+ statusCode: 200,
669
+ body: {
670
+ primary: {
671
+ region: 'AP-SOUTHEAST',
672
+ uris: ['https://mobius-sin.webex.com/api/v1']
673
+ },
674
+ backup: {
675
+ region: 'AP-NORTHEAST',
676
+ uris: ['https://mobius-nrt.webex.com/api/v1']
677
+ }
678
+ }
679
+ };
680
+ webex.request.mockResolvedValueOnce(apDiscoveryPayload);
681
+ _context18.next = 1;
682
+ return (0, _CallingClient.createClient)(webex, {
683
+ discovery: {
684
+ region: 'AP-SOUTHEAST',
685
+ country: 'SG'
686
+ },
687
+ logger: {
688
+ level: _types.LOGGER.INFO
689
+ }
690
+ });
691
+ case 1:
692
+ callingClient = _context18.sent;
693
+ requestedUris = webex.request.mock.calls.map(function (_ref21) {
694
+ var _ref22 = (0, _slicedToArray2.default)(_ref21, 1),
695
+ uri = _ref22[0].uri;
696
+ return uri;
697
+ });
698
+ expect(requestedUris.some(function (uri) {
699
+ return uri === null || uri === void 0 ? void 0 : uri.includes(_constants.DISCOVERY_URL);
700
+ })).toBe(false);
701
+ expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({
702
+ method: 'GET'
703
+ }, (0, _testUtil.getMockRequestTemplate)()), {}, {
704
+ uri: "".concat(regionlessServiceLink).concat(_constants.URL_ENDPOINT, "?regionCode=AP-SOUTHEAST&countryCode=SG")
705
+ }));
706
+ expect(callingClient['mobiusHost']).toBe(regionlessServiceLink);
707
+ expect(callingClient.primaryMobiusUris).toEqual(['https://mobius-sin.webex.com/api/v1/calling/web/']);
708
+ case 2:
709
+ case "end":
710
+ return _context18.stop();
711
+ }
712
+ }, _callee18);
713
+ })));
714
+ it('when the primary U2C mobius link is blocked, discovery walks remaining catalog clusters', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
715
+ return _regenerator.default.wrap(function (_context19) {
716
+ while (1) switch (_context19.prev = _context19.next) {
717
+ case 0:
718
+ webex.internal.services._serviceUrls.mobius = usMobiusServiceLink;
719
+ webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockUSServiceHosts);
720
+ webex.request.mockResolvedValueOnce(usRegionPayload).mockRejectedValueOnce(networkBlockedPayload).mockRejectedValueOnce(networkBlockedPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
721
+ _context19.next = 1;
722
+ return (0, _CallingClient.createClient)(webex, {
723
+ logger: {
724
+ level: _types.LOGGER.INFO
725
+ }
726
+ });
727
+ case 1:
728
+ callingClient = _context19.sent;
729
+ expect(webex.request).toBeCalledTimes(4);
730
+ expect(webex.request).nthCalledWith(2, _objectSpread(_objectSpread({
731
+ method: 'GET'
732
+ }, (0, _testUtil.getMockRequestTemplate)()), {}, {
733
+ uri: "".concat(usMobiusServiceLink).concat(_constants.URL_ENDPOINT, "?regionCode=US-EAST&countryCode=US")
734
+ }));
735
+ expect(webex.request).nthCalledWith(3, _objectSpread(_objectSpread({
736
+ method: 'GET'
737
+ }, (0, _testUtil.getMockRequestTemplate)()), {}, {
738
+ uri: "https://mobius-ca-central-1.prod.infra.webex.com/api/v1".concat(_constants.URL_ENDPOINT, "?regionCode=US-EAST&countryCode=US")
739
+ }));
740
+ expect(webex.request).nthCalledWith(4, _objectSpread(_objectSpread({
741
+ method: 'GET'
742
+ }, (0, _testUtil.getMockRequestTemplate)()), {}, {
743
+ uri: "https://mobius-eu-central-1.prod.infra.webex.com/api/v1".concat(_constants.URL_ENDPOINT, "?regionCode=US-EAST&countryCode=US")
744
+ }));
745
+ expect(callingClient['mobiusHost']).toBe('https://mobius-eu-central-1.prod.infra.webex.com/api/v1');
746
+ expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
747
+ case 2:
748
+ case "end":
749
+ return _context19.stop();
750
+ }
751
+ }, _callee19);
752
+ })));
555
753
  });
556
754
  describe('Testing each cluster present withing host catalog', function () {
557
755
  var mobiusCluster = ['mobius-eu-central-1.prod.infra.webex.com', 'mobius-us-east-1.int.infra.webex.com', 'mobius-eu-central-1.int.infra.webex.com'];
558
756
  var checkCluster = /*#__PURE__*/function () {
559
- var _ref16 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(mockServiceHosts, mockCatalog) {
757
+ var _ref24 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20(mockServiceHosts, mockCatalog) {
560
758
  var callingClient;
561
- return _regenerator.default.wrap(function (_context16) {
562
- while (1) switch (_context16.prev = _context16.next) {
759
+ return _regenerator.default.wrap(function (_context20) {
760
+ while (1) switch (_context20.prev = _context20.next) {
563
761
  case 0:
564
762
  webex.internal.services._hostCatalog = mockCatalog;
565
763
  webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(mockServiceHosts);
566
- _context16.next = 1;
764
+ _context20.next = 1;
567
765
  return (0, _CallingClient.createClient)(webex, {
568
766
  logger: {
569
767
  level: _types.LOGGER.INFO
570
768
  }
571
769
  });
572
770
  case 1:
573
- callingClient = _context16.sent;
771
+ callingClient = _context20.sent;
574
772
  expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
575
773
  case 2:
576
774
  case "end":
577
- return _context16.stop();
775
+ return _context20.stop();
578
776
  }
579
- }, _callee16);
777
+ }, _callee20);
580
778
  }));
581
779
  return function checkCluster(_x, _x2) {
582
- return _ref16.apply(this, arguments);
780
+ return _ref24.apply(this, arguments);
583
781
  };
584
782
  }();
585
783
  it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
586
- var _ref17 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(clusterName) {
784
+ var _ref25 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21(clusterName) {
587
785
  var _t3;
588
- return _regenerator.default.wrap(function (_context17) {
589
- while (1) switch (_context17.prev = _context17.next) {
786
+ return _regenerator.default.wrap(function (_context21) {
787
+ while (1) switch (_context21.prev = _context21.next) {
590
788
  case 0:
591
789
  _t3 = clusterName;
592
- _context17.next = _t3 === 'mobius-eu-central-1.prod.infra.webex.com' ? 1 : _t3 === 'mobius-us-east-1.int.infra.webex.com' ? 2 : _t3 === 'mobius-eu-central-1.int.infra.webex.com' ? 3 : 4;
790
+ _context21.next = _t3 === 'mobius-eu-central-1.prod.infra.webex.com' ? 1 : _t3 === 'mobius-us-east-1.int.infra.webex.com' ? 2 : _t3 === 'mobius-eu-central-1.int.infra.webex.com' ? 3 : 4;
593
791
  break;
594
792
  case 1:
595
793
  checkCluster(_callingClientFixtures.mockEUServiceHosts, _callingClientFixtures.mockCatalogEU);
596
- return _context17.abrupt("continue", 5);
794
+ return _context21.abrupt("continue", 5);
597
795
  case 2:
598
796
  checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
599
- return _context17.abrupt("continue", 5);
797
+ return _context21.abrupt("continue", 5);
600
798
  case 3:
601
799
  checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
602
- return _context17.abrupt("continue", 5);
800
+ return _context21.abrupt("continue", 5);
603
801
  case 4:
604
- return _context17.abrupt("continue", 5);
802
+ return _context21.abrupt("continue", 5);
605
803
  case 5:
606
804
  case "end":
607
- return _context17.stop();
805
+ return _context21.stop();
608
806
  }
609
- }, _callee17);
807
+ }, _callee21);
610
808
  }));
611
809
  return function (_x3) {
612
- return _ref17.apply(this, arguments);
810
+ return _ref25.apply(this, arguments);
613
811
  };
614
812
  }());
615
813
  });
616
814
  describe('Line creation tests', function () {
617
815
  var callingClient;
618
816
  var line;
619
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
620
- return _regenerator.default.wrap(function (_context18) {
621
- while (1) switch (_context18.prev = _context18.next) {
817
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
818
+ return _regenerator.default.wrap(function (_context22) {
819
+ while (1) switch (_context22.prev = _context22.next) {
622
820
  case 0:
623
- _context18.next = 1;
821
+ _context22.next = 1;
624
822
  return (0, _CallingClient.createClient)(webex);
625
823
  case 1:
626
- callingClient = _context18.sent;
824
+ callingClient = _context22.sent;
627
825
  line = (0, _values.default)(callingClient.lineDict)[0];
628
826
  case 2:
629
827
  case "end":
630
- return _context18.stop();
828
+ return _context22.stop();
631
829
  }
632
- }, _callee18);
830
+ }, _callee22);
633
831
  })));
634
832
  afterEach(function () {
635
833
  jest.clearAllTimers();
@@ -656,18 +854,18 @@ describe('CallingClient Tests', function () {
656
854
  var backupHttp = ['https://backup.example.com/api/v1/calling/web/'];
657
855
  var primaryWss = ['wss://primary.example.com/api/v1/calling/web/'];
658
856
  var backupWss = ['wss://backup.example.com/api/v1/calling/web/'];
659
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
660
- return _regenerator.default.wrap(function (_context19) {
661
- while (1) switch (_context19.prev = _context19.next) {
857
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
858
+ return _regenerator.default.wrap(function (_context23) {
859
+ while (1) switch (_context23.prev = _context23.next) {
662
860
  case 0:
663
- _context19.next = 1;
861
+ _context23.next = 1;
664
862
  return (0, _CallingClient.createClient)(webex, {
665
863
  logger: {
666
864
  level: _types.LOGGER.INFO
667
865
  }
668
866
  });
669
867
  case 1:
670
- callingClient = _context19.sent;
868
+ callingClient = _context23.sent;
671
869
  callingClient.primaryMobiusUris = primaryHttp;
672
870
  callingClient.backupMobiusUris = backupHttp;
673
871
  lineCtorSpy = jest.spyOn(LineModule, 'default').mockImplementation(function () {
@@ -677,9 +875,9 @@ describe('CallingClient Tests', function () {
677
875
  });
678
876
  case 2:
679
877
  case "end":
680
- return _context19.stop();
878
+ return _context23.stop();
681
879
  }
682
- }, _callee19);
880
+ }, _callee23);
683
881
  })));
684
882
  afterEach(function () {
685
883
  lineCtorSpy.mockRestore();
@@ -746,25 +944,25 @@ describe('CallingClient Tests', function () {
746
944
  var connectSpy;
747
945
  var primaryWss = ['wss://primary-1.example.com/api/v1/calling/web/', 'wss://primary-2.example.com/api/v1/calling/web/'];
748
946
  var backupWss = ['wss://backup.example.com/api/v1/calling/web/'];
749
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
750
- return _regenerator.default.wrap(function (_context20) {
751
- while (1) switch (_context20.prev = _context20.next) {
947
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
948
+ return _regenerator.default.wrap(function (_context24) {
949
+ while (1) switch (_context24.prev = _context24.next) {
752
950
  case 0:
753
- _context20.next = 1;
951
+ _context24.next = 1;
754
952
  return (0, _CallingClient.createClient)(webex, {
755
953
  logger: {
756
954
  level: _types.LOGGER.INFO
757
955
  }
758
956
  });
759
957
  case 1:
760
- callingClient = _context20.sent;
958
+ callingClient = _context24.sent;
761
959
  connectSpy = jest.spyOn(callingClient['apiRequest'], 'connectToMobiusSocket');
762
960
  warnSpy.mockClear();
763
961
  case 2:
764
962
  case "end":
765
- return _context20.stop();
963
+ return _context24.stop();
766
964
  }
767
- }, _callee20);
965
+ }, _callee24);
768
966
  })));
769
967
  afterEach(function () {
770
968
  jest.clearAllMocks();
@@ -772,13 +970,13 @@ describe('CallingClient Tests', function () {
772
970
  callManager.removeAllListeners();
773
971
  callingClient = undefined;
774
972
  });
775
- it('skips the socket connection and warns when no primary WSS URIs are available', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
776
- return _regenerator.default.wrap(function (_context21) {
777
- while (1) switch (_context21.prev = _context21.next) {
973
+ it('skips the socket connection and warns when no primary WSS URIs are available', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
974
+ return _regenerator.default.wrap(function (_context25) {
975
+ while (1) switch (_context25.prev = _context25.next) {
778
976
  case 0:
779
977
  callingClient.primaryWssMobiusUris = [];
780
978
  callingClient.backupWssMobiusUris = backupWss;
781
- _context21.next = 1;
979
+ _context25.next = 1;
782
980
  return callingClient['connectToMobiusSocket']();
783
981
  case 1:
784
982
  expect(connectSpy).not.toHaveBeenCalled();
@@ -788,34 +986,34 @@ describe('CallingClient Tests', function () {
788
986
  });
789
987
  case 2:
790
988
  case "end":
791
- return _context21.stop();
989
+ return _context25.stop();
792
990
  }
793
- }, _callee21);
991
+ }, _callee25);
794
992
  })));
795
- it('connects using the first reachable primary WSS URI and stops on success', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
796
- return _regenerator.default.wrap(function (_context22) {
797
- while (1) switch (_context22.prev = _context22.next) {
993
+ it('connects using the first reachable primary WSS URI and stops on success', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
994
+ return _regenerator.default.wrap(function (_context26) {
995
+ while (1) switch (_context26.prev = _context26.next) {
798
996
  case 0:
799
997
  callingClient.primaryWssMobiusUris = primaryWss;
800
998
  connectSpy.mockResolvedValue(undefined);
801
- _context22.next = 1;
999
+ _context26.next = 1;
802
1000
  return callingClient['connectToMobiusSocket']();
803
1001
  case 1:
804
1002
  expect(connectSpy).toHaveBeenCalledTimes(1);
805
1003
  expect(connectSpy).toHaveBeenCalledWith(primaryWss[0]);
806
1004
  case 2:
807
1005
  case "end":
808
- return _context22.stop();
1006
+ return _context26.stop();
809
1007
  }
810
- }, _callee22);
1008
+ }, _callee26);
811
1009
  })));
812
- it('tries each primary WSS URI and warns when all attempts fail', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
813
- return _regenerator.default.wrap(function (_context23) {
814
- while (1) switch (_context23.prev = _context23.next) {
1010
+ it('tries each primary WSS URI and warns when all attempts fail', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1011
+ return _regenerator.default.wrap(function (_context27) {
1012
+ while (1) switch (_context27.prev = _context27.next) {
815
1013
  case 0:
816
1014
  callingClient.primaryWssMobiusUris = primaryWss;
817
1015
  connectSpy.mockRejectedValue(new Error('connect failed'));
818
- _context23.next = 1;
1016
+ _context27.next = 1;
819
1017
  return callingClient['connectToMobiusSocket']();
820
1018
  case 1:
821
1019
  expect(connectSpy).toHaveBeenCalledTimes(primaryWss.length);
@@ -827,25 +1025,25 @@ describe('CallingClient Tests', function () {
827
1025
  });
828
1026
  case 2:
829
1027
  case "end":
830
- return _context23.stop();
1028
+ return _context27.stop();
831
1029
  }
832
- }, _callee23);
1030
+ }, _callee27);
833
1031
  })));
834
- it('does not attempt backup WSS URIs when primary WSS URIs are absent', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
835
- return _regenerator.default.wrap(function (_context24) {
836
- while (1) switch (_context24.prev = _context24.next) {
1032
+ it('does not attempt backup WSS URIs when primary WSS URIs are absent', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1033
+ return _regenerator.default.wrap(function (_context28) {
1034
+ while (1) switch (_context28.prev = _context28.next) {
837
1035
  case 0:
838
1036
  callingClient.primaryWssMobiusUris = [];
839
1037
  callingClient.backupWssMobiusUris = backupWss;
840
- _context24.next = 1;
1038
+ _context28.next = 1;
841
1039
  return callingClient['connectToMobiusSocket']();
842
1040
  case 1:
843
1041
  expect(connectSpy).not.toHaveBeenCalled();
844
1042
  case 2:
845
1043
  case "end":
846
- return _context24.stop();
1044
+ return _context28.stop();
847
1045
  }
848
- }, _callee24);
1046
+ }, _callee28);
849
1047
  })));
850
1048
  });
851
1049
  describe('Connectivity and Mercury event handlers', function () {
@@ -858,24 +1056,24 @@ describe('CallingClient Tests', function () {
858
1056
  var restartRegisterSpy;
859
1057
  var registerSpy;
860
1058
  var metricSpy;
861
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
862
- return _regenerator.default.wrap(function (_context25) {
863
- while (1) switch (_context25.prev = _context25.next) {
1059
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1060
+ return _regenerator.default.wrap(function (_context29) {
1061
+ while (1) switch (_context29.prev = _context29.next) {
864
1062
  case 0:
865
1063
  jest.useFakeTimers();
866
1064
  webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload).mockResolvedValueOnce(_callingClientFixtures.registrationPayload);
867
1065
  windowEventSpy = jest.spyOn(window, 'addEventListener');
868
- _context25.next = 1;
1066
+ _context29.next = 1;
869
1067
  return (0, _CallingClient.createClient)(webex, {
870
1068
  logger: {
871
1069
  level: _types.LOGGER.INFO
872
1070
  }
873
1071
  });
874
1072
  case 1:
875
- callingClient = _context25.sent;
1073
+ callingClient = _context29.sent;
876
1074
  line = (0, _values.default)(callingClient.lineDict)[0];
877
1075
  reg = line.registration;
878
- _context25.next = 2;
1076
+ _context29.next = 2;
879
1077
  return line.register();
880
1078
  case 2:
881
1079
  deRegSpy = jest.spyOn(reg, 'deregister');
@@ -885,9 +1083,9 @@ describe('CallingClient Tests', function () {
885
1083
  metricSpy = jest.spyOn(callingClient['metricManager'], 'submitConnectionMetrics');
886
1084
  case 3:
887
1085
  case "end":
888
- return _context25.stop();
1086
+ return _context29.stop();
889
1087
  }
890
- }, _callee25);
1088
+ }, _callee29);
891
1089
  })));
892
1090
  afterEach(function () {
893
1091
  jest.clearAllTimers();
@@ -898,16 +1096,16 @@ describe('CallingClient Tests', function () {
898
1096
  callingClient = undefined;
899
1097
  jest.useRealTimers();
900
1098
  });
901
- it('window offline handler sets networkDown and clears keepalive when network is unreachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1099
+ it('window offline handler sets networkDown and clears keepalive when network is unreachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
902
1100
  var g, clearKeepaliveSpy, offlineCb;
903
- return _regenerator.default.wrap(function (_context26) {
904
- while (1) switch (_context26.prev = _context26.next) {
1101
+ return _regenerator.default.wrap(function (_context30) {
1102
+ while (1) switch (_context30.prev = _context30.next) {
905
1103
  case 0:
906
1104
  g = global;
907
1105
  g.fetch = jest.fn().mockRejectedValueOnce(new Error('network fail'));
908
1106
  clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
909
1107
  offlineCb = windowEventSpy.mock.calls[1][1];
910
- _context26.next = 1;
1108
+ _context30.next = 1;
911
1109
  return offlineCb();
912
1110
  case 1:
913
1111
  expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Network connectivity probe failed'), {
@@ -918,20 +1116,20 @@ describe('CallingClient Tests', function () {
918
1116
  expect(clearKeepaliveSpy).toHaveBeenCalled();
919
1117
  case 2:
920
1118
  case "end":
921
- return _context26.stop();
1119
+ return _context30.stop();
922
1120
  }
923
- }, _callee26);
1121
+ }, _callee30);
924
1122
  })));
925
- it('window offline handler does not clear keepalive when network is reachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1123
+ it('window offline handler does not clear keepalive when network is reachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
926
1124
  var g, clearKeepaliveSpy, offlineCb;
927
- return _regenerator.default.wrap(function (_context27) {
928
- while (1) switch (_context27.prev = _context27.next) {
1125
+ return _regenerator.default.wrap(function (_context31) {
1126
+ while (1) switch (_context31.prev = _context31.next) {
929
1127
  case 0:
930
1128
  g = global;
931
1129
  g.fetch = jest.fn().mockResolvedValueOnce({});
932
1130
  clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
933
1131
  offlineCb = windowEventSpy.mock.calls[1][1];
934
- _context27.next = 1;
1132
+ _context31.next = 1;
935
1133
  return offlineCb();
936
1134
  case 1:
937
1135
  expect(g.fetch).toHaveBeenCalledWith('https://www.google.com/generate_204', expect.any(Object));
@@ -939,17 +1137,17 @@ describe('CallingClient Tests', function () {
939
1137
  expect(clearKeepaliveSpy).not.toHaveBeenCalled();
940
1138
  case 2:
941
1139
  case "end":
942
- return _context27.stop();
1140
+ return _context31.stop();
943
1141
  }
944
- }, _callee27);
1142
+ }, _callee31);
945
1143
  })));
946
- it('window online handler sets networkUpTimestamp and logs', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1144
+ it('window online handler sets networkUpTimestamp and logs', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
947
1145
  var onlineCb;
948
- return _regenerator.default.wrap(function (_context28) {
949
- while (1) switch (_context28.prev = _context28.next) {
1146
+ return _regenerator.default.wrap(function (_context32) {
1147
+ while (1) switch (_context32.prev = _context32.next) {
950
1148
  case 0:
951
1149
  onlineCb = windowEventSpy.mock.calls[0][1];
952
- _context28.next = 1;
1150
+ _context32.next = 1;
953
1151
  return onlineCb();
954
1152
  case 1:
955
1153
  expect(callingClient['networkUpTimestamp']).toEqual(expect.any(String));
@@ -959,17 +1157,17 @@ describe('CallingClient Tests', function () {
959
1157
  });
960
1158
  case 2:
961
1159
  case "end":
962
- return _context28.stop();
1160
+ return _context32.stop();
963
1161
  }
964
- }, _callee28);
1162
+ }, _callee32);
965
1163
  })));
966
- it('mercury offline submits metrics and sets timestamp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1164
+ it('mercury offline submits metrics and sets timestamp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
967
1165
  var mercuryOfflineCb;
968
- return _regenerator.default.wrap(function (_context29) {
969
- while (1) switch (_context29.prev = _context29.next) {
1166
+ return _regenerator.default.wrap(function (_context33) {
1167
+ while (1) switch (_context33.prev = _context33.next) {
970
1168
  case 0:
971
1169
  mercuryOfflineCb = webex.internal.mercury.on.mock.calls[1][1];
972
- _context29.next = 1;
1170
+ _context33.next = 1;
973
1171
  return mercuryOfflineCb();
974
1172
  case 1:
975
1173
  expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Mercury down, waiting for connection to be up'), {
@@ -980,26 +1178,26 @@ describe('CallingClient Tests', function () {
980
1178
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_DOWN, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), '');
981
1179
  case 2:
982
1180
  case "end":
983
- return _context29.stop();
1181
+ return _context33.stop();
984
1182
  }
985
- }, _callee29);
1183
+ }, _callee33);
986
1184
  })));
987
- it('handles reconnection with no active calls after network flap, once mercury comes back up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1185
+ it('handles reconnection with no active calls after network flap, once mercury comes back up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
988
1186
  var handleConnectionRestoreSpy, mercuryOnlineCb;
989
- return _regenerator.default.wrap(function (_context30) {
990
- while (1) switch (_context30.prev = _context30.next) {
1187
+ return _regenerator.default.wrap(function (_context34) {
1188
+ while (1) switch (_context34.prev = _context34.next) {
991
1189
  case 0:
992
1190
  handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
993
1191
  callingClient['isNetworkDown'] = true;
994
1192
  callingClient['networkDownTimestamp'] = '2023-01-01T00:00:00.000Z';
995
1193
  callingClient['networkUpTimestamp'] = '2023-01-01T00:01:00.000Z';
996
1194
  mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
997
- _context30.next = 1;
1195
+ _context34.next = 1;
998
1196
  return mercuryOnlineCb();
999
1197
  case 1:
1000
1198
  // Run the interval once
1001
1199
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 100);
1002
- _context30.next = 2;
1200
+ _context34.next = 2;
1003
1201
  return flushPromises();
1004
1202
  case 2:
1005
1203
  expect(handleConnectionRestoreSpy).toHaveBeenCalledWith(true);
@@ -1015,14 +1213,14 @@ describe('CallingClient Tests', function () {
1015
1213
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, '2023-01-01T00:00:00.000Z', '2023-01-01T00:01:00.000Z');
1016
1214
  case 3:
1017
1215
  case "end":
1018
- return _context30.stop();
1216
+ return _context34.stop();
1019
1217
  }
1020
- }, _callee30);
1218
+ }, _callee34);
1021
1219
  })));
1022
- it('no reconnection for idle registration with no active calls after network flap, once mercury comes back up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1220
+ it('no reconnection for idle registration with no active calls after network flap, once mercury comes back up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1023
1221
  var handleConnectionRestoreSpy, mercuryOnlineCb;
1024
- return _regenerator.default.wrap(function (_context31) {
1025
- while (1) switch (_context31.prev = _context31.next) {
1222
+ return _regenerator.default.wrap(function (_context35) {
1223
+ while (1) switch (_context35.prev = _context35.next) {
1026
1224
  case 0:
1027
1225
  handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
1028
1226
  callingClient['isNetworkDown'] = true;
@@ -1030,12 +1228,12 @@ describe('CallingClient Tests', function () {
1030
1228
  callingClient['networkUpTimestamp'] = '2023-01-01T00:01:00.000Z';
1031
1229
  reg.setStatus(_types2.RegistrationStatus.IDLE);
1032
1230
  mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
1033
- _context31.next = 1;
1231
+ _context35.next = 1;
1034
1232
  return mercuryOnlineCb();
1035
1233
  case 1:
1036
1234
  // Run the interval once
1037
1235
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 100);
1038
- _context31.next = 2;
1236
+ _context35.next = 2;
1039
1237
  return flushPromises();
1040
1238
  case 2:
1041
1239
  expect(handleConnectionRestoreSpy).not.toHaveBeenCalledWith(true);
@@ -1051,14 +1249,14 @@ describe('CallingClient Tests', function () {
1051
1249
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, '2023-01-01T00:00:00.000Z', '2023-01-01T00:01:00.000Z');
1052
1250
  case 3:
1053
1251
  case "end":
1054
- return _context31.stop();
1252
+ return _context35.stop();
1055
1253
  }
1056
- }, _callee31);
1254
+ }, _callee35);
1057
1255
  })));
1058
- it('handle calls status check once mercury comes back up after a network flap', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1256
+ it('handle calls status check once mercury comes back up after a network flap', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1059
1257
  var call, callKeepaliveSpy, deleteSpy, mercuryOnlineCb;
1060
- return _regenerator.default.wrap(function (_context32) {
1061
- while (1) switch (_context32.prev = _context32.next) {
1258
+ return _regenerator.default.wrap(function (_context36) {
1259
+ while (1) switch (_context36.prev = _context36.next) {
1062
1260
  case 0:
1063
1261
  callingClient['isNetworkDown'] = true;
1064
1262
  call = callingClient['callManager'].createCall();
@@ -1066,11 +1264,11 @@ describe('CallingClient Tests', function () {
1066
1264
  deleteSpy = jest.spyOn(call, 'delete');
1067
1265
  expect((0, _keys.default)(callingClient['callManager'].getActiveCalls()).length).toBe(1);
1068
1266
  mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
1069
- _context32.next = 1;
1267
+ _context36.next = 1;
1070
1268
  return mercuryOnlineCb();
1071
1269
  case 1:
1072
1270
  expect(callKeepaliveSpy).toHaveBeenCalled();
1073
- _context32.next = 2;
1271
+ _context36.next = 2;
1074
1272
  return flushPromises();
1075
1273
  case 2:
1076
1274
  expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Call Keepalive failed'), {
@@ -1083,25 +1281,25 @@ describe('CallingClient Tests', function () {
1083
1281
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), expect.any(String));
1084
1282
  case 3:
1085
1283
  case "end":
1086
- return _context32.stop();
1284
+ return _context36.stop();
1087
1285
  }
1088
- }, _callee32);
1286
+ }, _callee36);
1089
1287
  })));
1090
- it('handle calls status check once mercury comes back up with stable network', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1288
+ it('handle calls status check once mercury comes back up with stable network', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
1091
1289
  var call, callKeepaliveSpy, deleteSpy, mercuryOnlineCb;
1092
- return _regenerator.default.wrap(function (_context33) {
1093
- while (1) switch (_context33.prev = _context33.next) {
1290
+ return _regenerator.default.wrap(function (_context37) {
1291
+ while (1) switch (_context37.prev = _context37.next) {
1094
1292
  case 0:
1095
1293
  call = callingClient['callManager'].createCall();
1096
1294
  callKeepaliveSpy = jest.spyOn(call, 'postStatus').mockRejectedValueOnce(new Error('keepalive fail'));
1097
1295
  deleteSpy = jest.spyOn(call, 'delete');
1098
1296
  expect((0, _keys.default)(callingClient['callManager'].getActiveCalls()).length).toBe(1);
1099
1297
  mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
1100
- _context33.next = 1;
1298
+ _context37.next = 1;
1101
1299
  return mercuryOnlineCb();
1102
1300
  case 1:
1103
1301
  expect(callKeepaliveSpy).toHaveBeenCalled();
1104
- _context33.next = 2;
1302
+ _context37.next = 2;
1105
1303
  return flushPromises();
1106
1304
  case 2:
1107
1305
  expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Call Keepalive failed'), {
@@ -1114,9 +1312,9 @@ describe('CallingClient Tests', function () {
1114
1312
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_UP, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), expect.any(String));
1115
1313
  case 3:
1116
1314
  case "end":
1117
- return _context33.stop();
1315
+ return _context37.stop();
1118
1316
  }
1119
- }, _callee33);
1317
+ }, _callee37);
1120
1318
  })));
1121
1319
  });
1122
1320
 
@@ -1134,15 +1332,15 @@ describe('CallingClient Tests', function () {
1134
1332
  });
1135
1333
  var callingClient;
1136
1334
  var line;
1137
- beforeAll(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1335
+ beforeAll(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
1138
1336
  var calls;
1139
- return _regenerator.default.wrap(function (_context34) {
1140
- while (1) switch (_context34.prev = _context34.next) {
1337
+ return _regenerator.default.wrap(function (_context38) {
1338
+ while (1) switch (_context38.prev = _context38.next) {
1141
1339
  case 0:
1142
- _context34.next = 1;
1340
+ _context38.next = 1;
1143
1341
  return (0, _CallingClient.createClient)(webex);
1144
1342
  case 1:
1145
- callingClient = _context34.sent;
1343
+ callingClient = _context38.sent;
1146
1344
  line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
1147
1345
  calls = (0, _values.default)(callManager.getActiveCalls());
1148
1346
  calls.forEach(function (call) {
@@ -1150,9 +1348,9 @@ describe('CallingClient Tests', function () {
1150
1348
  });
1151
1349
  case 2:
1152
1350
  case "end":
1153
- return _context34.stop();
1351
+ return _context38.stop();
1154
1352
  }
1155
- }, _callee34);
1353
+ }, _callee38);
1156
1354
  })));
1157
1355
  afterAll(function () {
1158
1356
  callingClient.removeAllListeners();
@@ -1235,23 +1433,23 @@ describe('CallingClient Tests', function () {
1235
1433
  describe('Call Session Event test', function () {
1236
1434
  var mockOn = webex.internal.mercury.on;
1237
1435
  var callingClient;
1238
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1239
- return _regenerator.default.wrap(function (_context35) {
1240
- while (1) switch (_context35.prev = _context35.next) {
1436
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
1437
+ return _regenerator.default.wrap(function (_context39) {
1438
+ while (1) switch (_context39.prev = _context39.next) {
1241
1439
  case 0:
1242
- _context35.next = 1;
1440
+ _context39.next = 1;
1243
1441
  return (0, _CallingClient.createClient)(webex, {
1244
1442
  logger: {
1245
1443
  level: _types.LOGGER.INFO
1246
1444
  }
1247
1445
  });
1248
1446
  case 1:
1249
- callingClient = _context35.sent;
1447
+ callingClient = _context39.sent;
1250
1448
  case 2:
1251
1449
  case "end":
1252
- return _context35.stop();
1450
+ return _context39.stop();
1253
1451
  }
1254
- }, _callee35);
1452
+ }, _callee39);
1255
1453
  })));
1256
1454
  afterEach(function () {
1257
1455
  callingClient.removeAllListeners();
@@ -1282,10 +1480,10 @@ describe('CallingClient Tests', function () {
1282
1480
  var callingClient;
1283
1481
  var asyncEventCallback;
1284
1482
  var mobiusSocketMock;
1285
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1483
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
1286
1484
  var asyncEventOnCall;
1287
- return _regenerator.default.wrap(function (_context36) {
1288
- while (1) switch (_context36.prev = _context36.next) {
1485
+ return _regenerator.default.wrap(function (_context40) {
1486
+ while (1) switch (_context40.prev = _context40.next) {
1289
1487
  case 0:
1290
1488
  webex.internal.device.features.developer.get = jest.fn().mockReturnValue({
1291
1489
  value: true
@@ -1297,23 +1495,23 @@ describe('CallingClient Tests', function () {
1297
1495
  mobiusSocketMock = jest.requireMock('../mobius-socket').getMobiusSocketInstance(webex);
1298
1496
  mobiusSocketMock.on.mockClear();
1299
1497
  mobiusSocketMock.off.mockClear();
1300
- _context36.next = 1;
1498
+ _context40.next = 1;
1301
1499
  return (0, _CallingClient.createClient)(webex, {
1302
1500
  logger: {
1303
1501
  level: _types.LOGGER.INFO
1304
1502
  }
1305
1503
  });
1306
1504
  case 1:
1307
- callingClient = _context36.sent;
1505
+ callingClient = _context40.sent;
1308
1506
  asyncEventOnCall = mobiusSocketMock.on.mock.calls.find(function (call) {
1309
1507
  return call[0] === 'event:async_event';
1310
1508
  });
1311
1509
  asyncEventCallback = asyncEventOnCall[1];
1312
1510
  case 2:
1313
1511
  case "end":
1314
- return _context36.stop();
1512
+ return _context40.stop();
1315
1513
  }
1316
- }, _callee36);
1514
+ }, _callee40);
1317
1515
  })));
1318
1516
  afterEach(function () {
1319
1517
  callingClient.removeAllListeners();
@@ -1322,15 +1520,15 @@ describe('CallingClient Tests', function () {
1322
1520
  value: false
1323
1521
  });
1324
1522
  });
1325
- it('routes mobius.* async events to callManager', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
1523
+ it('routes mobius.* async events to callManager', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
1326
1524
  var callEventSpy;
1327
- return _regenerator.default.wrap(function (_context37) {
1328
- while (1) switch (_context37.prev = _context37.next) {
1525
+ return _regenerator.default.wrap(function (_context41) {
1526
+ while (1) switch (_context41.prev = _context41.next) {
1329
1527
  case 0:
1330
1528
  callEventSpy = jest.spyOn(callingClient['callManager'], 'dequeueWsEvents').mockImplementation(function () {
1331
1529
  return undefined;
1332
1530
  });
1333
- _context37.next = 1;
1531
+ _context41.next = 1;
1334
1532
  return asyncEventCallback({
1335
1533
  type: 'async_event',
1336
1534
  data: {
@@ -1350,9 +1548,9 @@ describe('CallingClient Tests', function () {
1350
1548
  }));
1351
1549
  case 2:
1352
1550
  case "end":
1353
- return _context37.stop();
1551
+ return _context41.stop();
1354
1552
  }
1355
- }, _callee37);
1553
+ }, _callee41);
1356
1554
  })));
1357
1555
  });
1358
1556
  describe('Mobius socket connection events', function () {
@@ -1364,9 +1562,9 @@ describe('CallingClient Tests', function () {
1364
1562
  });
1365
1563
  return onCall[1];
1366
1564
  };
1367
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
1368
- return _regenerator.default.wrap(function (_context38) {
1369
- while (1) switch (_context38.prev = _context38.next) {
1565
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
1566
+ return _regenerator.default.wrap(function (_context42) {
1567
+ while (1) switch (_context42.prev = _context42.next) {
1370
1568
  case 0:
1371
1569
  webex.internal.device.features.developer.get = jest.fn().mockReturnValue({
1372
1570
  value: true
@@ -1379,19 +1577,19 @@ describe('CallingClient Tests', function () {
1379
1577
  mobiusSocketMock.on.mockClear();
1380
1578
  mobiusSocketMock.off.mockClear();
1381
1579
  mobiusSocketMock.isConnected.mockReturnValue(false);
1382
- _context38.next = 1;
1580
+ _context42.next = 1;
1383
1581
  return (0, _CallingClient.createClient)(webex, {
1384
1582
  logger: {
1385
1583
  level: _types.LOGGER.INFO
1386
1584
  }
1387
1585
  });
1388
1586
  case 1:
1389
- callingClient = _context38.sent;
1587
+ callingClient = _context42.sent;
1390
1588
  case 2:
1391
1589
  case "end":
1392
- return _context38.stop();
1590
+ return _context42.stop();
1393
1591
  }
1394
- }, _callee38);
1592
+ }, _callee42);
1395
1593
  })));
1396
1594
  afterEach(function () {
1397
1595
  callingClient.removeAllListeners();
@@ -1424,34 +1622,34 @@ describe('CallingClient Tests', function () {
1424
1622
  var callingClient;
1425
1623
  var primaryMobius = 'https://mobius.primary/api/v1/calling/web/';
1426
1624
  var backupMobius = 'https://mobius.backup/api/v1/calling/web/';
1427
- beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
1428
- return _regenerator.default.wrap(function (_context39) {
1429
- while (1) switch (_context39.prev = _context39.next) {
1625
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
1626
+ return _regenerator.default.wrap(function (_context43) {
1627
+ while (1) switch (_context43.prev = _context43.next) {
1430
1628
  case 0:
1431
- _context39.next = 1;
1629
+ _context43.next = 1;
1432
1630
  return (0, _CallingClient.createClient)(webex, {
1433
1631
  logger: {
1434
1632
  level: _types.LOGGER.INFO
1435
1633
  }
1436
1634
  });
1437
1635
  case 1:
1438
- callingClient = _context39.sent;
1636
+ callingClient = _context43.sent;
1439
1637
  callingClient.primaryMobiusUris = [primaryMobius];
1440
1638
  callingClient.backupMobiusUris = [backupMobius];
1441
1639
  webex.request.mockClear();
1442
1640
  case 2:
1443
1641
  case "end":
1444
- return _context39.stop();
1642
+ return _context43.stop();
1445
1643
  }
1446
- }, _callee39);
1644
+ }, _callee43);
1447
1645
  })));
1448
1646
  afterEach(function () {
1449
1647
  callingClient.removeAllListeners();
1450
1648
  });
1451
- it('fetches devices for the provided userId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
1649
+ it('fetches devices for the provided userId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
1452
1650
  var devices, responsePayload, response;
1453
- return _regenerator.default.wrap(function (_context40) {
1454
- while (1) switch (_context40.prev = _context40.next) {
1651
+ return _regenerator.default.wrap(function (_context44) {
1652
+ while (1) switch (_context44.prev = _context44.next) {
1455
1653
  case 0:
1456
1654
  devices = [{
1457
1655
  deviceId: 'device-1',
@@ -1469,10 +1667,10 @@ describe('CallingClient Tests', function () {
1469
1667
  }
1470
1668
  };
1471
1669
  webex.request.mockResolvedValue(responsePayload);
1472
- _context40.next = 1;
1670
+ _context44.next = 1;
1473
1671
  return callingClient.getDevices('user-123');
1474
1672
  case 1:
1475
- response = _context40.sent;
1673
+ response = _context44.sent;
1476
1674
  expect(webex.request).toHaveBeenCalledWith({
1477
1675
  uri: 'https://mobius.primary/api/v1/calling/web/devices?userid=user-123',
1478
1676
  method: _types2.HTTP_METHODS.GET,
@@ -1482,14 +1680,14 @@ describe('CallingClient Tests', function () {
1482
1680
  expect(response).toEqual(devices);
1483
1681
  case 2:
1484
1682
  case "end":
1485
- return _context40.stop();
1683
+ return _context44.stop();
1486
1684
  }
1487
- }, _callee40);
1685
+ }, _callee44);
1488
1686
  })));
1489
- it('falls back to backup Mobius when primary fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
1687
+ it('falls back to backup Mobius when primary fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
1490
1688
  var devices, failurePayload, responsePayload, response, requestCalls;
1491
- return _regenerator.default.wrap(function (_context41) {
1492
- while (1) switch (_context41.prev = _context41.next) {
1689
+ return _regenerator.default.wrap(function (_context45) {
1690
+ while (1) switch (_context45.prev = _context45.next) {
1493
1691
  case 0:
1494
1692
  devices = [{
1495
1693
  deviceId: 'device-2',
@@ -1510,10 +1708,10 @@ describe('CallingClient Tests', function () {
1510
1708
  }
1511
1709
  };
1512
1710
  webex.request.mockRejectedValueOnce(failurePayload).mockResolvedValueOnce(responsePayload);
1513
- _context41.next = 1;
1711
+ _context45.next = 1;
1514
1712
  return callingClient.getDevices('user-123');
1515
1713
  case 1:
1516
- response = _context41.sent;
1714
+ response = _context45.sent;
1517
1715
  requestCalls = webex.request.mock.calls;
1518
1716
  expect(requestCalls[0][0]).toEqual({
1519
1717
  uri: 'https://mobius.primary/api/v1/calling/web/devices?userid=user-123',
@@ -1530,9 +1728,9 @@ describe('CallingClient Tests', function () {
1530
1728
  expect(response).toEqual(devices);
1531
1729
  case 2:
1532
1730
  case "end":
1533
- return _context41.stop();
1731
+ return _context45.stop();
1534
1732
  }
1535
- }, _callee41);
1733
+ }, _callee45);
1536
1734
  })));
1537
1735
  });
1538
1736
  describe('windowsChromiumIceWarmup', function () {
@@ -1608,17 +1806,17 @@ describe('CallingClient Tests', function () {
1608
1806
  afterAll(function () {
1609
1807
  global.RTCPeerConnection = origRTCPeerConnection;
1610
1808
  });
1611
- it('should complete without throwing', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
1612
- return _regenerator.default.wrap(function (_context42) {
1613
- while (1) switch (_context42.prev = _context42.next) {
1809
+ it('should complete without throwing', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
1810
+ return _regenerator.default.wrap(function (_context46) {
1811
+ while (1) switch (_context46.prev = _context46.next) {
1614
1812
  case 0:
1615
- _context42.next = 1;
1813
+ _context46.next = 1;
1616
1814
  return expect((0, _windowsChromiumIceWarmupUtils.default)({})).resolves.not.toThrow();
1617
1815
  case 1:
1618
1816
  case "end":
1619
- return _context42.stop();
1817
+ return _context46.stop();
1620
1818
  }
1621
- }, _callee42);
1819
+ }, _callee46);
1622
1820
  })));
1623
1821
  });
1624
1822
  });