@webex/calling 3.8.1-web-workers-keepalive.2 → 3.9.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.
- package/dist/CallSettings/WxCallBackendConnector.js +2 -2
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +94 -27
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +56 -21
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +162 -98
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/constants.js +3 -4
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/registration/register.js +278 -198
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +168 -85
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/common/Utils.js +13 -7
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +265 -119
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/module/CallSettings/WxCallBackendConnector.js +1 -1
- package/dist/module/CallingClient/CallingClient.js +23 -8
- package/dist/module/CallingClient/constants.js +1 -2
- package/dist/module/CallingClient/registration/register.js +39 -6
- package/dist/module/common/Utils.js +8 -1
- package/dist/types/CallSettings/types.d.ts +1 -1
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +1 -2
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +1 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/package.json +4 -5
|
@@ -10,11 +10,11 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
10
10
|
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
11
11
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
12
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
14
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
13
15
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
16
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
15
17
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
16
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
18
18
|
var _asyncMutex = require("async-mutex");
|
|
19
19
|
var Media = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
20
20
|
var _types = require("../Logger/types");
|
|
@@ -41,15 +41,6 @@ global.crypto = {
|
|
|
41
41
|
return '12345678-1234-5678-1234-567812345678';
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
jest.mock('../common/Utils', function () {
|
|
45
|
-
var originalModule = jest.requireActual('../common/Utils');
|
|
46
|
-
return _objectSpread(_objectSpread({}, originalModule), {}, {
|
|
47
|
-
uploadLogs: jest.fn().mockImplementation(function () {
|
|
48
|
-
return _promise.default.resolve(undefined);
|
|
49
|
-
}),
|
|
50
|
-
handleCallingClientErrors: jest.fn()
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
44
|
jest.spyOn(utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
54
45
|
describe('CallingClient Tests', function () {
|
|
55
46
|
// Common initializers
|
|
@@ -481,7 +472,7 @@ describe('CallingClient Tests', function () {
|
|
|
481
472
|
failurePayload = {
|
|
482
473
|
statusCode: 500
|
|
483
474
|
};
|
|
484
|
-
webex.request.
|
|
475
|
+
webex.request.mockRejectedValue(failurePayload);
|
|
485
476
|
_context16.next = 4;
|
|
486
477
|
return (0, _CallingClient.createClient)(webex, {
|
|
487
478
|
logger: {
|
|
@@ -518,15 +509,15 @@ describe('CallingClient Tests', function () {
|
|
|
518
509
|
}
|
|
519
510
|
}, _callee16);
|
|
520
511
|
})));
|
|
521
|
-
it('when
|
|
512
|
+
it('case when /myIP failed with 401', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
522
513
|
var failurePayload;
|
|
523
514
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
524
515
|
while (1) switch (_context17.prev = _context17.next) {
|
|
525
516
|
case 0:
|
|
526
517
|
failurePayload = {
|
|
527
|
-
statusCode:
|
|
518
|
+
statusCode: 401
|
|
528
519
|
};
|
|
529
|
-
webex.request.
|
|
520
|
+
webex.request.mockRejectedValueOnce(failurePayload);
|
|
530
521
|
_context17.next = 4;
|
|
531
522
|
return (0, _CallingClient.createClient)(webex, {
|
|
532
523
|
logger: {
|
|
@@ -535,6 +526,39 @@ describe('CallingClient Tests', function () {
|
|
|
535
526
|
});
|
|
536
527
|
case 4:
|
|
537
528
|
callingClient = _context17.sent;
|
|
529
|
+
expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
530
|
+
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
531
|
+
method: 'GET'
|
|
532
|
+
}));
|
|
533
|
+
expect(handleErrorSpy).toBeCalledOnceWith(failurePayload, expect.anything(), {
|
|
534
|
+
file: _constants.CALLING_CLIENT_FILE,
|
|
535
|
+
method: 'getMobiusServers'
|
|
536
|
+
});
|
|
537
|
+
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
538
|
+
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
539
|
+
case 9:
|
|
540
|
+
case "end":
|
|
541
|
+
return _context17.stop();
|
|
542
|
+
}
|
|
543
|
+
}, _callee17);
|
|
544
|
+
})));
|
|
545
|
+
it('when region discovery succeeds but region based mobius url discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
546
|
+
var failurePayload;
|
|
547
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
548
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
549
|
+
case 0:
|
|
550
|
+
failurePayload = {
|
|
551
|
+
statusCode: 500
|
|
552
|
+
};
|
|
553
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
|
|
554
|
+
_context18.next = 4;
|
|
555
|
+
return (0, _CallingClient.createClient)(webex, {
|
|
556
|
+
logger: {
|
|
557
|
+
level: _types.LOGGER.INFO
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
case 4:
|
|
561
|
+
callingClient = _context18.sent;
|
|
538
562
|
expect(handleErrorSpy).toBeCalledWith(failurePayload, expect.anything(), {
|
|
539
563
|
file: _constants.CALLING_CLIENT_FILE,
|
|
540
564
|
method: 'getMobiusServers'
|
|
@@ -555,19 +579,59 @@ describe('CallingClient Tests', function () {
|
|
|
555
579
|
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
556
580
|
case 11:
|
|
557
581
|
case "end":
|
|
558
|
-
return
|
|
582
|
+
return _context18.stop();
|
|
559
583
|
}
|
|
560
|
-
},
|
|
584
|
+
}, _callee18);
|
|
585
|
+
})));
|
|
586
|
+
it('case when discovery failed with 401', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
587
|
+
var failurePayload;
|
|
588
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
589
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
590
|
+
case 0:
|
|
591
|
+
failurePayload = {
|
|
592
|
+
statusCode: 401
|
|
593
|
+
};
|
|
594
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockRejectedValueOnce(failurePayload);
|
|
595
|
+
_context19.next = 4;
|
|
596
|
+
return (0, _CallingClient.createClient)(webex, {
|
|
597
|
+
logger: {
|
|
598
|
+
level: _types.LOGGER.INFO
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
case 4:
|
|
602
|
+
callingClient = _context19.sent;
|
|
603
|
+
expect(webex.request).toBeCalledTimes(2);
|
|
604
|
+
expect(webex.request).nthCalledWith(1, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
605
|
+
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
606
|
+
method: 'GET'
|
|
607
|
+
}));
|
|
608
|
+
expect(webex.request).nthCalledWith(2, {
|
|
609
|
+
method: 'GET',
|
|
610
|
+
uri: "".concat(_constants.DISCOVERY_URL, "/").concat(_callingClientFixtures.myIP),
|
|
611
|
+
addAuthHeader: false,
|
|
612
|
+
headers: (0, _defineProperty2.default)({}, _constants.SPARK_USER_AGENT, null)
|
|
613
|
+
});
|
|
614
|
+
expect(handleErrorSpy).toBeCalledOnceWith(failurePayload, expect.anything(), {
|
|
615
|
+
file: _constants.CALLING_CLIENT_FILE,
|
|
616
|
+
method: 'getMobiusServers'
|
|
617
|
+
});
|
|
618
|
+
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
619
|
+
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
620
|
+
case 11:
|
|
621
|
+
case "end":
|
|
622
|
+
return _context19.stop();
|
|
623
|
+
}
|
|
624
|
+
}, _callee19);
|
|
561
625
|
})));
|
|
562
|
-
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
626
|
+
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
563
627
|
var infoSpy;
|
|
564
|
-
return _regenerator.default.wrap(function
|
|
565
|
-
while (1) switch (
|
|
628
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
629
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
566
630
|
case 0:
|
|
567
631
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
568
632
|
infoSpy.mockReset();
|
|
569
633
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
570
|
-
|
|
634
|
+
_context20.next = 5;
|
|
571
635
|
return (0, _CallingClient.createClient)(webex, {
|
|
572
636
|
discovery: {
|
|
573
637
|
region: 'AP-SOUTHEAST',
|
|
@@ -578,7 +642,7 @@ describe('CallingClient Tests', function () {
|
|
|
578
642
|
}
|
|
579
643
|
});
|
|
580
644
|
case 5:
|
|
581
|
-
callingClient =
|
|
645
|
+
callingClient = _context20.sent;
|
|
582
646
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
583
647
|
expect(infoSpy).toHaveBeenCalledWith(_constants2.METHOD_START_MESSAGE, {
|
|
584
648
|
file: 'CallingClient',
|
|
@@ -591,66 +655,66 @@ describe('CallingClient Tests', function () {
|
|
|
591
655
|
expect(handleErrorSpy).not.toHaveBeenCalled();
|
|
592
656
|
case 10:
|
|
593
657
|
case "end":
|
|
594
|
-
return
|
|
658
|
+
return _context20.stop();
|
|
595
659
|
}
|
|
596
|
-
},
|
|
660
|
+
}, _callee20);
|
|
597
661
|
})));
|
|
598
662
|
});
|
|
599
663
|
describe('Testing each cluster present withing host catalog', function () {
|
|
600
664
|
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'];
|
|
601
665
|
var checkCluster = /*#__PURE__*/function () {
|
|
602
|
-
var
|
|
666
|
+
var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(mockServiceHosts, mockCatalog) {
|
|
603
667
|
var callingClient;
|
|
604
|
-
return _regenerator.default.wrap(function
|
|
605
|
-
while (1) switch (
|
|
668
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
669
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
606
670
|
case 0:
|
|
607
671
|
webex.internal.services._hostCatalog = mockCatalog;
|
|
608
|
-
|
|
672
|
+
_context21.next = 3;
|
|
609
673
|
return (0, _CallingClient.createClient)(webex, {
|
|
610
674
|
logger: {
|
|
611
675
|
level: _types.LOGGER.INFO
|
|
612
676
|
}
|
|
613
677
|
});
|
|
614
678
|
case 3:
|
|
615
|
-
callingClient =
|
|
679
|
+
callingClient = _context21.sent;
|
|
616
680
|
expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
|
|
617
681
|
case 5:
|
|
618
682
|
case "end":
|
|
619
|
-
return
|
|
683
|
+
return _context21.stop();
|
|
620
684
|
}
|
|
621
|
-
},
|
|
685
|
+
}, _callee21);
|
|
622
686
|
}));
|
|
623
687
|
return function checkCluster(_x, _x2) {
|
|
624
|
-
return
|
|
688
|
+
return _ref21.apply(this, arguments);
|
|
625
689
|
};
|
|
626
690
|
}();
|
|
627
691
|
it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
|
|
628
|
-
var
|
|
629
|
-
return _regenerator.default.wrap(function
|
|
630
|
-
while (1) switch (
|
|
692
|
+
var _ref22 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(clusterName) {
|
|
693
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
694
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
631
695
|
case 0:
|
|
632
|
-
|
|
633
|
-
|
|
696
|
+
_context22.t0 = clusterName;
|
|
697
|
+
_context22.next = _context22.t0 === 'mobius-eu-central-1.prod.infra.webex.com' ? 3 : _context22.t0 === 'mobius-us-east-1.int.infra.webex.com' ? 5 : _context22.t0 === 'mobius-eu-central-1.int.infra.webex.com' ? 7 : 9;
|
|
634
698
|
break;
|
|
635
699
|
case 3:
|
|
636
700
|
checkCluster(_callingClientFixtures.mockEUServiceHosts, _callingClientFixtures.mockCatalogEU);
|
|
637
|
-
return
|
|
701
|
+
return _context22.abrupt("break", 10);
|
|
638
702
|
case 5:
|
|
639
703
|
checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
|
|
640
|
-
return
|
|
704
|
+
return _context22.abrupt("break", 10);
|
|
641
705
|
case 7:
|
|
642
706
|
checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
|
|
643
|
-
return
|
|
707
|
+
return _context22.abrupt("break", 10);
|
|
644
708
|
case 9:
|
|
645
|
-
return
|
|
709
|
+
return _context22.abrupt("break", 10);
|
|
646
710
|
case 10:
|
|
647
711
|
case "end":
|
|
648
|
-
return
|
|
712
|
+
return _context22.stop();
|
|
649
713
|
}
|
|
650
|
-
},
|
|
714
|
+
}, _callee22);
|
|
651
715
|
}));
|
|
652
716
|
return function (_x3) {
|
|
653
|
-
return
|
|
717
|
+
return _ref22.apply(this, arguments);
|
|
654
718
|
};
|
|
655
719
|
}());
|
|
656
720
|
});
|
|
@@ -663,23 +727,23 @@ describe('CallingClient Tests', function () {
|
|
|
663
727
|
var deRegSpy;
|
|
664
728
|
var restartRegisterSpy;
|
|
665
729
|
var registerSpy;
|
|
666
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
667
|
-
return _regenerator.default.wrap(function
|
|
668
|
-
while (1) switch (
|
|
730
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
731
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
732
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
669
733
|
case 0:
|
|
670
734
|
jest.useFakeTimers();
|
|
671
735
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload).mockResolvedValueOnce(_callingClientFixtures.registrationPayload);
|
|
672
|
-
|
|
736
|
+
_context23.next = 4;
|
|
673
737
|
return (0, _CallingClient.createClient)(webex, {
|
|
674
738
|
logger: {
|
|
675
739
|
level: _types.LOGGER.INFO
|
|
676
740
|
}
|
|
677
741
|
});
|
|
678
742
|
case 4:
|
|
679
|
-
callingClient =
|
|
743
|
+
callingClient = _context23.sent;
|
|
680
744
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
681
745
|
reg = line.registration;
|
|
682
|
-
|
|
746
|
+
_context23.next = 9;
|
|
683
747
|
return line.register();
|
|
684
748
|
case 9:
|
|
685
749
|
deRegSpy = jest.spyOn(line.registration, 'deregister');
|
|
@@ -688,9 +752,9 @@ describe('CallingClient Tests', function () {
|
|
|
688
752
|
registerSpy = jest.spyOn(reg, 'attemptRegistrationWithServers');
|
|
689
753
|
case 13:
|
|
690
754
|
case "end":
|
|
691
|
-
return
|
|
755
|
+
return _context23.stop();
|
|
692
756
|
}
|
|
693
|
-
},
|
|
757
|
+
}, _callee23);
|
|
694
758
|
})));
|
|
695
759
|
afterEach(function () {
|
|
696
760
|
jest.clearAllTimers();
|
|
@@ -700,9 +764,9 @@ describe('CallingClient Tests', function () {
|
|
|
700
764
|
callingClient = undefined;
|
|
701
765
|
jest.useRealTimers();
|
|
702
766
|
});
|
|
703
|
-
it('detect a network flap in mercury connection', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
704
|
-
return _regenerator.default.wrap(function
|
|
705
|
-
while (1) switch (
|
|
767
|
+
it('detect a network flap in mercury connection', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
768
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
769
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
706
770
|
case 0:
|
|
707
771
|
warnSpy.mockClear();
|
|
708
772
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
@@ -721,7 +785,7 @@ describe('CallingClient Tests', function () {
|
|
|
721
785
|
webex.internal.mercury.connected = true;
|
|
722
786
|
logSpy.mockReset();
|
|
723
787
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
724
|
-
|
|
788
|
+
_context24.next = 10;
|
|
725
789
|
return flushPromises();
|
|
726
790
|
case 10:
|
|
727
791
|
_Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
|
|
@@ -741,14 +805,14 @@ describe('CallingClient Tests', function () {
|
|
|
741
805
|
expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
742
806
|
case 17:
|
|
743
807
|
case "end":
|
|
744
|
-
return
|
|
808
|
+
return _context24.stop();
|
|
745
809
|
}
|
|
746
|
-
},
|
|
810
|
+
}, _callee24);
|
|
747
811
|
})));
|
|
748
|
-
it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
812
|
+
it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
749
813
|
var failurePayload, mockRegistrationBody, successPayload;
|
|
750
|
-
return _regenerator.default.wrap(function
|
|
751
|
-
while (1) switch (
|
|
814
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
815
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
752
816
|
case 0:
|
|
753
817
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
754
818
|
failurePayload = {
|
|
@@ -776,7 +840,7 @@ describe('CallingClient Tests', function () {
|
|
|
776
840
|
webex.internal.mercury.connected = true;
|
|
777
841
|
logSpy.mockReset();
|
|
778
842
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
779
|
-
|
|
843
|
+
_context25.next = 13;
|
|
780
844
|
return flushPromises();
|
|
781
845
|
case 13:
|
|
782
846
|
_Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
|
|
@@ -796,14 +860,14 @@ describe('CallingClient Tests', function () {
|
|
|
796
860
|
expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
797
861
|
case 20:
|
|
798
862
|
case "end":
|
|
799
|
-
return
|
|
863
|
+
return _context25.stop();
|
|
800
864
|
}
|
|
801
|
-
},
|
|
865
|
+
}, _callee25);
|
|
802
866
|
})));
|
|
803
|
-
it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
867
|
+
it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
804
868
|
var handleConnectionRestoreSpy;
|
|
805
|
-
return _regenerator.default.wrap(function
|
|
806
|
-
while (1) switch (
|
|
869
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
870
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
807
871
|
case 0:
|
|
808
872
|
warnSpy.mockClear();
|
|
809
873
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
@@ -822,7 +886,7 @@ describe('CallingClient Tests', function () {
|
|
|
822
886
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
823
887
|
webex.internal.mercury.connected = true;
|
|
824
888
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
825
|
-
|
|
889
|
+
_context26.next = 10;
|
|
826
890
|
return flushPromises();
|
|
827
891
|
case 10:
|
|
828
892
|
/* We should be detecting the network recovery */
|
|
@@ -838,13 +902,13 @@ describe('CallingClient Tests', function () {
|
|
|
838
902
|
expect(handleConnectionRestoreSpy).not.toBeCalledOnceWith();
|
|
839
903
|
case 12:
|
|
840
904
|
case "end":
|
|
841
|
-
return
|
|
905
|
+
return _context26.stop();
|
|
842
906
|
}
|
|
843
|
-
},
|
|
907
|
+
}, _callee26);
|
|
844
908
|
})));
|
|
845
|
-
it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
846
|
-
return _regenerator.default.wrap(function
|
|
847
|
-
while (1) switch (
|
|
909
|
+
it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
910
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
911
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
848
912
|
case 0:
|
|
849
913
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
850
914
|
|
|
@@ -855,7 +919,7 @@ describe('CallingClient Tests', function () {
|
|
|
855
919
|
/* Set mercury connection to be down and execute a delay of 2.5 seconds */
|
|
856
920
|
webex.internal.mercury.connected = false;
|
|
857
921
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
858
|
-
|
|
922
|
+
_context27.next = 7;
|
|
859
923
|
return flushPromises();
|
|
860
924
|
case 7:
|
|
861
925
|
/* We should be detecting the network flap */
|
|
@@ -867,7 +931,7 @@ describe('CallingClient Tests', function () {
|
|
|
867
931
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
868
932
|
webex.internal.mercury.connected = true;
|
|
869
933
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
870
|
-
|
|
934
|
+
_context27.next = 12;
|
|
871
935
|
return flushPromises();
|
|
872
936
|
case 12:
|
|
873
937
|
/* We should be detecting the network recovery */
|
|
@@ -878,28 +942,28 @@ describe('CallingClient Tests', function () {
|
|
|
878
942
|
expect(registerSpy).not.toBeCalledWith(true);
|
|
879
943
|
case 14:
|
|
880
944
|
case "end":
|
|
881
|
-
return
|
|
945
|
+
return _context27.stop();
|
|
882
946
|
}
|
|
883
|
-
},
|
|
947
|
+
}, _callee27);
|
|
884
948
|
})));
|
|
885
949
|
});
|
|
886
950
|
describe('Line creation tests', function () {
|
|
887
951
|
var callingClient;
|
|
888
952
|
var line;
|
|
889
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
890
|
-
return _regenerator.default.wrap(function
|
|
891
|
-
while (1) switch (
|
|
953
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
954
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
955
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
892
956
|
case 0:
|
|
893
|
-
|
|
957
|
+
_context28.next = 2;
|
|
894
958
|
return (0, _CallingClient.createClient)(webex);
|
|
895
959
|
case 2:
|
|
896
|
-
callingClient =
|
|
960
|
+
callingClient = _context28.sent;
|
|
897
961
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
898
962
|
case 4:
|
|
899
963
|
case "end":
|
|
900
|
-
return
|
|
964
|
+
return _context28.stop();
|
|
901
965
|
}
|
|
902
|
-
},
|
|
966
|
+
}, _callee28);
|
|
903
967
|
})));
|
|
904
968
|
afterEach(function () {
|
|
905
969
|
jest.clearAllTimers();
|
|
@@ -934,15 +998,15 @@ describe('CallingClient Tests', function () {
|
|
|
934
998
|
});
|
|
935
999
|
var callingClient;
|
|
936
1000
|
var line;
|
|
937
|
-
beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1001
|
+
beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
938
1002
|
var calls;
|
|
939
|
-
return _regenerator.default.wrap(function
|
|
940
|
-
while (1) switch (
|
|
1003
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1004
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
941
1005
|
case 0:
|
|
942
|
-
|
|
1006
|
+
_context29.next = 2;
|
|
943
1007
|
return (0, _CallingClient.createClient)(webex);
|
|
944
1008
|
case 2:
|
|
945
|
-
callingClient =
|
|
1009
|
+
callingClient = _context29.sent;
|
|
946
1010
|
line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
|
|
947
1011
|
calls = (0, _values.default)(callManager.getActiveCalls());
|
|
948
1012
|
calls.forEach(function (call) {
|
|
@@ -950,9 +1014,9 @@ describe('CallingClient Tests', function () {
|
|
|
950
1014
|
});
|
|
951
1015
|
case 6:
|
|
952
1016
|
case "end":
|
|
953
|
-
return
|
|
1017
|
+
return _context29.stop();
|
|
954
1018
|
}
|
|
955
|
-
},
|
|
1019
|
+
}, _callee29);
|
|
956
1020
|
})));
|
|
957
1021
|
afterAll(function () {
|
|
958
1022
|
callingClient.removeAllListeners();
|
|
@@ -1035,23 +1099,23 @@ describe('CallingClient Tests', function () {
|
|
|
1035
1099
|
describe('Call Session Event test', function () {
|
|
1036
1100
|
var mockOn = webex.internal.mercury.on;
|
|
1037
1101
|
var callingClient;
|
|
1038
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1039
|
-
return _regenerator.default.wrap(function
|
|
1040
|
-
while (1) switch (
|
|
1102
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1103
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1104
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1041
1105
|
case 0:
|
|
1042
|
-
|
|
1106
|
+
_context30.next = 2;
|
|
1043
1107
|
return (0, _CallingClient.createClient)(webex, {
|
|
1044
1108
|
logger: {
|
|
1045
1109
|
level: _types.LOGGER.INFO
|
|
1046
1110
|
}
|
|
1047
1111
|
});
|
|
1048
1112
|
case 2:
|
|
1049
|
-
callingClient =
|
|
1113
|
+
callingClient = _context30.sent;
|
|
1050
1114
|
case 3:
|
|
1051
1115
|
case "end":
|
|
1052
|
-
return
|
|
1116
|
+
return _context30.stop();
|
|
1053
1117
|
}
|
|
1054
|
-
},
|
|
1118
|
+
}, _callee30);
|
|
1055
1119
|
})));
|
|
1056
1120
|
afterEach(function () {
|
|
1057
1121
|
callingClient.removeAllListeners();
|