@webex/calling 3.10.0-next.9 → 3.10.0-webex-services-ready.1
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 +118 -124
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +189 -201
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +17 -18
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +14 -14
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +71 -24
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +136 -47
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +135 -137
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +145 -149
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +198 -201
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +168 -168
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +7 -8
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +24 -24
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +650 -606
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +685 -564
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +15 -18
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +113 -113
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/constants.js +5 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +57 -74
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +22 -22
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +657 -526
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +657 -309
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +24 -24
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +20 -20
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +28 -28
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +250 -253
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +60 -60
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +7 -10
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +6 -9
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +6 -8
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +6 -9
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Events/impl/index.js +11 -13
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Metrics/index.js +1 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/SDKConnector/index.js +1 -2
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +126 -127
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +98 -98
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +84 -85
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +58 -61
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +20 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +116 -117
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +140 -140
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/common/Utils.js +195 -165
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +432 -183
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +3 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +3 -3
- package/dist/common/testUtil.js.map +1 -1
- package/dist/module/CallSettings/UcmBackendConnector.js +20 -6
- package/dist/module/CallingClient/calling/call.js +55 -34
- package/dist/module/CallingClient/constants.js +3 -0
- package/dist/module/CallingClient/registration/register.js +82 -2
- package/dist/module/common/Utils.js +27 -3
- package/dist/module/common/constants.js +2 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +4 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +3 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +4 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +6 -0
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +6 -0
- package/dist/types/SDKConnector/types.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/constants.d.ts +2 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -36,7 +36,7 @@ var _registerFixtures = require("./registration/registerFixtures");
|
|
|
36
36
|
var _constants2 = require("../common/constants");
|
|
37
37
|
var _types4 = require("../Metrics/types");
|
|
38
38
|
var _windowsChromiumIceWarmupUtils = _interopRequireDefault(require("./windowsChromiumIceWarmupUtils"));
|
|
39
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
39
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t5 in e) "default" !== _t5 && {}.hasOwnProperty.call(e, _t5) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t5)) && (i.get || i.set) ? o(f, _t5, i) : f[_t5] = e[_t5]); return f; })(e, t); }
|
|
40
40
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
41
41
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable dot-notation */
|
|
42
42
|
global.crypto = {
|
|
@@ -72,22 +72,22 @@ describe('CallingClient Tests', function () {
|
|
|
72
72
|
});
|
|
73
73
|
it('should use default mobius service host when Service URL is invalid', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
74
74
|
var callingClient;
|
|
75
|
-
return _regenerator.default.wrap(function
|
|
75
|
+
return _regenerator.default.wrap(function (_context) {
|
|
76
76
|
while (1) switch (_context.prev = _context.next) {
|
|
77
77
|
case 0:
|
|
78
78
|
webex.internal.services._hostCatalog = _callingClientFixtures.mockCatalogUS;
|
|
79
79
|
webex.internal.services._serviceUrls.mobius = 'invalid-url';
|
|
80
|
-
_context.next =
|
|
80
|
+
_context.next = 1;
|
|
81
81
|
return (0, _CallingClient.createClient)(webex, {
|
|
82
82
|
logger: {
|
|
83
83
|
level: _types.LOGGER.INFO
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
case
|
|
86
|
+
case 1:
|
|
87
87
|
callingClient = _context.sent;
|
|
88
88
|
expect(setLoggerSpy).toHaveBeenCalledTimes(1);
|
|
89
89
|
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.mockUSServiceHosts);
|
|
90
|
-
case
|
|
90
|
+
case 2:
|
|
91
91
|
case "end":
|
|
92
92
|
return _context.stop();
|
|
93
93
|
}
|
|
@@ -95,23 +95,23 @@ describe('CallingClient Tests', function () {
|
|
|
95
95
|
})));
|
|
96
96
|
it('should set mobiusServiceHost correctly when URL is valid', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
97
97
|
var callingClient;
|
|
98
|
-
return _regenerator.default.wrap(function
|
|
98
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
99
99
|
while (1) switch (_context2.prev = _context2.next) {
|
|
100
100
|
case 0:
|
|
101
101
|
webex.internal.services._hostCatalog = _callingClientFixtures.mockCatalogEU;
|
|
102
102
|
webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(_callingClientFixtures.mockEUServiceHosts);
|
|
103
103
|
webex.internal.services['_serviceUrls']['mobius'] = 'https://mobius-eu-central-1.prod.infra.webex.com/api/v1';
|
|
104
|
-
_context2.next =
|
|
104
|
+
_context2.next = 1;
|
|
105
105
|
return (0, _CallingClient.createClient)(webex, {
|
|
106
106
|
logger: {
|
|
107
107
|
level: _types.LOGGER.INFO
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
case
|
|
110
|
+
case 1:
|
|
111
111
|
callingClient = _context2.sent;
|
|
112
112
|
expect(callingClient['mobiusHost']).toBe('https://mobius-eu-central-1.prod.infra.webex.com/api/v1');
|
|
113
113
|
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.mockEUServiceHosts);
|
|
114
|
-
case
|
|
114
|
+
case 2:
|
|
115
115
|
case "end":
|
|
116
116
|
return _context2.stop();
|
|
117
117
|
}
|
|
@@ -130,19 +130,19 @@ describe('CallingClient Tests', function () {
|
|
|
130
130
|
* calling and empty domain value.
|
|
131
131
|
*/
|
|
132
132
|
it('Verify valid calling serviceData with no input sdk config', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
133
|
-
return _regenerator.default.wrap(function
|
|
133
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
134
134
|
while (1) switch (_context4.prev = _context4.next) {
|
|
135
135
|
case 0:
|
|
136
136
|
expect(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
137
|
-
return _regenerator.default.wrap(function
|
|
137
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
138
138
|
while (1) switch (_context3.prev = _context3.next) {
|
|
139
139
|
case 0:
|
|
140
|
-
_context3.next =
|
|
140
|
+
_context3.next = 1;
|
|
141
141
|
return (0, _CallingClient.createClient)(webex);
|
|
142
|
-
case
|
|
142
|
+
case 1:
|
|
143
143
|
callingClient = _context3.sent;
|
|
144
144
|
expect(callingClient).toBeTruthy();
|
|
145
|
-
case
|
|
145
|
+
case 2:
|
|
146
146
|
case "end":
|
|
147
147
|
return _context3.stop();
|
|
148
148
|
}
|
|
@@ -164,7 +164,7 @@ describe('CallingClient Tests', function () {
|
|
|
164
164
|
*/
|
|
165
165
|
it('Verify invalid empty service indicator, empty domain', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
166
166
|
var serviceDataObj;
|
|
167
|
-
return _regenerator.default.wrap(function
|
|
167
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
168
168
|
while (1) switch (_context6.prev = _context6.next) {
|
|
169
169
|
case 0:
|
|
170
170
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -173,23 +173,23 @@ describe('CallingClient Tests', function () {
|
|
|
173
173
|
domain: ''
|
|
174
174
|
};
|
|
175
175
|
expect(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
176
|
-
return _regenerator.default.wrap(function
|
|
176
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
177
177
|
while (1) switch (_context5.prev = _context5.next) {
|
|
178
178
|
case 0:
|
|
179
|
-
_context5.next =
|
|
179
|
+
_context5.next = 1;
|
|
180
180
|
return (0, _CallingClient.createClient)(webex, {
|
|
181
181
|
serviceData: serviceDataObj
|
|
182
182
|
});
|
|
183
|
-
case
|
|
183
|
+
case 1:
|
|
184
184
|
callingClient = _context5.sent;
|
|
185
185
|
expect(callingClient).toBeTruthy();
|
|
186
|
-
case
|
|
186
|
+
case 2:
|
|
187
187
|
case "end":
|
|
188
188
|
return _context5.stop();
|
|
189
189
|
}
|
|
190
190
|
}, _callee5);
|
|
191
191
|
}))).not.toThrow(Error);
|
|
192
|
-
case
|
|
192
|
+
case 1:
|
|
193
193
|
case "end":
|
|
194
194
|
return _context6.stop();
|
|
195
195
|
}
|
|
@@ -205,8 +205,8 @@ describe('CallingClient Tests', function () {
|
|
|
205
205
|
* INDICATOR value MUST MATCH with one of the values in ServiceIndicator enum.
|
|
206
206
|
*/
|
|
207
207
|
it('Verify invalid service indicator, valid domain', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
208
|
-
var serviceDataObj;
|
|
209
|
-
return _regenerator.default.wrap(function
|
|
208
|
+
var serviceDataObj, _t;
|
|
209
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
210
210
|
while (1) switch (_context7.prev = _context7.next) {
|
|
211
211
|
case 0:
|
|
212
212
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -215,25 +215,25 @@ describe('CallingClient Tests', function () {
|
|
|
215
215
|
domain: 'test.example.com'
|
|
216
216
|
};
|
|
217
217
|
_context7.prev = 1;
|
|
218
|
-
_context7.next =
|
|
218
|
+
_context7.next = 2;
|
|
219
219
|
return (0, _CallingClient.createClient)(webex, {
|
|
220
220
|
serviceData: serviceDataObj
|
|
221
221
|
});
|
|
222
|
-
case
|
|
222
|
+
case 2:
|
|
223
223
|
callingClient = _context7.sent;
|
|
224
|
-
_context7.next =
|
|
224
|
+
_context7.next = 4;
|
|
225
225
|
break;
|
|
226
|
-
case
|
|
227
|
-
_context7.prev =
|
|
228
|
-
|
|
229
|
-
expect(
|
|
230
|
-
case
|
|
226
|
+
case 3:
|
|
227
|
+
_context7.prev = 3;
|
|
228
|
+
_t = _context7["catch"](1);
|
|
229
|
+
expect(_t.message).toEqual('Invalid service indicator, Allowed values are: calling, contactcenter and guestcalling');
|
|
230
|
+
case 4:
|
|
231
231
|
expect.assertions(1);
|
|
232
|
-
case
|
|
232
|
+
case 5:
|
|
233
233
|
case "end":
|
|
234
234
|
return _context7.stop();
|
|
235
235
|
}
|
|
236
|
-
}, _callee7, null, [[1,
|
|
236
|
+
}, _callee7, null, [[1, 3]]);
|
|
237
237
|
})));
|
|
238
238
|
|
|
239
239
|
/**
|
|
@@ -246,8 +246,8 @@ describe('CallingClient Tests', function () {
|
|
|
246
246
|
* string then it must be of valid domain type.
|
|
247
247
|
*/
|
|
248
248
|
it('CALLING: verify invalid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
249
|
-
var serviceDataObj;
|
|
250
|
-
return _regenerator.default.wrap(function
|
|
249
|
+
var serviceDataObj, _t2;
|
|
250
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
251
251
|
while (1) switch (_context8.prev = _context8.next) {
|
|
252
252
|
case 0:
|
|
253
253
|
serviceDataObj = {
|
|
@@ -255,25 +255,25 @@ describe('CallingClient Tests', function () {
|
|
|
255
255
|
domain: 'test'
|
|
256
256
|
};
|
|
257
257
|
_context8.prev = 1;
|
|
258
|
-
_context8.next =
|
|
258
|
+
_context8.next = 2;
|
|
259
259
|
return (0, _CallingClient.createClient)(webex, {
|
|
260
260
|
serviceData: serviceDataObj
|
|
261
261
|
});
|
|
262
|
-
case
|
|
262
|
+
case 2:
|
|
263
263
|
callingClient = _context8.sent;
|
|
264
|
-
_context8.next =
|
|
264
|
+
_context8.next = 4;
|
|
265
265
|
break;
|
|
266
|
-
case
|
|
267
|
-
_context8.prev =
|
|
268
|
-
|
|
269
|
-
expect(
|
|
270
|
-
case
|
|
266
|
+
case 3:
|
|
267
|
+
_context8.prev = 3;
|
|
268
|
+
_t2 = _context8["catch"](1);
|
|
269
|
+
expect(_t2.message).toEqual('Invalid service domain.');
|
|
270
|
+
case 4:
|
|
271
271
|
expect.assertions(1);
|
|
272
|
-
case
|
|
272
|
+
case 5:
|
|
273
273
|
case "end":
|
|
274
274
|
return _context8.stop();
|
|
275
275
|
}
|
|
276
|
-
}, _callee8, null, [[1,
|
|
276
|
+
}, _callee8, null, [[1, 3]]);
|
|
277
277
|
})));
|
|
278
278
|
|
|
279
279
|
/**
|
|
@@ -286,7 +286,7 @@ describe('CallingClient Tests', function () {
|
|
|
286
286
|
*/
|
|
287
287
|
it('CALLING: verify valid empty service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
288
288
|
var serviceDataObj;
|
|
289
|
-
return _regenerator.default.wrap(function
|
|
289
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
290
290
|
while (1) switch (_context0.prev = _context0.next) {
|
|
291
291
|
case 0:
|
|
292
292
|
serviceDataObj = {
|
|
@@ -294,23 +294,23 @@ describe('CallingClient Tests', function () {
|
|
|
294
294
|
domain: ''
|
|
295
295
|
};
|
|
296
296
|
expect(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
297
|
-
return _regenerator.default.wrap(function
|
|
297
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
298
298
|
while (1) switch (_context9.prev = _context9.next) {
|
|
299
299
|
case 0:
|
|
300
|
-
_context9.next =
|
|
300
|
+
_context9.next = 1;
|
|
301
301
|
return (0, _CallingClient.createClient)(webex, {
|
|
302
302
|
serviceData: serviceDataObj
|
|
303
303
|
});
|
|
304
|
-
case
|
|
304
|
+
case 1:
|
|
305
305
|
callingClient = _context9.sent;
|
|
306
306
|
expect(callingClient).toBeTruthy();
|
|
307
|
-
case
|
|
307
|
+
case 2:
|
|
308
308
|
case "end":
|
|
309
309
|
return _context9.stop();
|
|
310
310
|
}
|
|
311
311
|
}, _callee9);
|
|
312
312
|
}))).not.toThrow(Error);
|
|
313
|
-
case
|
|
313
|
+
case 1:
|
|
314
314
|
case "end":
|
|
315
315
|
return _context0.stop();
|
|
316
316
|
}
|
|
@@ -326,8 +326,8 @@ describe('CallingClient Tests', function () {
|
|
|
326
326
|
* DOMAIN field for service type 'contactcenter' must carry a non-empty valid domain type string.
|
|
327
327
|
*/
|
|
328
328
|
it('ContactCenter: verify empty invalid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
329
|
-
var serviceDataObj;
|
|
330
|
-
return _regenerator.default.wrap(function
|
|
329
|
+
var serviceDataObj, _t3;
|
|
330
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
331
331
|
while (1) switch (_context1.prev = _context1.next) {
|
|
332
332
|
case 0:
|
|
333
333
|
serviceDataObj = {
|
|
@@ -335,25 +335,25 @@ describe('CallingClient Tests', function () {
|
|
|
335
335
|
domain: ''
|
|
336
336
|
};
|
|
337
337
|
_context1.prev = 1;
|
|
338
|
-
_context1.next =
|
|
338
|
+
_context1.next = 2;
|
|
339
339
|
return (0, _CallingClient.createClient)(webex, {
|
|
340
340
|
serviceData: serviceDataObj
|
|
341
341
|
});
|
|
342
|
-
case
|
|
342
|
+
case 2:
|
|
343
343
|
callingClient = _context1.sent;
|
|
344
|
-
_context1.next =
|
|
344
|
+
_context1.next = 4;
|
|
345
345
|
break;
|
|
346
|
-
case
|
|
347
|
-
_context1.prev =
|
|
348
|
-
|
|
349
|
-
expect(
|
|
350
|
-
case
|
|
346
|
+
case 3:
|
|
347
|
+
_context1.prev = 3;
|
|
348
|
+
_t3 = _context1["catch"](1);
|
|
349
|
+
expect(_t3.message).toEqual('Invalid service domain.');
|
|
350
|
+
case 4:
|
|
351
351
|
expect.assertions(1);
|
|
352
|
-
case
|
|
352
|
+
case 5:
|
|
353
353
|
case "end":
|
|
354
354
|
return _context1.stop();
|
|
355
355
|
}
|
|
356
|
-
}, _callee1, null, [[1,
|
|
356
|
+
}, _callee1, null, [[1, 3]]);
|
|
357
357
|
})));
|
|
358
358
|
|
|
359
359
|
/**
|
|
@@ -366,7 +366,7 @@ describe('CallingClient Tests', function () {
|
|
|
366
366
|
*/
|
|
367
367
|
it('ContactCenter: verify valid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
368
368
|
var serviceDataObj;
|
|
369
|
-
return _regenerator.default.wrap(function
|
|
369
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
370
370
|
while (1) switch (_context11.prev = _context11.next) {
|
|
371
371
|
case 0:
|
|
372
372
|
serviceDataObj = {
|
|
@@ -374,44 +374,44 @@ describe('CallingClient Tests', function () {
|
|
|
374
374
|
domain: 'test.example.com'
|
|
375
375
|
};
|
|
376
376
|
expect(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
377
|
-
return _regenerator.default.wrap(function
|
|
377
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
378
378
|
while (1) switch (_context10.prev = _context10.next) {
|
|
379
379
|
case 0:
|
|
380
|
-
_context10.next =
|
|
380
|
+
_context10.next = 1;
|
|
381
381
|
return (0, _CallingClient.createClient)(webex, {
|
|
382
382
|
serviceData: serviceDataObj
|
|
383
383
|
});
|
|
384
|
-
case
|
|
384
|
+
case 1:
|
|
385
385
|
callingClient = _context10.sent;
|
|
386
386
|
expect(callingClient).toBeTruthy();
|
|
387
|
-
case
|
|
387
|
+
case 2:
|
|
388
388
|
case "end":
|
|
389
389
|
return _context10.stop();
|
|
390
390
|
}
|
|
391
391
|
}, _callee10);
|
|
392
392
|
}))).not.toThrow(Error);
|
|
393
|
-
case
|
|
393
|
+
case 1:
|
|
394
394
|
case "end":
|
|
395
395
|
return _context11.stop();
|
|
396
396
|
}
|
|
397
397
|
}, _callee11);
|
|
398
398
|
})));
|
|
399
399
|
it('Get current log level', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
400
|
-
return _regenerator.default.wrap(function
|
|
400
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
401
401
|
while (1) switch (_context12.prev = _context12.next) {
|
|
402
402
|
case 0:
|
|
403
|
-
_context12.next =
|
|
403
|
+
_context12.next = 1;
|
|
404
404
|
return (0, _CallingClient.createClient)(webex, {
|
|
405
405
|
logger: {
|
|
406
406
|
level: _types.LOGGER.INFO
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
|
-
case
|
|
409
|
+
case 1:
|
|
410
410
|
callingClient = _context12.sent;
|
|
411
411
|
expect(callingClient).toBeTruthy();
|
|
412
412
|
expect(callingClient.getLoggingLevel).toBeTruthy();
|
|
413
413
|
expect(callingClient.getLoggingLevel()).toEqual(_types.LOGGER.INFO);
|
|
414
|
-
case
|
|
414
|
+
case 2:
|
|
415
415
|
case "end":
|
|
416
416
|
return _context12.stop();
|
|
417
417
|
}
|
|
@@ -429,17 +429,17 @@ describe('CallingClient Tests', function () {
|
|
|
429
429
|
jest.useRealTimers();
|
|
430
430
|
});
|
|
431
431
|
it('verify successful mobius server url discovery', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
432
|
-
return _regenerator.default.wrap(function
|
|
432
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
433
433
|
while (1) switch (_context13.prev = _context13.next) {
|
|
434
434
|
case 0:
|
|
435
435
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
436
|
-
_context13.next =
|
|
436
|
+
_context13.next = 1;
|
|
437
437
|
return (0, _CallingClient.createClient)(webex, {
|
|
438
438
|
logger: {
|
|
439
439
|
level: _types.LOGGER.INFO
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
|
-
case
|
|
442
|
+
case 1:
|
|
443
443
|
callingClient = _context13.sent;
|
|
444
444
|
expect(webex.request).toBeCalledTimes(2);
|
|
445
445
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
@@ -455,7 +455,7 @@ describe('CallingClient Tests', function () {
|
|
|
455
455
|
}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
456
456
|
uri: "".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT, "?regionCode=").concat(_callingClientFixtures.regionBody.clientRegion, "&countryCode=").concat(_callingClientFixtures.regionBody.countryCode)
|
|
457
457
|
}));
|
|
458
|
-
case
|
|
458
|
+
case 2:
|
|
459
459
|
case "end":
|
|
460
460
|
return _context13.stop();
|
|
461
461
|
}
|
|
@@ -463,20 +463,20 @@ describe('CallingClient Tests', function () {
|
|
|
463
463
|
})));
|
|
464
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() {
|
|
465
465
|
var failurePayload;
|
|
466
|
-
return _regenerator.default.wrap(function
|
|
466
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
467
467
|
while (1) switch (_context14.prev = _context14.next) {
|
|
468
468
|
case 0:
|
|
469
469
|
failurePayload = {
|
|
470
470
|
statusCode: 401
|
|
471
471
|
};
|
|
472
472
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
|
|
473
|
-
_context14.next =
|
|
473
|
+
_context14.next = 1;
|
|
474
474
|
return (0, _CallingClient.createClient)(webex, {
|
|
475
475
|
logger: {
|
|
476
476
|
level: _types.LOGGER.INFO
|
|
477
477
|
}
|
|
478
478
|
});
|
|
479
|
-
case
|
|
479
|
+
case 1:
|
|
480
480
|
callingClient = _context14.sent;
|
|
481
481
|
expect(handleErrorSpy).toBeCalledWith(failurePayload, expect.anything(), {
|
|
482
482
|
file: _constants.CALLING_CLIENT_FILE,
|
|
@@ -494,19 +494,19 @@ describe('CallingClient Tests', function () {
|
|
|
494
494
|
file: _constants.CALLING_CLIENT_FILE,
|
|
495
495
|
method: 'getMobiusServers'
|
|
496
496
|
}));
|
|
497
|
-
case
|
|
497
|
+
case 2:
|
|
498
498
|
case "end":
|
|
499
499
|
return _context14.stop();
|
|
500
500
|
}
|
|
501
501
|
}, _callee14);
|
|
502
502
|
})));
|
|
503
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
|
|
504
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
505
505
|
while (1) switch (_context15.prev = _context15.next) {
|
|
506
506
|
case 0:
|
|
507
507
|
infoSpy.mockReset();
|
|
508
508
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
509
|
-
_context15.next =
|
|
509
|
+
_context15.next = 1;
|
|
510
510
|
return (0, _CallingClient.createClient)(webex, {
|
|
511
511
|
discovery: {
|
|
512
512
|
region: 'AP-SOUTHEAST',
|
|
@@ -516,7 +516,7 @@ describe('CallingClient Tests', function () {
|
|
|
516
516
|
level: _types.LOGGER.INFO
|
|
517
517
|
}
|
|
518
518
|
});
|
|
519
|
-
case
|
|
519
|
+
case 1:
|
|
520
520
|
callingClient = _context15.sent;
|
|
521
521
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
522
522
|
expect(infoSpy).toHaveBeenCalledWith(_constants2.METHOD_START_MESSAGE, {
|
|
@@ -528,7 +528,7 @@ describe('CallingClient Tests', function () {
|
|
|
528
528
|
method: 'GET'
|
|
529
529
|
}));
|
|
530
530
|
expect(handleErrorSpy).not.toHaveBeenCalled();
|
|
531
|
-
case
|
|
531
|
+
case 2:
|
|
532
532
|
case "end":
|
|
533
533
|
return _context15.stop();
|
|
534
534
|
}
|
|
@@ -540,21 +540,21 @@ describe('CallingClient Tests', function () {
|
|
|
540
540
|
var checkCluster = /*#__PURE__*/function () {
|
|
541
541
|
var _ref16 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(mockServiceHosts, mockCatalog) {
|
|
542
542
|
var callingClient;
|
|
543
|
-
return _regenerator.default.wrap(function
|
|
543
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
544
544
|
while (1) switch (_context16.prev = _context16.next) {
|
|
545
545
|
case 0:
|
|
546
546
|
webex.internal.services._hostCatalog = mockCatalog;
|
|
547
547
|
webex.internal.services.getMobiusClusters = jest.fn().mockReturnValue(mockServiceHosts);
|
|
548
|
-
_context16.next =
|
|
548
|
+
_context16.next = 1;
|
|
549
549
|
return (0, _CallingClient.createClient)(webex, {
|
|
550
550
|
logger: {
|
|
551
551
|
level: _types.LOGGER.INFO
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
|
-
case
|
|
554
|
+
case 1:
|
|
555
555
|
callingClient = _context16.sent;
|
|
556
556
|
expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
|
|
557
|
-
case
|
|
557
|
+
case 2:
|
|
558
558
|
case "end":
|
|
559
559
|
return _context16.stop();
|
|
560
560
|
}
|
|
@@ -566,24 +566,25 @@ describe('CallingClient Tests', function () {
|
|
|
566
566
|
}();
|
|
567
567
|
it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
|
|
568
568
|
var _ref17 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(clusterName) {
|
|
569
|
-
|
|
569
|
+
var _t4;
|
|
570
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
570
571
|
while (1) switch (_context17.prev = _context17.next) {
|
|
571
572
|
case 0:
|
|
572
|
-
|
|
573
|
-
_context17.next =
|
|
573
|
+
_t4 = clusterName;
|
|
574
|
+
_context17.next = _t4 === 'mobius-eu-central-1.prod.infra.webex.com' ? 1 : _t4 === 'mobius-us-east-1.int.infra.webex.com' ? 2 : _t4 === 'mobius-eu-central-1.int.infra.webex.com' ? 3 : 4;
|
|
574
575
|
break;
|
|
575
|
-
case
|
|
576
|
+
case 1:
|
|
576
577
|
checkCluster(_callingClientFixtures.mockEUServiceHosts, _callingClientFixtures.mockCatalogEU);
|
|
577
|
-
return _context17.abrupt("
|
|
578
|
-
case
|
|
578
|
+
return _context17.abrupt("continue", 5);
|
|
579
|
+
case 2:
|
|
579
580
|
checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
|
|
580
|
-
return _context17.abrupt("
|
|
581
|
-
case
|
|
581
|
+
return _context17.abrupt("continue", 5);
|
|
582
|
+
case 3:
|
|
582
583
|
checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
|
|
583
|
-
return _context17.abrupt("
|
|
584
|
-
case
|
|
585
|
-
return _context17.abrupt("
|
|
586
|
-
case
|
|
584
|
+
return _context17.abrupt("continue", 5);
|
|
585
|
+
case 4:
|
|
586
|
+
return _context17.abrupt("continue", 5);
|
|
587
|
+
case 5:
|
|
587
588
|
case "end":
|
|
588
589
|
return _context17.stop();
|
|
589
590
|
}
|
|
@@ -598,15 +599,15 @@ describe('CallingClient Tests', function () {
|
|
|
598
599
|
var callingClient;
|
|
599
600
|
var line;
|
|
600
601
|
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
601
|
-
return _regenerator.default.wrap(function
|
|
602
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
602
603
|
while (1) switch (_context18.prev = _context18.next) {
|
|
603
604
|
case 0:
|
|
604
|
-
_context18.next =
|
|
605
|
+
_context18.next = 1;
|
|
605
606
|
return (0, _CallingClient.createClient)(webex);
|
|
606
|
-
case
|
|
607
|
+
case 1:
|
|
607
608
|
callingClient = _context18.sent;
|
|
608
609
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
609
|
-
case
|
|
610
|
+
case 2:
|
|
610
611
|
case "end":
|
|
611
612
|
return _context18.stop();
|
|
612
613
|
}
|
|
@@ -641,31 +642,31 @@ describe('CallingClient Tests', function () {
|
|
|
641
642
|
var registerSpy;
|
|
642
643
|
var metricSpy;
|
|
643
644
|
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
644
|
-
return _regenerator.default.wrap(function
|
|
645
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
645
646
|
while (1) switch (_context19.prev = _context19.next) {
|
|
646
647
|
case 0:
|
|
647
648
|
jest.useFakeTimers();
|
|
648
649
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload).mockResolvedValueOnce(_callingClientFixtures.registrationPayload);
|
|
649
650
|
windowEventSpy = jest.spyOn(window, 'addEventListener');
|
|
650
|
-
_context19.next =
|
|
651
|
+
_context19.next = 1;
|
|
651
652
|
return (0, _CallingClient.createClient)(webex, {
|
|
652
653
|
logger: {
|
|
653
654
|
level: _types.LOGGER.INFO
|
|
654
655
|
}
|
|
655
656
|
});
|
|
656
|
-
case
|
|
657
|
+
case 1:
|
|
657
658
|
callingClient = _context19.sent;
|
|
658
659
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
659
660
|
reg = line.registration;
|
|
660
|
-
_context19.next =
|
|
661
|
+
_context19.next = 2;
|
|
661
662
|
return line.register();
|
|
662
|
-
case
|
|
663
|
+
case 2:
|
|
663
664
|
deRegSpy = jest.spyOn(reg, 'deregister');
|
|
664
665
|
restoreSpy = jest.spyOn(reg, 'restorePreviousRegistration');
|
|
665
666
|
restartRegisterSpy = jest.spyOn(reg, 'restartRegistration');
|
|
666
667
|
registerSpy = jest.spyOn(reg, 'attemptRegistrationWithServers');
|
|
667
668
|
metricSpy = jest.spyOn(callingClient['metricManager'], 'submitConnectionMetrics');
|
|
668
|
-
case
|
|
669
|
+
case 3:
|
|
669
670
|
case "end":
|
|
670
671
|
return _context19.stop();
|
|
671
672
|
}
|
|
@@ -682,23 +683,23 @@ describe('CallingClient Tests', function () {
|
|
|
682
683
|
});
|
|
683
684
|
it('window offline handler sets networkDown and clears keepalive when network is unreachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
684
685
|
var g, clearKeepaliveSpy, offlineCb;
|
|
685
|
-
return _regenerator.default.wrap(function
|
|
686
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
686
687
|
while (1) switch (_context20.prev = _context20.next) {
|
|
687
688
|
case 0:
|
|
688
689
|
g = global;
|
|
689
690
|
g.fetch = jest.fn().mockRejectedValueOnce(new Error('network fail'));
|
|
690
691
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
691
692
|
offlineCb = windowEventSpy.mock.calls[1][1];
|
|
692
|
-
_context20.next =
|
|
693
|
+
_context20.next = 1;
|
|
693
694
|
return offlineCb();
|
|
694
|
-
case
|
|
695
|
+
case 1:
|
|
695
696
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Network connectivity probe failed'), {
|
|
696
697
|
file: _constants.CALLING_CLIENT_FILE,
|
|
697
698
|
method: 'pingExternal'
|
|
698
699
|
});
|
|
699
700
|
expect(callingClient['isNetworkDown']).toBe(true);
|
|
700
701
|
expect(clearKeepaliveSpy).toHaveBeenCalled();
|
|
701
|
-
case
|
|
702
|
+
case 2:
|
|
702
703
|
case "end":
|
|
703
704
|
return _context20.stop();
|
|
704
705
|
}
|
|
@@ -706,20 +707,20 @@ describe('CallingClient Tests', function () {
|
|
|
706
707
|
})));
|
|
707
708
|
it('window offline handler does not clear keepalive when network is reachable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
708
709
|
var g, clearKeepaliveSpy, offlineCb;
|
|
709
|
-
return _regenerator.default.wrap(function
|
|
710
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
710
711
|
while (1) switch (_context21.prev = _context21.next) {
|
|
711
712
|
case 0:
|
|
712
713
|
g = global;
|
|
713
714
|
g.fetch = jest.fn().mockResolvedValueOnce({});
|
|
714
715
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
715
716
|
offlineCb = windowEventSpy.mock.calls[1][1];
|
|
716
|
-
_context21.next =
|
|
717
|
+
_context21.next = 1;
|
|
717
718
|
return offlineCb();
|
|
718
|
-
case
|
|
719
|
+
case 1:
|
|
719
720
|
expect(g.fetch).toHaveBeenCalledWith('https://www.google.com/generate_204', expect.any(Object));
|
|
720
721
|
expect(callingClient['isNetworkDown']).toBe(false);
|
|
721
722
|
expect(clearKeepaliveSpy).not.toHaveBeenCalled();
|
|
722
|
-
case
|
|
723
|
+
case 2:
|
|
723
724
|
case "end":
|
|
724
725
|
return _context21.stop();
|
|
725
726
|
}
|
|
@@ -727,19 +728,19 @@ describe('CallingClient Tests', function () {
|
|
|
727
728
|
})));
|
|
728
729
|
it('window online handler sets networkUpTimestamp and logs', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
729
730
|
var onlineCb;
|
|
730
|
-
return _regenerator.default.wrap(function
|
|
731
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
731
732
|
while (1) switch (_context22.prev = _context22.next) {
|
|
732
733
|
case 0:
|
|
733
734
|
onlineCb = windowEventSpy.mock.calls[0][1];
|
|
734
|
-
_context22.next =
|
|
735
|
+
_context22.next = 1;
|
|
735
736
|
return onlineCb();
|
|
736
|
-
case
|
|
737
|
+
case 1:
|
|
737
738
|
expect(callingClient['networkUpTimestamp']).toEqual(expect.any(String));
|
|
738
739
|
expect(infoSpy).toHaveBeenCalledWith(_constants2.METHOD_START_MESSAGE, {
|
|
739
740
|
file: _constants.CALLING_CLIENT_FILE,
|
|
740
741
|
method: 'handleNetworkOnline'
|
|
741
742
|
});
|
|
742
|
-
case
|
|
743
|
+
case 2:
|
|
743
744
|
case "end":
|
|
744
745
|
return _context22.stop();
|
|
745
746
|
}
|
|
@@ -747,20 +748,20 @@ describe('CallingClient Tests', function () {
|
|
|
747
748
|
})));
|
|
748
749
|
it('mercury offline submits metrics and sets timestamp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
749
750
|
var mercuryOfflineCb;
|
|
750
|
-
return _regenerator.default.wrap(function
|
|
751
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
751
752
|
while (1) switch (_context23.prev = _context23.next) {
|
|
752
753
|
case 0:
|
|
753
754
|
mercuryOfflineCb = webex.internal.mercury.on.mock.calls[1][1];
|
|
754
|
-
_context23.next =
|
|
755
|
+
_context23.next = 1;
|
|
755
756
|
return mercuryOfflineCb();
|
|
756
|
-
case
|
|
757
|
+
case 1:
|
|
757
758
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Mercury down, waiting for connection to be up'), {
|
|
758
759
|
file: _constants.CALLING_CLIENT_FILE,
|
|
759
760
|
method: 'handleMercuryOffline'
|
|
760
761
|
});
|
|
761
762
|
expect(callingClient['mercuryDownTimestamp']).toEqual(expect.any(String));
|
|
762
763
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_DOWN, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), '');
|
|
763
|
-
case
|
|
764
|
+
case 2:
|
|
764
765
|
case "end":
|
|
765
766
|
return _context23.stop();
|
|
766
767
|
}
|
|
@@ -768,7 +769,7 @@ describe('CallingClient Tests', function () {
|
|
|
768
769
|
})));
|
|
769
770
|
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() {
|
|
770
771
|
var handleConnectionRestoreSpy, mercuryOnlineCb;
|
|
771
|
-
return _regenerator.default.wrap(function
|
|
772
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
772
773
|
while (1) switch (_context24.prev = _context24.next) {
|
|
773
774
|
case 0:
|
|
774
775
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
@@ -776,14 +777,14 @@ describe('CallingClient Tests', function () {
|
|
|
776
777
|
callingClient['networkDownTimestamp'] = '2023-01-01T00:00:00.000Z';
|
|
777
778
|
callingClient['networkUpTimestamp'] = '2023-01-01T00:01:00.000Z';
|
|
778
779
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
779
|
-
_context24.next =
|
|
780
|
+
_context24.next = 1;
|
|
780
781
|
return mercuryOnlineCb();
|
|
781
|
-
case
|
|
782
|
+
case 1:
|
|
782
783
|
// Run the interval once
|
|
783
784
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 100);
|
|
784
|
-
_context24.next =
|
|
785
|
+
_context24.next = 2;
|
|
785
786
|
return flushPromises();
|
|
786
|
-
case
|
|
787
|
+
case 2:
|
|
787
788
|
expect(handleConnectionRestoreSpy).toHaveBeenCalledWith(true);
|
|
788
789
|
expect(logSpy).toHaveBeenCalledWith('Network is up again, re-registering with Webex Calling if needed', {
|
|
789
790
|
file: _constants.REGISTRATION_FILE,
|
|
@@ -795,7 +796,7 @@ describe('CallingClient Tests', function () {
|
|
|
795
796
|
expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [reg.getActiveMobiusUrl()]);
|
|
796
797
|
expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
797
798
|
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');
|
|
798
|
-
case
|
|
799
|
+
case 3:
|
|
799
800
|
case "end":
|
|
800
801
|
return _context24.stop();
|
|
801
802
|
}
|
|
@@ -803,7 +804,7 @@ describe('CallingClient Tests', function () {
|
|
|
803
804
|
})));
|
|
804
805
|
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() {
|
|
805
806
|
var handleConnectionRestoreSpy, mercuryOnlineCb;
|
|
806
|
-
return _regenerator.default.wrap(function
|
|
807
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
807
808
|
while (1) switch (_context25.prev = _context25.next) {
|
|
808
809
|
case 0:
|
|
809
810
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
@@ -812,14 +813,14 @@ describe('CallingClient Tests', function () {
|
|
|
812
813
|
callingClient['networkUpTimestamp'] = '2023-01-01T00:01:00.000Z';
|
|
813
814
|
reg.setStatus(_types2.RegistrationStatus.IDLE);
|
|
814
815
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
815
|
-
_context25.next =
|
|
816
|
+
_context25.next = 1;
|
|
816
817
|
return mercuryOnlineCb();
|
|
817
|
-
case
|
|
818
|
+
case 1:
|
|
818
819
|
// Run the interval once
|
|
819
820
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 100);
|
|
820
|
-
_context25.next =
|
|
821
|
+
_context25.next = 2;
|
|
821
822
|
return flushPromises();
|
|
822
|
-
case
|
|
823
|
+
case 2:
|
|
823
824
|
expect(handleConnectionRestoreSpy).not.toHaveBeenCalledWith(true);
|
|
824
825
|
expect(logSpy).not.toHaveBeenCalledWith('Network is up again, re-registering with Webex Calling if needed', {
|
|
825
826
|
file: _constants.REGISTRATION_FILE,
|
|
@@ -831,7 +832,7 @@ describe('CallingClient Tests', function () {
|
|
|
831
832
|
expect(registerSpy).not.toHaveBeenCalledWith('handleConnectionRestoration', [reg.getActiveMobiusUrl()]);
|
|
832
833
|
expect(registerSpy).not.toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
833
834
|
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');
|
|
834
|
-
case
|
|
835
|
+
case 3:
|
|
835
836
|
case "end":
|
|
836
837
|
return _context25.stop();
|
|
837
838
|
}
|
|
@@ -839,7 +840,7 @@ describe('CallingClient Tests', function () {
|
|
|
839
840
|
})));
|
|
840
841
|
it('handle calls status check once mercury comes back up after a network flap', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
841
842
|
var call, callKeepaliveSpy, deleteSpy, mercuryOnlineCb;
|
|
842
|
-
return _regenerator.default.wrap(function
|
|
843
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
843
844
|
while (1) switch (_context26.prev = _context26.next) {
|
|
844
845
|
case 0:
|
|
845
846
|
callingClient['isNetworkDown'] = true;
|
|
@@ -848,13 +849,13 @@ describe('CallingClient Tests', function () {
|
|
|
848
849
|
deleteSpy = jest.spyOn(call, 'delete');
|
|
849
850
|
expect((0, _keys.default)(callingClient['callManager'].getActiveCalls()).length).toBe(1);
|
|
850
851
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
851
|
-
_context26.next =
|
|
852
|
+
_context26.next = 1;
|
|
852
853
|
return mercuryOnlineCb();
|
|
853
|
-
case
|
|
854
|
+
case 1:
|
|
854
855
|
expect(callKeepaliveSpy).toHaveBeenCalled();
|
|
855
|
-
_context26.next =
|
|
856
|
+
_context26.next = 2;
|
|
856
857
|
return flushPromises();
|
|
857
|
-
case
|
|
858
|
+
case 2:
|
|
858
859
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Call Keepalive failed'), {
|
|
859
860
|
file: _constants.CALLING_CLIENT_FILE,
|
|
860
861
|
method: 'checkCallStatus'
|
|
@@ -863,7 +864,7 @@ describe('CallingClient Tests', function () {
|
|
|
863
864
|
expect(deleteSpy).toHaveBeenCalled();
|
|
864
865
|
expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(0);
|
|
865
866
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.NETWORK_FLAP, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), expect.any(String));
|
|
866
|
-
case
|
|
867
|
+
case 3:
|
|
867
868
|
case "end":
|
|
868
869
|
return _context26.stop();
|
|
869
870
|
}
|
|
@@ -871,7 +872,7 @@ describe('CallingClient Tests', function () {
|
|
|
871
872
|
})));
|
|
872
873
|
it('handle calls status check once mercury comes back up with stable network', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
873
874
|
var call, callKeepaliveSpy, deleteSpy, mercuryOnlineCb;
|
|
874
|
-
return _regenerator.default.wrap(function
|
|
875
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
875
876
|
while (1) switch (_context27.prev = _context27.next) {
|
|
876
877
|
case 0:
|
|
877
878
|
call = callingClient['callManager'].createCall();
|
|
@@ -879,13 +880,13 @@ describe('CallingClient Tests', function () {
|
|
|
879
880
|
deleteSpy = jest.spyOn(call, 'delete');
|
|
880
881
|
expect((0, _keys.default)(callingClient['callManager'].getActiveCalls()).length).toBe(1);
|
|
881
882
|
mercuryOnlineCb = webex.internal.mercury.on.mock.calls[2][1];
|
|
882
|
-
_context27.next =
|
|
883
|
+
_context27.next = 1;
|
|
883
884
|
return mercuryOnlineCb();
|
|
884
|
-
case
|
|
885
|
+
case 1:
|
|
885
886
|
expect(callKeepaliveSpy).toHaveBeenCalled();
|
|
886
|
-
_context27.next =
|
|
887
|
+
_context27.next = 2;
|
|
887
888
|
return flushPromises();
|
|
888
|
-
case
|
|
889
|
+
case 2:
|
|
889
890
|
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Call Keepalive failed'), {
|
|
890
891
|
file: _constants.CALLING_CLIENT_FILE,
|
|
891
892
|
method: 'checkCallStatus'
|
|
@@ -894,7 +895,7 @@ describe('CallingClient Tests', function () {
|
|
|
894
895
|
expect(deleteSpy).toHaveBeenCalled();
|
|
895
896
|
expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(0);
|
|
896
897
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CONNECTION_ERROR, _types4.CONNECTION_ACTION.MERCURY_UP, _types4.METRIC_TYPE.BEHAVIORAL, expect.any(String), expect.any(String));
|
|
897
|
-
case
|
|
898
|
+
case 3:
|
|
898
899
|
case "end":
|
|
899
900
|
return _context27.stop();
|
|
900
901
|
}
|
|
@@ -918,19 +919,19 @@ describe('CallingClient Tests', function () {
|
|
|
918
919
|
var line;
|
|
919
920
|
beforeAll(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
920
921
|
var calls;
|
|
921
|
-
return _regenerator.default.wrap(function
|
|
922
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
922
923
|
while (1) switch (_context28.prev = _context28.next) {
|
|
923
924
|
case 0:
|
|
924
|
-
_context28.next =
|
|
925
|
+
_context28.next = 1;
|
|
925
926
|
return (0, _CallingClient.createClient)(webex);
|
|
926
|
-
case
|
|
927
|
+
case 1:
|
|
927
928
|
callingClient = _context28.sent;
|
|
928
929
|
line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
|
|
929
930
|
calls = (0, _values.default)(callManager.getActiveCalls());
|
|
930
931
|
calls.forEach(function (call) {
|
|
931
932
|
call.end();
|
|
932
933
|
});
|
|
933
|
-
case
|
|
934
|
+
case 2:
|
|
934
935
|
case "end":
|
|
935
936
|
return _context28.stop();
|
|
936
937
|
}
|
|
@@ -1018,18 +1019,18 @@ describe('CallingClient Tests', function () {
|
|
|
1018
1019
|
var mockOn = webex.internal.mercury.on;
|
|
1019
1020
|
var callingClient;
|
|
1020
1021
|
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1021
|
-
return _regenerator.default.wrap(function
|
|
1022
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1022
1023
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1023
1024
|
case 0:
|
|
1024
|
-
_context29.next =
|
|
1025
|
+
_context29.next = 1;
|
|
1025
1026
|
return (0, _CallingClient.createClient)(webex, {
|
|
1026
1027
|
logger: {
|
|
1027
1028
|
level: _types.LOGGER.INFO
|
|
1028
1029
|
}
|
|
1029
1030
|
});
|
|
1030
|
-
case
|
|
1031
|
+
case 1:
|
|
1031
1032
|
callingClient = _context29.sent;
|
|
1032
|
-
case
|
|
1033
|
+
case 2:
|
|
1033
1034
|
case "end":
|
|
1034
1035
|
return _context29.stop();
|
|
1035
1036
|
}
|
|
@@ -1063,19 +1064,19 @@ describe('CallingClient Tests', function () {
|
|
|
1063
1064
|
describe('windowsChromiumIceWarmup', function () {
|
|
1064
1065
|
var origRTCPeerConnection;
|
|
1065
1066
|
beforeAll(function () {
|
|
1066
|
-
var
|
|
1067
|
+
var _Class;
|
|
1067
1068
|
origRTCPeerConnection = global.RTCPeerConnection;
|
|
1068
1069
|
// Minimal mock for RTCPeerConnection
|
|
1069
|
-
global.RTCPeerConnection = (
|
|
1070
|
-
function
|
|
1071
|
-
(0, _classCallCheck2.default)(this,
|
|
1070
|
+
global.RTCPeerConnection = (_Class = /*#__PURE__*/function () {
|
|
1071
|
+
function _Class() {
|
|
1072
|
+
(0, _classCallCheck2.default)(this, _Class);
|
|
1072
1073
|
(0, _defineProperty2.default)(this, "iceGatheringState", 'complete');
|
|
1073
1074
|
(0, _defineProperty2.default)(this, "localDescription", null);
|
|
1074
1075
|
(0, _defineProperty2.default)(this, "remoteDescription", null);
|
|
1075
1076
|
(0, _defineProperty2.default)(this, "onicecandidate", null);
|
|
1076
1077
|
this.constructor.instances.push(this);
|
|
1077
1078
|
}
|
|
1078
|
-
(0, _createClass2.default)(
|
|
1079
|
+
return (0, _createClass2.default)(_Class, [{
|
|
1079
1080
|
key: "createDataChannel",
|
|
1080
1081
|
value: function createDataChannel() {
|
|
1081
1082
|
return {};
|
|
@@ -1128,19 +1129,18 @@ describe('CallingClient Tests', function () {
|
|
|
1128
1129
|
key: "removeEventListener",
|
|
1129
1130
|
value: function removeEventListener() {}
|
|
1130
1131
|
}]);
|
|
1131
|
-
|
|
1132
|
-
}(), (0, _defineProperty2.default)(_class, "instances", []), _class);
|
|
1132
|
+
}(), (0, _defineProperty2.default)(_Class, "instances", []), _Class);
|
|
1133
1133
|
});
|
|
1134
1134
|
afterAll(function () {
|
|
1135
1135
|
global.RTCPeerConnection = origRTCPeerConnection;
|
|
1136
1136
|
});
|
|
1137
1137
|
it('should complete without throwing', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1138
|
-
return _regenerator.default.wrap(function
|
|
1138
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1139
1139
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1140
1140
|
case 0:
|
|
1141
|
-
_context30.next =
|
|
1141
|
+
_context30.next = 1;
|
|
1142
1142
|
return expect((0, _windowsChromiumIceWarmupUtils.default)({})).resolves.not.toThrow();
|
|
1143
|
-
case
|
|
1143
|
+
case 1:
|
|
1144
1144
|
case "end":
|
|
1145
1145
|
return _context30.stop();
|
|
1146
1146
|
}
|