@webex/calling 3.10.0-next.1 → 3.10.0-next.11
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/CallHistory/CallHistory.js +26 -20
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +109 -0
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +2 -1
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +160 -205
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +152 -290
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +61 -43
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +594 -361
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +3 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +8 -5
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Events/impl/index.js +1 -2
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +14 -12
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +2 -1
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/common/Utils.js +68 -39
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +392 -143
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +2 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +7 -3
- package/dist/module/CallSettings/WxCallBackendConnector.js +3 -1
- package/dist/module/CallingClient/CallingClient.js +83 -121
- package/dist/module/CallingClient/calling/call.js +35 -23
- package/dist/module/CallingClient/constants.js +1 -0
- package/dist/module/Contacts/ContactsClient.js +9 -5
- package/dist/module/Events/impl/index.js +1 -2
- package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -1
- package/dist/module/Voicemail/UcmBackendConnector.js +2 -1
- package/dist/module/common/Utils.js +27 -3
- package/dist/module/common/testUtil.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +2 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +1 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -0
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Events/impl/index.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +10 -0
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -52,6 +52,7 @@ describe('CallingClient Tests', function () {
|
|
|
52
52
|
var setLoggerSpy = jest.spyOn(Media, 'setLogger');
|
|
53
53
|
var webex = (0, _testUtil.getTestUtilsWebex)();
|
|
54
54
|
webex.internal.services['_hostCatalog'] = _callingClientFixtures.mockCatalogUS;
|
|
55
|
+
webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockUSServiceHosts);
|
|
55
56
|
var defaultServiceIndicator = _types2.ServiceIndicator.CALLING;
|
|
56
57
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
57
58
|
var infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
@@ -69,51 +70,48 @@ describe('CallingClient Tests', function () {
|
|
|
69
70
|
webex.internal.services['_serviceUrls']['mobius'] = 'https://mobius.aintgen-a-1.int.infra.webex.com/api/v1';
|
|
70
71
|
webex.internal.services['_hostCatalog'] = _callingClientFixtures.mockCatalogUS;
|
|
71
72
|
});
|
|
72
|
-
it('should
|
|
73
|
-
var
|
|
73
|
+
it('should use default mobius service host when Service URL is invalid', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
74
|
+
var callingClient;
|
|
74
75
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
75
76
|
while (1) switch (_context.prev = _context.next) {
|
|
76
77
|
case 0:
|
|
77
|
-
webex.internal.services._hostCatalog = _callingClientFixtures.
|
|
78
|
-
webex.internal.services
|
|
79
|
-
|
|
80
|
-
return new window.URL(url);
|
|
81
|
-
});
|
|
82
|
-
_context.next = 5;
|
|
78
|
+
webex.internal.services._hostCatalog = _callingClientFixtures.mockCatalogUS;
|
|
79
|
+
webex.internal.services._serviceUrls.mobius = 'invalid-url';
|
|
80
|
+
_context.next = 4;
|
|
83
81
|
return (0, _CallingClient.createClient)(webex, {
|
|
84
82
|
logger: {
|
|
85
83
|
level: _types.LOGGER.INFO
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
|
-
case
|
|
86
|
+
case 4:
|
|
89
87
|
callingClient = _context.sent;
|
|
90
|
-
expect(
|
|
91
|
-
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.
|
|
92
|
-
|
|
93
|
-
case 9:
|
|
88
|
+
expect(setLoggerSpy).toHaveBeenCalledTimes(1);
|
|
89
|
+
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.mockUSServiceHosts);
|
|
90
|
+
case 7:
|
|
94
91
|
case "end":
|
|
95
92
|
return _context.stop();
|
|
96
93
|
}
|
|
97
94
|
}, _callee);
|
|
98
95
|
})));
|
|
99
|
-
it('should
|
|
96
|
+
it('should set mobiusServiceHost correctly when URL is valid', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
100
97
|
var callingClient;
|
|
101
98
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
102
99
|
while (1) switch (_context2.prev = _context2.next) {
|
|
103
100
|
case 0:
|
|
104
|
-
webex.internal.services._hostCatalog = _callingClientFixtures.
|
|
105
|
-
webex.internal.services.
|
|
106
|
-
|
|
101
|
+
webex.internal.services._hostCatalog = _callingClientFixtures.mockCatalogEU;
|
|
102
|
+
webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockEUServiceHosts);
|
|
103
|
+
webex.internal.services['_serviceUrls']['mobius'] = 'https://mobius-eu-central-1.prod.infra.webex.com/api/v1';
|
|
104
|
+
_context2.next = 5;
|
|
107
105
|
return (0, _CallingClient.createClient)(webex, {
|
|
108
106
|
logger: {
|
|
109
107
|
level: _types.LOGGER.INFO
|
|
110
108
|
}
|
|
111
109
|
});
|
|
112
|
-
case
|
|
110
|
+
case 5:
|
|
113
111
|
callingClient = _context2.sent;
|
|
114
|
-
expect(
|
|
115
|
-
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.
|
|
116
|
-
case
|
|
112
|
+
expect(callingClient['mobiusHost']).toBe('https://mobius-eu-central-1.prod.infra.webex.com/api/v1');
|
|
113
|
+
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.mockEUServiceHosts);
|
|
114
|
+
case 8:
|
|
117
115
|
case "end":
|
|
118
116
|
return _context2.stop();
|
|
119
117
|
}
|
|
@@ -434,7 +432,7 @@ describe('CallingClient Tests', function () {
|
|
|
434
432
|
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
435
433
|
while (1) switch (_context13.prev = _context13.next) {
|
|
436
434
|
case 0:
|
|
437
|
-
webex.request.mockResolvedValueOnce(_callingClientFixtures.
|
|
435
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
438
436
|
_context13.next = 3;
|
|
439
437
|
return (0, _CallingClient.createClient)(webex, {
|
|
440
438
|
logger: {
|
|
@@ -443,40 +441,35 @@ describe('CallingClient Tests', function () {
|
|
|
443
441
|
});
|
|
444
442
|
case 3:
|
|
445
443
|
callingClient = _context13.sent;
|
|
446
|
-
expect(webex.request).toBeCalledTimes(
|
|
444
|
+
expect(webex.request).toBeCalledTimes(2);
|
|
447
445
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
448
446
|
expect(handleErrorSpy).not.toBeCalled();
|
|
449
|
-
expect(webex.request).nthCalledWith(1,
|
|
450
|
-
method: 'GET'
|
|
451
|
-
}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
452
|
-
uri: "".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT).concat(_constants.IP_ENDPOINT)
|
|
453
|
-
}));
|
|
454
|
-
expect(webex.request).nthCalledWith(2, {
|
|
447
|
+
expect(webex.request).nthCalledWith(1, {
|
|
455
448
|
method: 'GET',
|
|
456
|
-
uri: "".concat(_constants.DISCOVERY_URL
|
|
449
|
+
uri: "".concat(_constants.DISCOVERY_URL),
|
|
457
450
|
addAuthHeader: false,
|
|
458
451
|
headers: (0, _defineProperty2.default)({}, _constants.SPARK_USER_AGENT, null)
|
|
459
452
|
});
|
|
460
|
-
expect(webex.request).nthCalledWith(
|
|
453
|
+
expect(webex.request).nthCalledWith(2, _objectSpread(_objectSpread({
|
|
461
454
|
method: 'GET'
|
|
462
455
|
}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
463
456
|
uri: "".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT, "?regionCode=").concat(_callingClientFixtures.regionBody.clientRegion, "&countryCode=").concat(_callingClientFixtures.regionBody.countryCode)
|
|
464
457
|
}));
|
|
465
|
-
case
|
|
458
|
+
case 9:
|
|
466
459
|
case "end":
|
|
467
460
|
return _context13.stop();
|
|
468
461
|
}
|
|
469
462
|
}, _callee13);
|
|
470
463
|
})));
|
|
471
|
-
it('
|
|
464
|
+
it('when region discovery succeeds but region based mobius url discovery fails with final error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
472
465
|
var failurePayload;
|
|
473
466
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
474
467
|
while (1) switch (_context14.prev = _context14.next) {
|
|
475
468
|
case 0:
|
|
476
469
|
failurePayload = {
|
|
477
|
-
statusCode:
|
|
470
|
+
statusCode: 401
|
|
478
471
|
};
|
|
479
|
-
webex.request.
|
|
472
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
|
|
480
473
|
_context14.next = 4;
|
|
481
474
|
return (0, _CallingClient.createClient)(webex, {
|
|
482
475
|
logger: {
|
|
@@ -485,167 +478,35 @@ describe('CallingClient Tests', function () {
|
|
|
485
478
|
});
|
|
486
479
|
case 4:
|
|
487
480
|
callingClient = _context14.sent;
|
|
488
|
-
expect(webex.request).nthCalledWith(1, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
489
|
-
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
490
|
-
method: 'GET'
|
|
491
|
-
}));
|
|
492
|
-
expect(webex.request).nthCalledWith(2, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
493
|
-
uri: 'https://mobius-ca-central-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
494
|
-
method: 'GET'
|
|
495
|
-
}));
|
|
496
|
-
expect(webex.request).nthCalledWith(3, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
497
|
-
uri: 'https://mobius-eu-central-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
498
|
-
method: 'GET'
|
|
499
|
-
}));
|
|
500
|
-
expect(webex.request).nthCalledWith(4, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
501
|
-
uri: 'https://mobius-ap-southeast-2.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
502
|
-
method: 'GET'
|
|
503
|
-
}));
|
|
504
|
-
expect(handleErrorSpy).toBeCalledWith(failurePayload, expect.anything(), {
|
|
505
|
-
file: _constants.CALLING_CLIENT_FILE,
|
|
506
|
-
method: 'getMobiusServers'
|
|
507
|
-
});
|
|
508
|
-
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
509
|
-
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", expect.objectContaining({
|
|
510
|
-
file: _constants.CALLING_CLIENT_FILE,
|
|
511
|
-
method: 'getMobiusServers'
|
|
512
|
-
}));
|
|
513
|
-
case 12:
|
|
514
|
-
case "end":
|
|
515
|
-
return _context14.stop();
|
|
516
|
-
}
|
|
517
|
-
}, _callee14);
|
|
518
|
-
})));
|
|
519
|
-
it('case when /myIP failed with 401', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
520
|
-
var failurePayload;
|
|
521
|
-
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
522
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
523
|
-
case 0:
|
|
524
|
-
failurePayload = {
|
|
525
|
-
statusCode: 401
|
|
526
|
-
};
|
|
527
|
-
webex.request.mockRejectedValueOnce(failurePayload);
|
|
528
|
-
_context15.next = 4;
|
|
529
|
-
return (0, _CallingClient.createClient)(webex, {
|
|
530
|
-
logger: {
|
|
531
|
-
level: _types.LOGGER.INFO
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
case 4:
|
|
535
|
-
callingClient = _context15.sent;
|
|
536
|
-
expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
537
|
-
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
538
|
-
method: 'GET'
|
|
539
|
-
}));
|
|
540
|
-
expect(handleErrorSpy).toBeCalledOnceWith(failurePayload, expect.anything(), {
|
|
541
|
-
file: _constants.CALLING_CLIENT_FILE,
|
|
542
|
-
method: 'getMobiusServers'
|
|
543
|
-
});
|
|
544
|
-
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
545
|
-
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", expect.objectContaining({
|
|
546
|
-
file: _constants.CALLING_CLIENT_FILE,
|
|
547
|
-
method: 'getMobiusServers'
|
|
548
|
-
}));
|
|
549
|
-
case 9:
|
|
550
|
-
case "end":
|
|
551
|
-
return _context15.stop();
|
|
552
|
-
}
|
|
553
|
-
}, _callee15);
|
|
554
|
-
})));
|
|
555
|
-
it('when region discovery succeeds but region based mobius url discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
556
|
-
var failurePayload;
|
|
557
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
558
|
-
while (1) switch (_context16.prev = _context16.next) {
|
|
559
|
-
case 0:
|
|
560
|
-
failurePayload = {
|
|
561
|
-
statusCode: 500
|
|
562
|
-
};
|
|
563
|
-
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
|
|
564
|
-
_context16.next = 4;
|
|
565
|
-
return (0, _CallingClient.createClient)(webex, {
|
|
566
|
-
logger: {
|
|
567
|
-
level: _types.LOGGER.INFO
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
case 4:
|
|
571
|
-
callingClient = _context16.sent;
|
|
572
481
|
expect(handleErrorSpy).toBeCalledWith(failurePayload, expect.anything(), {
|
|
573
482
|
file: _constants.CALLING_CLIENT_FILE,
|
|
574
483
|
method: 'getMobiusServers'
|
|
575
484
|
});
|
|
576
|
-
expect(webex.request).toBeCalledTimes(3);
|
|
577
|
-
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
578
|
-
expect(webex.request).nthCalledWith(1, _objectSpread(_objectSpread({
|
|
579
|
-
method: 'GET'
|
|
580
|
-
}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
581
|
-
uri: "".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT).concat(_constants.IP_ENDPOINT)
|
|
582
|
-
}));
|
|
583
|
-
expect(webex.request).nthCalledWith(2, {
|
|
584
|
-
method: 'GET',
|
|
585
|
-
uri: "".concat(_constants.DISCOVERY_URL, "/").concat(_callingClientFixtures.myIP),
|
|
586
|
-
addAuthHeader: false,
|
|
587
|
-
headers: (0, _defineProperty2.default)({}, _constants.SPARK_USER_AGENT, null)
|
|
588
|
-
});
|
|
589
|
-
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", expect.objectContaining({
|
|
590
|
-
file: _constants.CALLING_CLIENT_FILE,
|
|
591
|
-
method: 'getMobiusServers'
|
|
592
|
-
}));
|
|
593
|
-
case 11:
|
|
594
|
-
case "end":
|
|
595
|
-
return _context16.stop();
|
|
596
|
-
}
|
|
597
|
-
}, _callee16);
|
|
598
|
-
})));
|
|
599
|
-
it('case when discovery failed with 401', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
600
|
-
var failurePayload;
|
|
601
|
-
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
602
|
-
while (1) switch (_context17.prev = _context17.next) {
|
|
603
|
-
case 0:
|
|
604
|
-
failurePayload = {
|
|
605
|
-
statusCode: 401
|
|
606
|
-
};
|
|
607
|
-
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockRejectedValueOnce(failurePayload);
|
|
608
|
-
_context17.next = 4;
|
|
609
|
-
return (0, _CallingClient.createClient)(webex, {
|
|
610
|
-
logger: {
|
|
611
|
-
level: _types.LOGGER.INFO
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
case 4:
|
|
615
|
-
callingClient = _context17.sent;
|
|
616
485
|
expect(webex.request).toBeCalledTimes(2);
|
|
617
|
-
expect(
|
|
618
|
-
|
|
619
|
-
method: 'GET'
|
|
620
|
-
}));
|
|
621
|
-
expect(webex.request).nthCalledWith(2, {
|
|
486
|
+
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
487
|
+
expect(webex.request).nthCalledWith(1, {
|
|
622
488
|
method: 'GET',
|
|
623
|
-
uri: "".concat(_constants.DISCOVERY_URL
|
|
489
|
+
uri: "".concat(_constants.DISCOVERY_URL),
|
|
624
490
|
addAuthHeader: false,
|
|
625
491
|
headers: (0, _defineProperty2.default)({}, _constants.SPARK_USER_AGENT, null)
|
|
626
492
|
});
|
|
627
|
-
expect(handleErrorSpy).toBeCalledOnceWith(failurePayload, expect.anything(), {
|
|
628
|
-
file: _constants.CALLING_CLIENT_FILE,
|
|
629
|
-
method: 'getMobiusServers'
|
|
630
|
-
});
|
|
631
|
-
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
632
493
|
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", expect.objectContaining({
|
|
633
494
|
file: _constants.CALLING_CLIENT_FILE,
|
|
634
495
|
method: 'getMobiusServers'
|
|
635
496
|
}));
|
|
636
|
-
case
|
|
497
|
+
case 10:
|
|
637
498
|
case "end":
|
|
638
|
-
return
|
|
499
|
+
return _context14.stop();
|
|
639
500
|
}
|
|
640
|
-
},
|
|
501
|
+
}, _callee14);
|
|
641
502
|
})));
|
|
642
|
-
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
643
|
-
return _regenerator.default.wrap(function
|
|
644
|
-
while (1) switch (
|
|
503
|
+
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
504
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
505
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
645
506
|
case 0:
|
|
646
507
|
infoSpy.mockReset();
|
|
647
508
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
648
|
-
|
|
509
|
+
_context15.next = 4;
|
|
649
510
|
return (0, _CallingClient.createClient)(webex, {
|
|
650
511
|
discovery: {
|
|
651
512
|
region: 'AP-SOUTHEAST',
|
|
@@ -656,7 +517,7 @@ describe('CallingClient Tests', function () {
|
|
|
656
517
|
}
|
|
657
518
|
});
|
|
658
519
|
case 4:
|
|
659
|
-
callingClient =
|
|
520
|
+
callingClient = _context15.sent;
|
|
660
521
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
661
522
|
expect(infoSpy).toHaveBeenCalledWith(_constants2.METHOD_START_MESSAGE, {
|
|
662
523
|
file: 'CallingClient',
|
|
@@ -669,86 +530,87 @@ describe('CallingClient Tests', function () {
|
|
|
669
530
|
expect(handleErrorSpy).not.toHaveBeenCalled();
|
|
670
531
|
case 9:
|
|
671
532
|
case "end":
|
|
672
|
-
return
|
|
533
|
+
return _context15.stop();
|
|
673
534
|
}
|
|
674
|
-
},
|
|
535
|
+
}, _callee15);
|
|
675
536
|
})));
|
|
676
537
|
});
|
|
677
538
|
describe('Testing each cluster present withing host catalog', function () {
|
|
678
539
|
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'];
|
|
679
540
|
var checkCluster = /*#__PURE__*/function () {
|
|
680
|
-
var
|
|
541
|
+
var _ref16 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(mockServiceHosts, mockCatalog) {
|
|
681
542
|
var callingClient;
|
|
682
|
-
return _regenerator.default.wrap(function
|
|
683
|
-
while (1) switch (
|
|
543
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
544
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
684
545
|
case 0:
|
|
685
546
|
webex.internal.services._hostCatalog = mockCatalog;
|
|
686
|
-
|
|
547
|
+
webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(mockServiceHosts);
|
|
548
|
+
_context16.next = 4;
|
|
687
549
|
return (0, _CallingClient.createClient)(webex, {
|
|
688
550
|
logger: {
|
|
689
551
|
level: _types.LOGGER.INFO
|
|
690
552
|
}
|
|
691
553
|
});
|
|
692
|
-
case
|
|
693
|
-
callingClient =
|
|
554
|
+
case 4:
|
|
555
|
+
callingClient = _context16.sent;
|
|
694
556
|
expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
|
|
695
|
-
case
|
|
557
|
+
case 6:
|
|
696
558
|
case "end":
|
|
697
|
-
return
|
|
559
|
+
return _context16.stop();
|
|
698
560
|
}
|
|
699
|
-
},
|
|
561
|
+
}, _callee16);
|
|
700
562
|
}));
|
|
701
563
|
return function checkCluster(_x, _x2) {
|
|
702
|
-
return
|
|
564
|
+
return _ref16.apply(this, arguments);
|
|
703
565
|
};
|
|
704
566
|
}();
|
|
705
567
|
it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
|
|
706
|
-
var
|
|
707
|
-
return _regenerator.default.wrap(function
|
|
708
|
-
while (1) switch (
|
|
568
|
+
var _ref17 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(clusterName) {
|
|
569
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
570
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
709
571
|
case 0:
|
|
710
|
-
|
|
711
|
-
|
|
572
|
+
_context17.t0 = clusterName;
|
|
573
|
+
_context17.next = _context17.t0 === 'mobius-eu-central-1.prod.infra.webex.com' ? 3 : _context17.t0 === 'mobius-us-east-1.int.infra.webex.com' ? 5 : _context17.t0 === 'mobius-eu-central-1.int.infra.webex.com' ? 7 : 9;
|
|
712
574
|
break;
|
|
713
575
|
case 3:
|
|
714
576
|
checkCluster(_callingClientFixtures.mockEUServiceHosts, _callingClientFixtures.mockCatalogEU);
|
|
715
|
-
return
|
|
577
|
+
return _context17.abrupt("break", 10);
|
|
716
578
|
case 5:
|
|
717
579
|
checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
|
|
718
|
-
return
|
|
580
|
+
return _context17.abrupt("break", 10);
|
|
719
581
|
case 7:
|
|
720
582
|
checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
|
|
721
|
-
return
|
|
583
|
+
return _context17.abrupt("break", 10);
|
|
722
584
|
case 9:
|
|
723
|
-
return
|
|
585
|
+
return _context17.abrupt("break", 10);
|
|
724
586
|
case 10:
|
|
725
587
|
case "end":
|
|
726
|
-
return
|
|
588
|
+
return _context17.stop();
|
|
727
589
|
}
|
|
728
|
-
},
|
|
590
|
+
}, _callee17);
|
|
729
591
|
}));
|
|
730
592
|
return function (_x3) {
|
|
731
|
-
return
|
|
593
|
+
return _ref17.apply(this, arguments);
|
|
732
594
|
};
|
|
733
595
|
}());
|
|
734
596
|
});
|
|
735
597
|
describe('Line creation tests', function () {
|
|
736
598
|
var callingClient;
|
|
737
599
|
var line;
|
|
738
|
-
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
739
|
-
return _regenerator.default.wrap(function
|
|
740
|
-
while (1) switch (
|
|
600
|
+
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
601
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
602
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
741
603
|
case 0:
|
|
742
|
-
|
|
604
|
+
_context18.next = 2;
|
|
743
605
|
return (0, _CallingClient.createClient)(webex);
|
|
744
606
|
case 2:
|
|
745
|
-
callingClient =
|
|
607
|
+
callingClient = _context18.sent;
|
|
746
608
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
747
609
|
case 4:
|
|
748
610
|
case "end":
|
|
749
|
-
return
|
|
611
|
+
return _context18.stop();
|
|
750
612
|
}
|
|
751
|
-
},
|
|
613
|
+
}, _callee18);
|
|
752
614
|
})));
|
|
753
615
|
afterEach(function () {
|
|
754
616
|
jest.clearAllTimers();
|
|
@@ -778,24 +640,24 @@ describe('CallingClient Tests', function () {
|
|
|
778
640
|
var restartRegisterSpy;
|
|
779
641
|
var registerSpy;
|
|
780
642
|
var metricSpy;
|
|
781
|
-
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
782
|
-
return _regenerator.default.wrap(function
|
|
783
|
-
while (1) switch (
|
|
643
|
+
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
644
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
645
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
784
646
|
case 0:
|
|
785
647
|
jest.useFakeTimers();
|
|
786
|
-
webex.request.mockResolvedValueOnce(_callingClientFixtures.
|
|
648
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload).mockResolvedValueOnce(_callingClientFixtures.registrationPayload);
|
|
787
649
|
windowEventSpy = jest.spyOn(window, 'addEventListener');
|
|
788
|
-
|
|
650
|
+
_context19.next = 5;
|
|
789
651
|
return (0, _CallingClient.createClient)(webex, {
|
|
790
652
|
logger: {
|
|
791
653
|
level: _types.LOGGER.INFO
|
|
792
654
|
}
|
|
793
655
|
});
|
|
794
656
|
case 5:
|
|
795
|
-
callingClient =
|
|
657
|
+
callingClient = _context19.sent;
|
|
796
658
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
797
659
|
reg = line.registration;
|
|
798
|
-
|
|
660
|
+
_context19.next = 10;
|
|
799
661
|
return line.register();
|
|
800
662
|
case 10:
|
|
801
663
|
deRegSpy = jest.spyOn(reg, 'deregister');
|
|
@@ -805,9 +667,9 @@ describe('CallingClient Tests', function () {
|
|
|
805
667
|
metricSpy = jest.spyOn(callingClient['metricManager'], 'submitConnectionMetrics');
|
|
806
668
|
case 15:
|
|
807
669
|
case "end":
|
|
808
|
-
return
|
|
670
|
+
return _context19.stop();
|
|
809
671
|
}
|
|
810
|
-
},
|
|
672
|
+
}, _callee19);
|
|
811
673
|
})));
|
|
812
674
|
afterEach(function () {
|
|
813
675
|
jest.clearAllTimers();
|
|
@@ -818,16 +680,16 @@ describe('CallingClient Tests', function () {
|
|
|
818
680
|
callingClient = undefined;
|
|
819
681
|
jest.useRealTimers();
|
|
820
682
|
});
|
|
821
|
-
it('window offline handler sets networkDown and clears keepalive when network is unreachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
683
|
+
it('window offline handler sets networkDown and clears keepalive when network is unreachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
822
684
|
var g, clearKeepaliveSpy, offlineCb;
|
|
823
|
-
return _regenerator.default.wrap(function
|
|
824
|
-
while (1) switch (
|
|
685
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
686
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
825
687
|
case 0:
|
|
826
688
|
g = global;
|
|
827
689
|
g.fetch = jest.fn().mockRejectedValueOnce(new Error('network fail'));
|
|
828
690
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
829
691
|
offlineCb = windowEventSpy.mock.calls[1][1];
|
|
830
|
-
|
|
692
|
+
_context20.next = 6;
|
|
831
693
|
return offlineCb();
|
|
832
694
|
case 6:
|
|
833
695
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Network connectivity probe failed'), {
|
|
@@ -838,20 +700,20 @@ describe('CallingClient Tests', function () {
|
|
|
838
700
|
expect(clearKeepaliveSpy).toHaveBeenCalled();
|
|
839
701
|
case 9:
|
|
840
702
|
case "end":
|
|
841
|
-
return
|
|
703
|
+
return _context20.stop();
|
|
842
704
|
}
|
|
843
|
-
},
|
|
705
|
+
}, _callee20);
|
|
844
706
|
})));
|
|
845
|
-
it('window offline handler does not clear keepalive when network is reachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
707
|
+
it('window offline handler does not clear keepalive when network is reachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
846
708
|
var g, clearKeepaliveSpy, offlineCb;
|
|
847
|
-
return _regenerator.default.wrap(function
|
|
848
|
-
while (1) switch (
|
|
709
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
710
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
849
711
|
case 0:
|
|
850
712
|
g = global;
|
|
851
713
|
g.fetch = jest.fn().mockResolvedValueOnce({});
|
|
852
714
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
853
715
|
offlineCb = windowEventSpy.mock.calls[1][1];
|
|
854
|
-
|
|
716
|
+
_context21.next = 6;
|
|
855
717
|
return offlineCb();
|
|
856
718
|
case 6:
|
|
857
719
|
expect(g.fetch).toHaveBeenCalledWith('https://www.google.com/generate_204', expect.any(Object));
|
|
@@ -859,17 +721,17 @@ describe('CallingClient Tests', function () {
|
|
|
859
721
|
expect(clearKeepaliveSpy).not.toHaveBeenCalled();
|
|
860
722
|
case 9:
|
|
861
723
|
case "end":
|
|
862
|
-
return
|
|
724
|
+
return _context21.stop();
|
|
863
725
|
}
|
|
864
|
-
},
|
|
726
|
+
}, _callee21);
|
|
865
727
|
})));
|
|
866
|
-
it('window online handler sets networkUpTimestamp and logs', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
728
|
+
it('window online handler sets networkUpTimestamp and logs', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
867
729
|
var onlineCb;
|
|
868
|
-
return _regenerator.default.wrap(function
|
|
869
|
-
while (1) switch (
|
|
730
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
731
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
870
732
|
case 0:
|
|
871
733
|
onlineCb = windowEventSpy.mock.calls[0][1];
|
|
872
|
-
|
|
734
|
+
_context22.next = 3;
|
|
873
735
|
return onlineCb();
|
|
874
736
|
case 3:
|
|
875
737
|
expect(callingClient['networkUpTimestamp']).toEqual(expect.any(String));
|
|
@@ -879,17 +741,17 @@ describe('CallingClient Tests', function () {
|
|
|
879
741
|
});
|
|
880
742
|
case 5:
|
|
881
743
|
case "end":
|
|
882
|
-
return
|
|
744
|
+
return _context22.stop();
|
|
883
745
|
}
|
|
884
|
-
},
|
|
746
|
+
}, _callee22);
|
|
885
747
|
})));
|
|
886
|
-
it('mercury offline submits metrics and sets timestamp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
748
|
+
it('mercury offline submits metrics and sets timestamp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
887
749
|
var mercuryOfflineCb;
|
|
888
|
-
return _regenerator.default.wrap(function
|
|
889
|
-
while (1) switch (
|
|
750
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
751
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
890
752
|
case 0:
|
|
891
753
|
mercuryOfflineCb = webex.internal.mercury.on.mock.calls[1][1];
|
|
892
|
-
|
|
754
|
+
_context23.next = 3;
|
|
893
755
|
return mercuryOfflineCb();
|
|
894
756
|
case 3:
|
|
895
757
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Mercury down, waiting for connection to be up'), {
|
|
@@ -900,26 +762,26 @@ describe('CallingClient Tests', function () {
|
|
|
900
762
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_DOWN, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), '');
|
|
901
763
|
case 6:
|
|
902
764
|
case "end":
|
|
903
|
-
return
|
|
765
|
+
return _context23.stop();
|
|
904
766
|
}
|
|
905
|
-
},
|
|
767
|
+
}, _callee23);
|
|
906
768
|
})));
|
|
907
|
-
it('handles reconnection with no active calls after network flap, once mercury comes back up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
769
|
+
it('handles reconnection with no active calls after network flap, once mercury comes back up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
908
770
|
var handleConnectionRestoreSpy, mercuryOnlineCb;
|
|
909
|
-
return _regenerator.default.wrap(function
|
|
910
|
-
while (1) switch (
|
|
771
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
772
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
911
773
|
case 0:
|
|
912
774
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
913
775
|
callingClient['isNetworkDown'] = true;
|
|
914
776
|
callingClient['networkDownTimestamp'] = '2023-01-01T00:00:00.000Z';
|
|
915
777
|
callingClient['networkUpTimestamp'] = '2023-01-01T00:01:00.000Z';
|
|
916
778
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
917
|
-
|
|
779
|
+
_context24.next = 7;
|
|
918
780
|
return mercuryOnlineCb();
|
|
919
781
|
case 7:
|
|
920
782
|
// Run the interval once
|
|
921
783
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 100);
|
|
922
|
-
|
|
784
|
+
_context24.next = 10;
|
|
923
785
|
return flushPromises();
|
|
924
786
|
case 10:
|
|
925
787
|
expect(handleConnectionRestoreSpy).toHaveBeenCalledWith(true);
|
|
@@ -935,14 +797,14 @@ describe('CallingClient Tests', function () {
|
|
|
935
797
|
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');
|
|
936
798
|
case 18:
|
|
937
799
|
case "end":
|
|
938
|
-
return
|
|
800
|
+
return _context24.stop();
|
|
939
801
|
}
|
|
940
|
-
},
|
|
802
|
+
}, _callee24);
|
|
941
803
|
})));
|
|
942
|
-
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
|
|
804
|
+
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 _callee25() {
|
|
943
805
|
var handleConnectionRestoreSpy, mercuryOnlineCb;
|
|
944
|
-
return _regenerator.default.wrap(function
|
|
945
|
-
while (1) switch (
|
|
806
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
807
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
946
808
|
case 0:
|
|
947
809
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
948
810
|
callingClient['isNetworkDown'] = true;
|
|
@@ -950,12 +812,12 @@ describe('CallingClient Tests', function () {
|
|
|
950
812
|
callingClient['networkUpTimestamp'] = '2023-01-01T00:01:00.000Z';
|
|
951
813
|
reg.setStatus(_types2.RegistrationStatus.IDLE);
|
|
952
814
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
953
|
-
|
|
815
|
+
_context25.next = 8;
|
|
954
816
|
return mercuryOnlineCb();
|
|
955
817
|
case 8:
|
|
956
818
|
// Run the interval once
|
|
957
819
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 100);
|
|
958
|
-
|
|
820
|
+
_context25.next = 11;
|
|
959
821
|
return flushPromises();
|
|
960
822
|
case 11:
|
|
961
823
|
expect(handleConnectionRestoreSpy).not.toHaveBeenCalledWith(true);
|
|
@@ -971,14 +833,14 @@ describe('CallingClient Tests', function () {
|
|
|
971
833
|
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');
|
|
972
834
|
case 19:
|
|
973
835
|
case "end":
|
|
974
|
-
return
|
|
836
|
+
return _context25.stop();
|
|
975
837
|
}
|
|
976
|
-
},
|
|
838
|
+
}, _callee25);
|
|
977
839
|
})));
|
|
978
|
-
it('handle calls status check once mercury comes back up after a network flap', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
840
|
+
it('handle calls status check once mercury comes back up after a network flap', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
979
841
|
var call, callKeepaliveSpy, deleteSpy, mercuryOnlineCb;
|
|
980
|
-
return _regenerator.default.wrap(function
|
|
981
|
-
while (1) switch (
|
|
842
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
843
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
982
844
|
case 0:
|
|
983
845
|
callingClient['isNetworkDown'] = true;
|
|
984
846
|
call = callingClient['callManager'].createCall();
|
|
@@ -986,11 +848,11 @@ describe('CallingClient Tests', function () {
|
|
|
986
848
|
deleteSpy = jest.spyOn(call, 'delete');
|
|
987
849
|
expect((0, _keys.default)(callingClient['callManager'].getActiveCalls()).length).toBe(1);
|
|
988
850
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
989
|
-
|
|
851
|
+
_context26.next = 8;
|
|
990
852
|
return mercuryOnlineCb();
|
|
991
853
|
case 8:
|
|
992
854
|
expect(callKeepaliveSpy).toHaveBeenCalled();
|
|
993
|
-
|
|
855
|
+
_context26.next = 11;
|
|
994
856
|
return flushPromises();
|
|
995
857
|
case 11:
|
|
996
858
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Call Keepalive failed'), {
|
|
@@ -1003,25 +865,25 @@ describe('CallingClient Tests', function () {
|
|
|
1003
865
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), expect.any(String));
|
|
1004
866
|
case 16:
|
|
1005
867
|
case "end":
|
|
1006
|
-
return
|
|
868
|
+
return _context26.stop();
|
|
1007
869
|
}
|
|
1008
|
-
},
|
|
870
|
+
}, _callee26);
|
|
1009
871
|
})));
|
|
1010
|
-
it('handle calls status check once mercury comes back up with stable network', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
872
|
+
it('handle calls status check once mercury comes back up with stable network', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1011
873
|
var call, callKeepaliveSpy, deleteSpy, mercuryOnlineCb;
|
|
1012
|
-
return _regenerator.default.wrap(function
|
|
1013
|
-
while (1) switch (
|
|
874
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
875
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1014
876
|
case 0:
|
|
1015
877
|
call = callingClient['callManager'].createCall();
|
|
1016
878
|
callKeepaliveSpy = jest.spyOn(call, 'postStatus').mockRejectedValueOnce(new Error('keepalive fail'));
|
|
1017
879
|
deleteSpy = jest.spyOn(call, 'delete');
|
|
1018
880
|
expect((0, _keys.default)(callingClient['callManager'].getActiveCalls()).length).toBe(1);
|
|
1019
881
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
1020
|
-
|
|
882
|
+
_context27.next = 7;
|
|
1021
883
|
return mercuryOnlineCb();
|
|
1022
884
|
case 7:
|
|
1023
885
|
expect(callKeepaliveSpy).toHaveBeenCalled();
|
|
1024
|
-
|
|
886
|
+
_context27.next = 10;
|
|
1025
887
|
return flushPromises();
|
|
1026
888
|
case 10:
|
|
1027
889
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Call Keepalive failed'), {
|
|
@@ -1034,9 +896,9 @@ describe('CallingClient Tests', function () {
|
|
|
1034
896
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_UP, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), expect.any(String));
|
|
1035
897
|
case 15:
|
|
1036
898
|
case "end":
|
|
1037
|
-
return
|
|
899
|
+
return _context27.stop();
|
|
1038
900
|
}
|
|
1039
|
-
},
|
|
901
|
+
}, _callee27);
|
|
1040
902
|
})));
|
|
1041
903
|
});
|
|
1042
904
|
|
|
@@ -1054,15 +916,15 @@ describe('CallingClient Tests', function () {
|
|
|
1054
916
|
});
|
|
1055
917
|
var callingClient;
|
|
1056
918
|
var line;
|
|
1057
|
-
beforeAll(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
919
|
+
beforeAll(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1058
920
|
var calls;
|
|
1059
|
-
return _regenerator.default.wrap(function
|
|
1060
|
-
while (1) switch (
|
|
921
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
922
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1061
923
|
case 0:
|
|
1062
|
-
|
|
924
|
+
_context28.next = 2;
|
|
1063
925
|
return (0, _CallingClient.createClient)(webex);
|
|
1064
926
|
case 2:
|
|
1065
|
-
callingClient =
|
|
927
|
+
callingClient = _context28.sent;
|
|
1066
928
|
line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
|
|
1067
929
|
calls = (0, _values.default)(callManager.getActiveCalls());
|
|
1068
930
|
calls.forEach(function (call) {
|
|
@@ -1070,9 +932,9 @@ describe('CallingClient Tests', function () {
|
|
|
1070
932
|
});
|
|
1071
933
|
case 6:
|
|
1072
934
|
case "end":
|
|
1073
|
-
return
|
|
935
|
+
return _context28.stop();
|
|
1074
936
|
}
|
|
1075
|
-
},
|
|
937
|
+
}, _callee28);
|
|
1076
938
|
})));
|
|
1077
939
|
afterAll(function () {
|
|
1078
940
|
callingClient.removeAllListeners();
|
|
@@ -1155,23 +1017,23 @@ describe('CallingClient Tests', function () {
|
|
|
1155
1017
|
describe('Call Session Event test', function () {
|
|
1156
1018
|
var mockOn = webex.internal.mercury.on;
|
|
1157
1019
|
var callingClient;
|
|
1158
|
-
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1159
|
-
return _regenerator.default.wrap(function
|
|
1160
|
-
while (1) switch (
|
|
1020
|
+
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1021
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1022
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1161
1023
|
case 0:
|
|
1162
|
-
|
|
1024
|
+
_context29.next = 2;
|
|
1163
1025
|
return (0, _CallingClient.createClient)(webex, {
|
|
1164
1026
|
logger: {
|
|
1165
1027
|
level: _types.LOGGER.INFO
|
|
1166
1028
|
}
|
|
1167
1029
|
});
|
|
1168
1030
|
case 2:
|
|
1169
|
-
callingClient =
|
|
1031
|
+
callingClient = _context29.sent;
|
|
1170
1032
|
case 3:
|
|
1171
1033
|
case "end":
|
|
1172
|
-
return
|
|
1034
|
+
return _context29.stop();
|
|
1173
1035
|
}
|
|
1174
|
-
},
|
|
1036
|
+
}, _callee29);
|
|
1175
1037
|
})));
|
|
1176
1038
|
afterEach(function () {
|
|
1177
1039
|
callingClient.removeAllListeners();
|
|
@@ -1272,17 +1134,17 @@ describe('CallingClient Tests', function () {
|
|
|
1272
1134
|
afterAll(function () {
|
|
1273
1135
|
global.RTCPeerConnection = origRTCPeerConnection;
|
|
1274
1136
|
});
|
|
1275
|
-
it('should complete without throwing', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1276
|
-
return _regenerator.default.wrap(function
|
|
1277
|
-
while (1) switch (
|
|
1137
|
+
it('should complete without throwing', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1138
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1139
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1278
1140
|
case 0:
|
|
1279
|
-
|
|
1141
|
+
_context30.next = 2;
|
|
1280
1142
|
return expect((0, _windowsChromiumIceWarmupUtils.default)({})).resolves.not.toThrow();
|
|
1281
1143
|
case 2:
|
|
1282
1144
|
case "end":
|
|
1283
|
-
return
|
|
1145
|
+
return _context30.stop();
|
|
1284
1146
|
}
|
|
1285
|
-
},
|
|
1147
|
+
}, _callee30);
|
|
1286
1148
|
})));
|
|
1287
1149
|
});
|
|
1288
1150
|
});
|