@webex/calling 3.9.0 → 3.10.0-multi-llms.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 +43 -43
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +157 -152
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +8 -8
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +1 -1
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +12 -11
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +11 -11
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +53 -52
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +112 -110
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallSettings/testFixtures.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +458 -203
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +458 -315
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/callRecordFixtures.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
- package/dist/CallingClient/calling/call.js +406 -373
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +482 -415
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +3 -4
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +68 -69
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/index.js.map +1 -1
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +9 -6
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +10 -11
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +10 -9
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/index.js.map +1 -1
- package/dist/CallingClient/registration/register.js +285 -205
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +251 -180
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +25 -10
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +85 -38
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +142 -0
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +244 -247
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +93 -93
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/constants.js +2 -2
- package/dist/Contacts/constants.js.map +1 -1
- package/dist/Contacts/contactFixtures.js.map +1 -1
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +2 -2
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +3 -3
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +2 -2
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Errors/index.js.map +1 -1
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/impl/index.js +3 -3
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Logger/index.js +3 -3
- package/dist/Logger/index.js.map +1 -1
- package/dist/Logger/index.test.js +1 -1
- package/dist/Logger/index.test.js.map +1 -1
- package/dist/Logger/types.js.map +1 -1
- package/dist/Metrics/index.js +221 -104
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +112 -23
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +15 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/index.js +0 -1
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/index.test.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/SDKConnector/utils.js.map +1 -1
- package/dist/SDKConnector/utils.test.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +55 -61
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +129 -122
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +53 -50
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +89 -113
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +2 -2
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +87 -92
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +228 -203
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/constants.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/Voicemail/voicemailFixture.js.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +85 -66
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +113 -123
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +1 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +17 -8
- package/dist/module/CallSettings/UcmBackendConnector.js +2 -2
- package/dist/module/CallSettings/WxCallBackendConnector.js +14 -14
- package/dist/module/CallingClient/CallingClient.js +176 -36
- package/dist/module/CallingClient/calling/call.js +92 -62
- package/dist/module/CallingClient/constants.js +8 -4
- package/dist/module/CallingClient/line/index.js +3 -3
- package/dist/module/CallingClient/registration/register.js +37 -13
- package/dist/module/CallingClient/registration/webWorker.js +17 -3
- package/dist/module/CallingClient/registration/webWorkerStr.js +19 -3
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
- package/dist/module/Contacts/ContactsClient.js +33 -37
- package/dist/module/Contacts/constants.js +1 -1
- package/dist/module/Events/impl/index.js +1 -1
- package/dist/module/Logger/index.js +2 -2
- package/dist/module/Metrics/index.js +142 -55
- package/dist/module/Metrics/types.js +14 -0
- package/dist/module/Voicemail/BroadworksBackendConnector.js +10 -17
- package/dist/module/Voicemail/UcmBackendConnector.js +11 -10
- package/dist/module/Voicemail/Voicemail.js +42 -68
- package/dist/module/Voicemail/WxCallBackendConnector.js +22 -28
- package/dist/module/common/Utils.js +29 -12
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +12 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +2 -1
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +8 -4
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +1 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/constants.d.ts +1 -1
- package/dist/types/Contacts/constants.d.ts.map +1 -1
- package/dist/types/Logger/index.d.ts +1 -2
- package/dist/types/Logger/index.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +18 -3
- package/dist/types/Metrics/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/Voicemail/Voicemail.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +1 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +10 -8
|
@@ -26,8 +26,7 @@ var _callManager = require("./callManager");
|
|
|
26
26
|
var _Logger = _interopRequireDefault(require("../../Logger"));
|
|
27
27
|
var _Errors = require("../../Errors");
|
|
28
28
|
var _constants2 = require("../../common/constants");
|
|
29
|
-
function
|
|
30
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
30
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
32
31
|
/* eslint-disable dot-notation */
|
|
33
32
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
@@ -135,7 +134,7 @@ describe('Call Tests', function () {
|
|
|
135
134
|
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
136
135
|
expect(call).toBeTruthy();
|
|
137
136
|
});
|
|
138
|
-
it('should log a warning when sending a digit fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
137
|
+
it('should log a warning when sending a digit fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
139
138
|
var tone, errorMessage, mockMediaConnection, callManager, call, realMediaConnection, warnSpy, infoSpy;
|
|
140
139
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
141
140
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -185,7 +184,7 @@ describe('Call Tests', function () {
|
|
|
185
184
|
}
|
|
186
185
|
}, _callee);
|
|
187
186
|
})));
|
|
188
|
-
it('delete call object when ending the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
187
|
+
it('delete call object when ending the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
189
188
|
var callManager, mockStream, localAudioStream, call, infoSpy;
|
|
190
189
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
191
190
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -243,7 +242,7 @@ describe('Call Tests', function () {
|
|
|
243
242
|
}
|
|
244
243
|
}, _callee2);
|
|
245
244
|
})));
|
|
246
|
-
it('Check whether media requests succeed or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
245
|
+
it('Check whether media requests succeed or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
247
246
|
var mediaResponse, call, response;
|
|
248
247
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
249
248
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -280,7 +279,7 @@ describe('Call Tests', function () {
|
|
|
280
279
|
}
|
|
281
280
|
}, _callee3);
|
|
282
281
|
})));
|
|
283
|
-
it('check whether callerId midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
282
|
+
it('check whether callerId midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
284
283
|
var call;
|
|
285
284
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
286
285
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -299,7 +298,7 @@ describe('Call Tests', function () {
|
|
|
299
298
|
}
|
|
300
299
|
}, _callee4);
|
|
301
300
|
})));
|
|
302
|
-
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
301
|
+
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
303
302
|
var call, logSpy, corelationId;
|
|
304
303
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
305
304
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -322,7 +321,7 @@ describe('Call Tests', function () {
|
|
|
322
321
|
}
|
|
323
322
|
}, _callee5);
|
|
324
323
|
})));
|
|
325
|
-
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
324
|
+
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
326
325
|
var call, callRtpStats;
|
|
327
326
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
328
327
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -347,7 +346,7 @@ describe('Call Tests', function () {
|
|
|
347
346
|
}
|
|
348
347
|
}, _callee6, null, [[1, 7]]);
|
|
349
348
|
})));
|
|
350
|
-
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
349
|
+
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
351
350
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, logSpy;
|
|
352
351
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
353
352
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -387,7 +386,7 @@ describe('Call Tests', function () {
|
|
|
387
386
|
}
|
|
388
387
|
}, _callee7);
|
|
389
388
|
})));
|
|
390
|
-
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
389
|
+
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
391
390
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, infoSpy;
|
|
392
391
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
393
392
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -428,7 +427,7 @@ describe('Call Tests', function () {
|
|
|
428
427
|
}
|
|
429
428
|
}, _callee8);
|
|
430
429
|
})));
|
|
431
|
-
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
430
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
432
431
|
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
433
432
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
434
433
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -502,10 +501,10 @@ describe('Call Tests', function () {
|
|
|
502
501
|
}
|
|
503
502
|
}, _callee9);
|
|
504
503
|
})));
|
|
505
|
-
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
504
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
506
505
|
var mockStream, localAudioStream, warnSpy, call;
|
|
507
|
-
return _regenerator.default.wrap(function
|
|
508
|
-
while (1) switch (
|
|
506
|
+
return _regenerator.default.wrap(function _callee0$(_context0) {
|
|
507
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
509
508
|
case 0:
|
|
510
509
|
mockStream = {
|
|
511
510
|
outputStream: {
|
|
@@ -529,7 +528,7 @@ describe('Call Tests', function () {
|
|
|
529
528
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
530
529
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
531
530
|
call.answer(localAudioStream);
|
|
532
|
-
|
|
531
|
+
_context0.next = 8;
|
|
533
532
|
return (0, _Utils.waitForMsecs)(50);
|
|
534
533
|
case 8:
|
|
535
534
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -544,14 +543,14 @@ describe('Call Tests', function () {
|
|
|
544
543
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
545
544
|
case 15:
|
|
546
545
|
case "end":
|
|
547
|
-
return
|
|
546
|
+
return _context0.stop();
|
|
548
547
|
}
|
|
549
|
-
},
|
|
548
|
+
}, _callee0);
|
|
550
549
|
})));
|
|
551
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
550
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
552
551
|
var mockStream, localAudioStream, warnSpy, call;
|
|
553
|
-
return _regenerator.default.wrap(function
|
|
554
|
-
while (1) switch (
|
|
552
|
+
return _regenerator.default.wrap(function _callee1$(_context1) {
|
|
553
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
555
554
|
case 0:
|
|
556
555
|
mockStream = {
|
|
557
556
|
outputStream: {
|
|
@@ -563,7 +562,7 @@ describe('Call Tests', function () {
|
|
|
563
562
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
564
563
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
565
564
|
call.dial(localAudioStream);
|
|
566
|
-
|
|
565
|
+
_context1.next = 7;
|
|
567
566
|
return (0, _Utils.waitForMsecs)(50);
|
|
568
567
|
case 7:
|
|
569
568
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -576,9 +575,9 @@ describe('Call Tests', function () {
|
|
|
576
575
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
577
576
|
case 12:
|
|
578
577
|
case "end":
|
|
579
|
-
return
|
|
578
|
+
return _context1.stop();
|
|
580
579
|
}
|
|
581
|
-
},
|
|
580
|
+
}, _callee1);
|
|
582
581
|
})));
|
|
583
582
|
it('update media after call creation with valid stream', function () {
|
|
584
583
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -652,10 +651,10 @@ describe('Call Tests', function () {
|
|
|
652
651
|
method: 'dial'
|
|
653
652
|
});
|
|
654
653
|
});
|
|
655
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
654
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
656
655
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
657
|
-
return _regenerator.default.wrap(function
|
|
658
|
-
while (1) switch (
|
|
656
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
657
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
659
658
|
case 0:
|
|
660
659
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
661
660
|
webex.request.mockReturnValue({
|
|
@@ -731,9 +730,9 @@ describe('Call Tests', function () {
|
|
|
731
730
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
732
731
|
case 37:
|
|
733
732
|
case "end":
|
|
734
|
-
return
|
|
733
|
+
return _context10.stop();
|
|
735
734
|
}
|
|
736
|
-
},
|
|
735
|
+
}, _callee10);
|
|
737
736
|
})));
|
|
738
737
|
describe('Guest Calling Flow Tests', function () {
|
|
739
738
|
var dummyEvent = {
|
|
@@ -741,10 +740,10 @@ describe('Call Tests', function () {
|
|
|
741
740
|
data: undefined
|
|
742
741
|
};
|
|
743
742
|
var call;
|
|
744
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
743
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
745
744
|
var requestSpy, requestArgs;
|
|
746
|
-
return _regenerator.default.wrap(function
|
|
747
|
-
while (1) switch (
|
|
745
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
746
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
748
747
|
case 0:
|
|
749
748
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
750
749
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -757,14 +756,14 @@ describe('Call Tests', function () {
|
|
|
757
756
|
expect('callee' in requestArgs.body).toBe(true);
|
|
758
757
|
case 6:
|
|
759
758
|
case "end":
|
|
760
|
-
return
|
|
759
|
+
return _context11.stop();
|
|
761
760
|
}
|
|
762
|
-
},
|
|
761
|
+
}, _callee11);
|
|
763
762
|
})));
|
|
764
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
763
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
765
764
|
var requestSpy, requestArgs;
|
|
766
|
-
return _regenerator.default.wrap(function
|
|
767
|
-
while (1) switch (
|
|
765
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
766
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
768
767
|
case 0:
|
|
769
768
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
770
769
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -777,9 +776,9 @@ describe('Call Tests', function () {
|
|
|
777
776
|
expect('callee' in requestArgs.body).toBe(false);
|
|
778
777
|
case 6:
|
|
779
778
|
case "end":
|
|
780
|
-
return
|
|
779
|
+
return _context12.stop();
|
|
781
780
|
}
|
|
782
|
-
},
|
|
781
|
+
}, _callee12);
|
|
783
782
|
})));
|
|
784
783
|
});
|
|
785
784
|
});
|
|
@@ -812,10 +811,10 @@ describe('State Machine handler tests', function () {
|
|
|
812
811
|
|
|
813
812
|
// afterEach(() => call.removeAllListeners());
|
|
814
813
|
|
|
815
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
814
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
816
815
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
817
|
-
return _regenerator.default.wrap(function
|
|
818
|
-
while (1) switch (
|
|
816
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
817
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
819
818
|
case 0:
|
|
820
819
|
statusPayload = {
|
|
821
820
|
statusCode: 200,
|
|
@@ -835,7 +834,7 @@ describe('State Machine handler tests', function () {
|
|
|
835
834
|
/* This is to flush all the promises from the Promise queue so that
|
|
836
835
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
837
836
|
*/
|
|
838
|
-
|
|
837
|
+
_context13.next = 11;
|
|
839
838
|
return (0, _testUtil.flushPromises)(3);
|
|
840
839
|
case 11:
|
|
841
840
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -850,14 +849,14 @@ describe('State Machine handler tests', function () {
|
|
|
850
849
|
});
|
|
851
850
|
case 15:
|
|
852
851
|
case "end":
|
|
853
|
-
return
|
|
852
|
+
return _context13.stop();
|
|
854
853
|
}
|
|
855
|
-
},
|
|
854
|
+
}, _callee13);
|
|
856
855
|
})));
|
|
857
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
856
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
858
857
|
var statusPayload, funcSpy;
|
|
859
|
-
return _regenerator.default.wrap(function
|
|
860
|
-
while (1) switch (
|
|
858
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
859
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
861
860
|
case 0:
|
|
862
861
|
expect.assertions(4);
|
|
863
862
|
statusPayload = {
|
|
@@ -881,24 +880,24 @@ describe('State Machine handler tests', function () {
|
|
|
881
880
|
/* This is to flush all the promises from the Promise queue so that
|
|
882
881
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
883
882
|
*/
|
|
884
|
-
|
|
883
|
+
_context14.next = 11;
|
|
885
884
|
return _promise.default.resolve();
|
|
886
885
|
case 11:
|
|
887
|
-
|
|
886
|
+
_context14.next = 13;
|
|
888
887
|
return _promise.default.resolve();
|
|
889
888
|
case 13:
|
|
890
|
-
expect(clearInterval).toHaveBeenCalledTimes(
|
|
889
|
+
expect(clearInterval).toHaveBeenCalledTimes(2); // check this
|
|
891
890
|
expect(funcSpy).toBeCalledTimes(1);
|
|
892
891
|
case 15:
|
|
893
892
|
case "end":
|
|
894
|
-
return
|
|
893
|
+
return _context14.stop();
|
|
895
894
|
}
|
|
896
|
-
},
|
|
895
|
+
}, _callee14);
|
|
897
896
|
})));
|
|
898
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
897
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
899
898
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
900
|
-
return _regenerator.default.wrap(function
|
|
901
|
-
while (1) switch (
|
|
899
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
900
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
902
901
|
case 0:
|
|
903
902
|
statusPayload = {
|
|
904
903
|
statusCode: 200,
|
|
@@ -954,14 +953,14 @@ describe('State Machine handler tests', function () {
|
|
|
954
953
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
955
954
|
case 27:
|
|
956
955
|
case "end":
|
|
957
|
-
return
|
|
956
|
+
return _context15.stop();
|
|
958
957
|
}
|
|
959
|
-
},
|
|
958
|
+
}, _callee15);
|
|
960
959
|
})));
|
|
961
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
960
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
962
961
|
var statusPayload, dummyEvent;
|
|
963
|
-
return _regenerator.default.wrap(function
|
|
964
|
-
while (1) switch (
|
|
962
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
963
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
965
964
|
case 0:
|
|
966
965
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
967
966
|
statusPayload = {
|
|
@@ -979,7 +978,7 @@ describe('State Machine handler tests', function () {
|
|
|
979
978
|
webex.request.mockReturnValue(statusPayload);
|
|
980
979
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
981
980
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
982
|
-
|
|
981
|
+
_context16.next = 8;
|
|
983
982
|
return call['handleOutgoingCallConnect']({
|
|
984
983
|
type: 'E_SEND_CALL_CONNECT'
|
|
985
984
|
});
|
|
@@ -993,14 +992,14 @@ describe('State Machine handler tests', function () {
|
|
|
993
992
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
994
993
|
case 12:
|
|
995
994
|
case "end":
|
|
996
|
-
return
|
|
995
|
+
return _context16.stop();
|
|
997
996
|
}
|
|
998
|
-
},
|
|
997
|
+
}, _callee16);
|
|
999
998
|
})));
|
|
1000
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
999
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
1001
1000
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1002
|
-
return _regenerator.default.wrap(function
|
|
1003
|
-
while (1) switch (
|
|
1001
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
1002
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1004
1003
|
case 0:
|
|
1005
1004
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1006
1005
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1027,7 +1026,7 @@ describe('State Machine handler tests', function () {
|
|
|
1027
1026
|
webex.request.mockRejectedValueOnce({
|
|
1028
1027
|
statusCode: 403
|
|
1029
1028
|
}).mockResolvedValue(statusPayload);
|
|
1030
|
-
|
|
1029
|
+
_context17.next = 13;
|
|
1031
1030
|
return call['handleOutgoingCallConnect']({
|
|
1032
1031
|
type: 'E_SEND_CALL_CONNECT'
|
|
1033
1032
|
});
|
|
@@ -1038,14 +1037,14 @@ describe('State Machine handler tests', function () {
|
|
|
1038
1037
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1039
1038
|
case 17:
|
|
1040
1039
|
case "end":
|
|
1041
|
-
return
|
|
1040
|
+
return _context17.stop();
|
|
1042
1041
|
}
|
|
1043
|
-
},
|
|
1042
|
+
}, _callee17);
|
|
1044
1043
|
})));
|
|
1045
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1044
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
1046
1045
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1047
|
-
return _regenerator.default.wrap(function
|
|
1048
|
-
while (1) switch (
|
|
1046
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1047
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1049
1048
|
case 0:
|
|
1050
1049
|
statusPayload = {
|
|
1051
1050
|
statusCode: 200,
|
|
@@ -1121,14 +1120,14 @@ describe('State Machine handler tests', function () {
|
|
|
1121
1120
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1122
1121
|
case 42:
|
|
1123
1122
|
case "end":
|
|
1124
|
-
return
|
|
1123
|
+
return _context18.stop();
|
|
1125
1124
|
}
|
|
1126
|
-
},
|
|
1125
|
+
}, _callee18);
|
|
1127
1126
|
})));
|
|
1128
|
-
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1127
|
+
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1129
1128
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1130
|
-
return _regenerator.default.wrap(function
|
|
1131
|
-
while (1) switch (
|
|
1129
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1130
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1132
1131
|
case 0:
|
|
1133
1132
|
statusPayload = {
|
|
1134
1133
|
statusCode: 200,
|
|
@@ -1196,14 +1195,14 @@ describe('State Machine handler tests', function () {
|
|
|
1196
1195
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1197
1196
|
case 25:
|
|
1198
1197
|
case "end":
|
|
1199
|
-
return
|
|
1198
|
+
return _context19.stop();
|
|
1200
1199
|
}
|
|
1201
|
-
},
|
|
1200
|
+
}, _callee19);
|
|
1202
1201
|
})));
|
|
1203
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1202
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1204
1203
|
var statusPayload, dummyEvent;
|
|
1205
|
-
return _regenerator.default.wrap(function
|
|
1206
|
-
while (1) switch (
|
|
1204
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1205
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1207
1206
|
case 0:
|
|
1208
1207
|
statusPayload = {
|
|
1209
1208
|
statusCode: 200,
|
|
@@ -1242,14 +1241,14 @@ describe('State Machine handler tests', function () {
|
|
|
1242
1241
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1243
1242
|
case 17:
|
|
1244
1243
|
case "end":
|
|
1245
|
-
return
|
|
1244
|
+
return _context20.stop();
|
|
1246
1245
|
}
|
|
1247
|
-
},
|
|
1246
|
+
}, _callee20);
|
|
1248
1247
|
})));
|
|
1249
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1248
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1250
1249
|
var statusPayload, dummyEvent, errorSpy;
|
|
1251
|
-
return _regenerator.default.wrap(function
|
|
1252
|
-
while (1) switch (
|
|
1250
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
1251
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1253
1252
|
case 0:
|
|
1254
1253
|
statusPayload = {
|
|
1255
1254
|
statusCode: 403,
|
|
@@ -1266,7 +1265,7 @@ describe('State Machine handler tests', function () {
|
|
|
1266
1265
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1267
1266
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1268
1267
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1269
|
-
|
|
1268
|
+
_context21.next = 7;
|
|
1270
1269
|
return (0, _testUtil.flushPromises)(3);
|
|
1271
1270
|
case 7:
|
|
1272
1271
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
@@ -1277,14 +1276,14 @@ describe('State Machine handler tests', function () {
|
|
|
1277
1276
|
});
|
|
1278
1277
|
case 10:
|
|
1279
1278
|
case "end":
|
|
1280
|
-
return
|
|
1279
|
+
return _context21.stop();
|
|
1281
1280
|
}
|
|
1282
|
-
},
|
|
1281
|
+
}, _callee21);
|
|
1283
1282
|
})));
|
|
1284
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1283
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1285
1284
|
var statusPayload, dummyEvent, warnSpy;
|
|
1286
|
-
return _regenerator.default.wrap(function
|
|
1287
|
-
while (1) switch (
|
|
1285
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
1286
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1288
1287
|
case 0:
|
|
1289
1288
|
statusPayload = {
|
|
1290
1289
|
statusCode: 403,
|
|
@@ -1303,33 +1302,33 @@ describe('State Machine handler tests', function () {
|
|
|
1303
1302
|
webex.request.mockRejectedValue(statusPayload);
|
|
1304
1303
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1305
1304
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1306
|
-
|
|
1305
|
+
_context22.next = 10;
|
|
1307
1306
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1308
1307
|
case 10:
|
|
1309
|
-
|
|
1308
|
+
_context22.next = 12;
|
|
1310
1309
|
return (0, _testUtil.flushPromises)(2);
|
|
1311
1310
|
case 12:
|
|
1312
1311
|
expect(call.isConnected()).toBe(false);
|
|
1313
|
-
expect(call['mediaStateMachine'].state.value).toBe('
|
|
1314
|
-
expect(call['callStateMachine'].state.value).toBe('
|
|
1312
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1313
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1315
1314
|
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1316
1315
|
file: 'call',
|
|
1317
1316
|
method: 'handleRoapEstablished'
|
|
1318
1317
|
});
|
|
1319
|
-
expect(
|
|
1320
|
-
|
|
1321
|
-
|
|
1318
|
+
expect(warnSpy).toHaveBeenCalledWith('Call failed due to media issue', {
|
|
1319
|
+
file: 'call',
|
|
1320
|
+
method: 'handleRoapError'
|
|
1322
1321
|
});
|
|
1323
1322
|
case 17:
|
|
1324
1323
|
case "end":
|
|
1325
|
-
return
|
|
1324
|
+
return _context22.stop();
|
|
1326
1325
|
}
|
|
1327
|
-
},
|
|
1326
|
+
}, _callee22);
|
|
1328
1327
|
})));
|
|
1329
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1328
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1330
1329
|
var statusPayload, dummyEvent;
|
|
1331
|
-
return _regenerator.default.wrap(function
|
|
1332
|
-
while (1) switch (
|
|
1330
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
1331
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1333
1332
|
case 0:
|
|
1334
1333
|
statusPayload = {
|
|
1335
1334
|
statusCode: 403,
|
|
@@ -1352,14 +1351,14 @@ describe('State Machine handler tests', function () {
|
|
|
1352
1351
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1353
1352
|
case 8:
|
|
1354
1353
|
case "end":
|
|
1355
|
-
return
|
|
1354
|
+
return _context23.stop();
|
|
1356
1355
|
}
|
|
1357
|
-
},
|
|
1356
|
+
}, _callee23);
|
|
1358
1357
|
})));
|
|
1359
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1358
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1360
1359
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1361
|
-
return _regenerator.default.wrap(function
|
|
1362
|
-
while (1) switch (
|
|
1360
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
1361
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1363
1362
|
case 0:
|
|
1364
1363
|
statusPayload = {
|
|
1365
1364
|
statusCode: 503,
|
|
@@ -1381,7 +1380,7 @@ describe('State Machine handler tests', function () {
|
|
|
1381
1380
|
}
|
|
1382
1381
|
};
|
|
1383
1382
|
call['connected'] = true;
|
|
1384
|
-
|
|
1383
|
+
_context24.next = 8;
|
|
1385
1384
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1386
1385
|
case 8:
|
|
1387
1386
|
jest.advanceTimersByTime(1005);
|
|
@@ -1393,14 +1392,14 @@ describe('State Machine handler tests', function () {
|
|
|
1393
1392
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1394
1393
|
case 13:
|
|
1395
1394
|
case "end":
|
|
1396
|
-
return
|
|
1395
|
+
return _context24.stop();
|
|
1397
1396
|
}
|
|
1398
|
-
},
|
|
1397
|
+
}, _callee24);
|
|
1399
1398
|
})));
|
|
1400
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1399
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1401
1400
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1402
|
-
return _regenerator.default.wrap(function
|
|
1403
|
-
while (1) switch (
|
|
1401
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
1402
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1404
1403
|
case 0:
|
|
1405
1404
|
statusPayload = {
|
|
1406
1405
|
statusCode: 503,
|
|
@@ -1422,7 +1421,7 @@ describe('State Machine handler tests', function () {
|
|
|
1422
1421
|
}
|
|
1423
1422
|
};
|
|
1424
1423
|
call['connected'] = false;
|
|
1425
|
-
|
|
1424
|
+
_context25.next = 8;
|
|
1426
1425
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1427
1426
|
case 8:
|
|
1428
1427
|
jest.advanceTimersByTime(1005);
|
|
@@ -1433,14 +1432,14 @@ describe('State Machine handler tests', function () {
|
|
|
1433
1432
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1434
1433
|
case 12:
|
|
1435
1434
|
case "end":
|
|
1436
|
-
return
|
|
1435
|
+
return _context25.stop();
|
|
1437
1436
|
}
|
|
1438
|
-
},
|
|
1437
|
+
}, _callee25);
|
|
1439
1438
|
})));
|
|
1440
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1439
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1441
1440
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1442
|
-
return _regenerator.default.wrap(function
|
|
1443
|
-
while (1) switch (
|
|
1441
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
1442
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1444
1443
|
case 0:
|
|
1445
1444
|
statusPayload = {
|
|
1446
1445
|
statusCode: 503,
|
|
@@ -1462,7 +1461,7 @@ describe('State Machine handler tests', function () {
|
|
|
1462
1461
|
};
|
|
1463
1462
|
call['connected'] = true;
|
|
1464
1463
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1465
|
-
|
|
1464
|
+
_context26.next = 9;
|
|
1466
1465
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1467
1466
|
case 9:
|
|
1468
1467
|
jest.advanceTimersByTime(1005);
|
|
@@ -1474,14 +1473,14 @@ describe('State Machine handler tests', function () {
|
|
|
1474
1473
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1475
1474
|
case 14:
|
|
1476
1475
|
case "end":
|
|
1477
|
-
return
|
|
1476
|
+
return _context26.stop();
|
|
1478
1477
|
}
|
|
1479
|
-
},
|
|
1478
|
+
}, _callee26);
|
|
1480
1479
|
})));
|
|
1481
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1480
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1482
1481
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1483
|
-
return _regenerator.default.wrap(function
|
|
1484
|
-
while (1) switch (
|
|
1482
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
1483
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1485
1484
|
case 0:
|
|
1486
1485
|
statusPayload = {
|
|
1487
1486
|
statusCode: 503,
|
|
@@ -1502,7 +1501,7 @@ describe('State Machine handler tests', function () {
|
|
|
1502
1501
|
}
|
|
1503
1502
|
};
|
|
1504
1503
|
call['connected'] = false;
|
|
1505
|
-
|
|
1504
|
+
_context27.next = 8;
|
|
1506
1505
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1507
1506
|
case 8:
|
|
1508
1507
|
jest.advanceTimersByTime(1005);
|
|
@@ -1514,14 +1513,14 @@ describe('State Machine handler tests', function () {
|
|
|
1514
1513
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1515
1514
|
case 13:
|
|
1516
1515
|
case "end":
|
|
1517
|
-
return
|
|
1516
|
+
return _context27.stop();
|
|
1518
1517
|
}
|
|
1519
|
-
},
|
|
1518
|
+
}, _callee27);
|
|
1520
1519
|
})));
|
|
1521
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1520
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1522
1521
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1523
|
-
return _regenerator.default.wrap(function
|
|
1524
|
-
while (1) switch (
|
|
1522
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
1523
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1525
1524
|
case 0:
|
|
1526
1525
|
statusPayload = {
|
|
1527
1526
|
statusCode: 200,
|
|
@@ -1546,14 +1545,14 @@ describe('State Machine handler tests', function () {
|
|
|
1546
1545
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1547
1546
|
case 11:
|
|
1548
1547
|
case "end":
|
|
1549
|
-
return
|
|
1548
|
+
return _context28.stop();
|
|
1550
1549
|
}
|
|
1551
|
-
},
|
|
1550
|
+
}, _callee28);
|
|
1552
1551
|
})));
|
|
1553
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1552
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1554
1553
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1555
|
-
return _regenerator.default.wrap(function
|
|
1556
|
-
while (1) switch (
|
|
1554
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1555
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1557
1556
|
case 0:
|
|
1558
1557
|
statusPayload = {
|
|
1559
1558
|
statusCode: 503,
|
|
@@ -1575,7 +1574,7 @@ describe('State Machine handler tests', function () {
|
|
|
1575
1574
|
};
|
|
1576
1575
|
call['connected'] = true;
|
|
1577
1576
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1578
|
-
|
|
1577
|
+
_context29.next = 9;
|
|
1579
1578
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1580
1579
|
case 9:
|
|
1581
1580
|
jest.advanceTimersByTime(1005);
|
|
@@ -1587,14 +1586,14 @@ describe('State Machine handler tests', function () {
|
|
|
1587
1586
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1588
1587
|
case 14:
|
|
1589
1588
|
case "end":
|
|
1590
|
-
return
|
|
1589
|
+
return _context29.stop();
|
|
1591
1590
|
}
|
|
1592
|
-
},
|
|
1591
|
+
}, _callee29);
|
|
1593
1592
|
})));
|
|
1594
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1593
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1595
1594
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1596
|
-
return _regenerator.default.wrap(function
|
|
1597
|
-
while (1) switch (
|
|
1595
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1596
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1598
1597
|
case 0:
|
|
1599
1598
|
statusPayload = {
|
|
1600
1599
|
statusCode: 403,
|
|
@@ -1617,14 +1616,14 @@ describe('State Machine handler tests', function () {
|
|
|
1617
1616
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1618
1617
|
case 9:
|
|
1619
1618
|
case "end":
|
|
1620
|
-
return
|
|
1619
|
+
return _context30.stop();
|
|
1621
1620
|
}
|
|
1622
|
-
},
|
|
1621
|
+
}, _callee30);
|
|
1623
1622
|
})));
|
|
1624
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1623
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1625
1624
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1626
|
-
return _regenerator.default.wrap(function
|
|
1627
|
-
while (1) switch (
|
|
1625
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
1626
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1628
1627
|
case 0:
|
|
1629
1628
|
statusPayload = {
|
|
1630
1629
|
statusCode: 200,
|
|
@@ -1642,7 +1641,7 @@ describe('State Machine handler tests', function () {
|
|
|
1642
1641
|
}
|
|
1643
1642
|
};
|
|
1644
1643
|
call['connected'] = false;
|
|
1645
|
-
|
|
1644
|
+
_context31.next = 8;
|
|
1646
1645
|
return call['handleRoapError']({}, errorEvent);
|
|
1647
1646
|
case 8:
|
|
1648
1647
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1658,14 +1657,80 @@ describe('State Machine handler tests', function () {
|
|
|
1658
1657
|
});
|
|
1659
1658
|
case 11:
|
|
1660
1659
|
case "end":
|
|
1661
|
-
return
|
|
1660
|
+
return _context31.stop();
|
|
1662
1661
|
}
|
|
1663
|
-
},
|
|
1662
|
+
}, _callee31);
|
|
1664
1663
|
})));
|
|
1665
|
-
it('
|
|
1664
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1665
|
+
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1666
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1667
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1668
|
+
case 0:
|
|
1669
|
+
statusPayload = {
|
|
1670
|
+
statusCode: 403,
|
|
1671
|
+
body: mockStatusBody
|
|
1672
|
+
};
|
|
1673
|
+
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1674
|
+
postMediaSpy = jest.spyOn(call, 'postMedia').mockRejectedValueOnce(statusPayload); // Simulate inbound call flow
|
|
1675
|
+
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1676
|
+
setupEvent = {
|
|
1677
|
+
type: 'E_RECV_CALL_SETUP',
|
|
1678
|
+
data: {
|
|
1679
|
+
seq: 1,
|
|
1680
|
+
messageType: 'OFFER'
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
call.sendCallStateMachineEvt(setupEvent);
|
|
1684
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1685
|
+
connectEvent = {
|
|
1686
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
1687
|
+
};
|
|
1688
|
+
call.sendCallStateMachineEvt(connectEvent);
|
|
1689
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
1690
|
+
offerEvent = {
|
|
1691
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
1692
|
+
data: {
|
|
1693
|
+
seq: 1,
|
|
1694
|
+
messageType: 'OFFER'
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
call.sendMediaStateMachineEvt(offerEvent);
|
|
1698
|
+
answerEvent = {
|
|
1699
|
+
type: 'E_SEND_ROAP_ANSWER',
|
|
1700
|
+
data: {
|
|
1701
|
+
seq: 1,
|
|
1702
|
+
messageType: 'ANSWER'
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
_context32.next = 15;
|
|
1706
|
+
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1707
|
+
case 15:
|
|
1708
|
+
_context32.next = 17;
|
|
1709
|
+
return (0, _testUtil.flushPromises)(2);
|
|
1710
|
+
case 17:
|
|
1711
|
+
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
1712
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to send MediaAnswer request', {
|
|
1713
|
+
file: 'call',
|
|
1714
|
+
method: 'handleOutgoingRoapAnswer'
|
|
1715
|
+
});
|
|
1716
|
+
expect(warnSpy).toHaveBeenCalledWith('Call failed due to media issue', {
|
|
1717
|
+
file: 'call',
|
|
1718
|
+
method: 'handleRoapError'
|
|
1719
|
+
});
|
|
1720
|
+
|
|
1721
|
+
// Final state should be torn down and cleared for unconnected call
|
|
1722
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1723
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1724
|
+
case 22:
|
|
1725
|
+
case "end":
|
|
1726
|
+
return _context32.stop();
|
|
1727
|
+
}
|
|
1728
|
+
}, _callee32);
|
|
1729
|
+
})));
|
|
1730
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1666
1731
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1667
|
-
return _regenerator.default.wrap(function
|
|
1668
|
-
while (1) switch (
|
|
1732
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1733
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1669
1734
|
case 0:
|
|
1670
1735
|
statusPayload = {
|
|
1671
1736
|
statusCode: 200,
|
|
@@ -1698,7 +1763,7 @@ describe('State Machine handler tests', function () {
|
|
|
1698
1763
|
seq: 1,
|
|
1699
1764
|
messageType: 'ANSWER'
|
|
1700
1765
|
};
|
|
1701
|
-
|
|
1766
|
+
_context33.next = 17;
|
|
1702
1767
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1703
1768
|
case 17:
|
|
1704
1769
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1720,7 +1785,7 @@ describe('State Machine handler tests', function () {
|
|
|
1720
1785
|
seq: 2,
|
|
1721
1786
|
messageType: 'OFFER_REQUEST'
|
|
1722
1787
|
};
|
|
1723
|
-
|
|
1788
|
+
_context33.next = 23;
|
|
1724
1789
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1725
1790
|
case 23:
|
|
1726
1791
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1770,7 +1835,7 @@ describe('State Machine handler tests', function () {
|
|
|
1770
1835
|
};
|
|
1771
1836
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1772
1837
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1773
|
-
|
|
1838
|
+
_context33.next = 49;
|
|
1774
1839
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1775
1840
|
case 49:
|
|
1776
1841
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1779,7 +1844,7 @@ describe('State Machine handler tests', function () {
|
|
|
1779
1844
|
seq: 3,
|
|
1780
1845
|
messageType: 'ANSWER'
|
|
1781
1846
|
};
|
|
1782
|
-
|
|
1847
|
+
_context33.next = 54;
|
|
1783
1848
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1784
1849
|
case 54:
|
|
1785
1850
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1798,7 +1863,7 @@ describe('State Machine handler tests', function () {
|
|
|
1798
1863
|
messageType: 'OK'
|
|
1799
1864
|
}
|
|
1800
1865
|
};
|
|
1801
|
-
|
|
1866
|
+
_context33.next = 63;
|
|
1802
1867
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1803
1868
|
case 63:
|
|
1804
1869
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1813,14 +1878,14 @@ describe('State Machine handler tests', function () {
|
|
|
1813
1878
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1814
1879
|
case 70:
|
|
1815
1880
|
case "end":
|
|
1816
|
-
return
|
|
1881
|
+
return _context33.stop();
|
|
1817
1882
|
}
|
|
1818
|
-
},
|
|
1883
|
+
}, _callee33);
|
|
1819
1884
|
})));
|
|
1820
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1885
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1821
1886
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1822
|
-
return _regenerator.default.wrap(function
|
|
1823
|
-
while (1) switch (
|
|
1887
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1888
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1824
1889
|
case 0:
|
|
1825
1890
|
mockStatusBody = {
|
|
1826
1891
|
device: {
|
|
@@ -1860,7 +1925,7 @@ describe('State Machine handler tests', function () {
|
|
|
1860
1925
|
seq: 1,
|
|
1861
1926
|
messageType: 'ANSWER'
|
|
1862
1927
|
};
|
|
1863
|
-
|
|
1928
|
+
_context34.next = 18;
|
|
1864
1929
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1865
1930
|
case 18:
|
|
1866
1931
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1882,7 +1947,7 @@ describe('State Machine handler tests', function () {
|
|
|
1882
1947
|
seq: 2,
|
|
1883
1948
|
messageType: 'OFFER_REQUEST'
|
|
1884
1949
|
};
|
|
1885
|
-
|
|
1950
|
+
_context34.next = 24;
|
|
1886
1951
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1887
1952
|
case 24:
|
|
1888
1953
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1932,7 +1997,7 @@ describe('State Machine handler tests', function () {
|
|
|
1932
1997
|
};
|
|
1933
1998
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1934
1999
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1935
|
-
|
|
2000
|
+
_context34.next = 50;
|
|
1936
2001
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1937
2002
|
case 50:
|
|
1938
2003
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1941,7 +2006,7 @@ describe('State Machine handler tests', function () {
|
|
|
1941
2006
|
seq: 3,
|
|
1942
2007
|
messageType: 'ANSWER'
|
|
1943
2008
|
};
|
|
1944
|
-
|
|
2009
|
+
_context34.next = 55;
|
|
1945
2010
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1946
2011
|
case 55:
|
|
1947
2012
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1958,7 +2023,7 @@ describe('State Machine handler tests', function () {
|
|
|
1958
2023
|
}
|
|
1959
2024
|
};
|
|
1960
2025
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1961
|
-
|
|
2026
|
+
_context34.next = 62;
|
|
1962
2027
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1963
2028
|
case 62:
|
|
1964
2029
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1974,14 +2039,14 @@ describe('State Machine handler tests', function () {
|
|
|
1974
2039
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1975
2040
|
case 70:
|
|
1976
2041
|
case "end":
|
|
1977
|
-
return
|
|
2042
|
+
return _context34.stop();
|
|
1978
2043
|
}
|
|
1979
|
-
},
|
|
2044
|
+
}, _callee34);
|
|
1980
2045
|
})));
|
|
1981
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2046
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1982
2047
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1983
|
-
return _regenerator.default.wrap(function
|
|
1984
|
-
while (1) switch (
|
|
2048
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
2049
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1985
2050
|
case 0:
|
|
1986
2051
|
statusPayload = {
|
|
1987
2052
|
statusCode: 200,
|
|
@@ -2048,9 +2113,9 @@ describe('State Machine handler tests', function () {
|
|
|
2048
2113
|
});
|
|
2049
2114
|
case 33:
|
|
2050
2115
|
case "end":
|
|
2051
|
-
return
|
|
2116
|
+
return _context35.stop();
|
|
2052
2117
|
}
|
|
2053
|
-
},
|
|
2118
|
+
}, _callee35);
|
|
2054
2119
|
})));
|
|
2055
2120
|
describe('Call event timers tests', function () {
|
|
2056
2121
|
var callManager;
|
|
@@ -2061,10 +2126,10 @@ describe('State Machine handler tests', function () {
|
|
|
2061
2126
|
afterEach(function () {
|
|
2062
2127
|
jest.clearAllTimers();
|
|
2063
2128
|
});
|
|
2064
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2129
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
2065
2130
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2066
|
-
return _regenerator.default.wrap(function
|
|
2067
|
-
while (1) switch (
|
|
2131
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
2132
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2068
2133
|
case 0:
|
|
2069
2134
|
statusPayload = {
|
|
2070
2135
|
statusCode: 200,
|
|
@@ -2081,7 +2146,7 @@ describe('State Machine handler tests', function () {
|
|
|
2081
2146
|
webex.request.mockReturnValue(statusPayload);
|
|
2082
2147
|
|
|
2083
2148
|
// handleOutgoingCallSetup is asynchronous
|
|
2084
|
-
|
|
2149
|
+
_context36.next = 9;
|
|
2085
2150
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2086
2151
|
case 9:
|
|
2087
2152
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2124,14 +2189,14 @@ describe('State Machine handler tests', function () {
|
|
|
2124
2189
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2125
2190
|
case 32:
|
|
2126
2191
|
case "end":
|
|
2127
|
-
return
|
|
2192
|
+
return _context36.stop();
|
|
2128
2193
|
}
|
|
2129
|
-
},
|
|
2194
|
+
}, _callee36);
|
|
2130
2195
|
})));
|
|
2131
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2196
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
2132
2197
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2133
|
-
return _regenerator.default.wrap(function
|
|
2134
|
-
while (1) switch (
|
|
2198
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
2199
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2135
2200
|
case 0:
|
|
2136
2201
|
statusPayload = {
|
|
2137
2202
|
statusCode: 200,
|
|
@@ -2150,7 +2215,7 @@ describe('State Machine handler tests', function () {
|
|
|
2150
2215
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2151
2216
|
|
|
2152
2217
|
// handleOutgoingCallSetup is asynchronous
|
|
2153
|
-
|
|
2218
|
+
_context37.next = 11;
|
|
2154
2219
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2155
2220
|
case 11:
|
|
2156
2221
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2162,9 +2227,9 @@ describe('State Machine handler tests', function () {
|
|
|
2162
2227
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2163
2228
|
case 18:
|
|
2164
2229
|
case "end":
|
|
2165
|
-
return
|
|
2230
|
+
return _context37.stop();
|
|
2166
2231
|
}
|
|
2167
|
-
},
|
|
2232
|
+
}, _callee37);
|
|
2168
2233
|
})));
|
|
2169
2234
|
});
|
|
2170
2235
|
});
|
|
@@ -2224,10 +2289,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2224
2289
|
beforeEach(function () {
|
|
2225
2290
|
call.removeAllListeners();
|
|
2226
2291
|
});
|
|
2227
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2292
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2228
2293
|
var responsePayload, warnSpy, roapEvent;
|
|
2229
|
-
return _regenerator.default.wrap(function
|
|
2230
|
-
while (1) switch (
|
|
2294
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
2295
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2231
2296
|
case 0:
|
|
2232
2297
|
expect.assertions(7);
|
|
2233
2298
|
responsePayload = {
|
|
@@ -2240,25 +2305,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2240
2305
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2241
2306
|
call['held'] = false;
|
|
2242
2307
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2243
|
-
var
|
|
2244
|
-
return _regenerator.default.wrap(function
|
|
2245
|
-
while (1) switch (
|
|
2308
|
+
var _ref39 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(correlationId) {
|
|
2309
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
2310
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2246
2311
|
case 0:
|
|
2247
2312
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2248
2313
|
case 1:
|
|
2249
2314
|
case "end":
|
|
2250
|
-
return
|
|
2315
|
+
return _context38.stop();
|
|
2251
2316
|
}
|
|
2252
|
-
},
|
|
2317
|
+
}, _callee38);
|
|
2253
2318
|
}));
|
|
2254
2319
|
return function (_x) {
|
|
2255
|
-
return
|
|
2320
|
+
return _ref39.apply(this, arguments);
|
|
2256
2321
|
};
|
|
2257
2322
|
}());
|
|
2258
|
-
|
|
2323
|
+
_context39.next = 10;
|
|
2259
2324
|
return call.doHoldResume();
|
|
2260
2325
|
case 10:
|
|
2261
|
-
|
|
2326
|
+
_context39.next = 12;
|
|
2262
2327
|
return (0, _testUtil.flushPromises)(2);
|
|
2263
2328
|
case 12:
|
|
2264
2329
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2274,11 +2339,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2274
2339
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2275
2340
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2276
2341
|
roapEvent.data.type = 'ANSWER';
|
|
2277
|
-
|
|
2342
|
+
_context39.next = 20;
|
|
2278
2343
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2279
2344
|
case 20:
|
|
2280
2345
|
roapEvent.data.type = 'OK';
|
|
2281
|
-
|
|
2346
|
+
_context39.next = 23;
|
|
2282
2347
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2283
2348
|
case 23:
|
|
2284
2349
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2293,14 +2358,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2293
2358
|
});
|
|
2294
2359
|
case 28:
|
|
2295
2360
|
case "end":
|
|
2296
|
-
return
|
|
2361
|
+
return _context39.stop();
|
|
2297
2362
|
}
|
|
2298
|
-
},
|
|
2363
|
+
}, _callee39);
|
|
2299
2364
|
})));
|
|
2300
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2365
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2301
2366
|
var responsePayload, warnSpy, roapEvent;
|
|
2302
|
-
return _regenerator.default.wrap(function
|
|
2303
|
-
while (1) switch (
|
|
2367
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2368
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2304
2369
|
case 0:
|
|
2305
2370
|
expect.assertions(8);
|
|
2306
2371
|
responsePayload = {
|
|
@@ -2313,26 +2378,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2313
2378
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2314
2379
|
call['held'] = false;
|
|
2315
2380
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2316
|
-
var
|
|
2317
|
-
return _regenerator.default.wrap(function
|
|
2318
|
-
while (1) switch (
|
|
2381
|
+
var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(correlationId) {
|
|
2382
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
2383
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2319
2384
|
case 0:
|
|
2320
2385
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2321
2386
|
case 1:
|
|
2322
2387
|
case "end":
|
|
2323
|
-
return
|
|
2388
|
+
return _context40.stop();
|
|
2324
2389
|
}
|
|
2325
|
-
},
|
|
2390
|
+
}, _callee40);
|
|
2326
2391
|
}));
|
|
2327
2392
|
return function (_x2) {
|
|
2328
|
-
return
|
|
2393
|
+
return _ref41.apply(this, arguments);
|
|
2329
2394
|
};
|
|
2330
2395
|
}());
|
|
2331
2396
|
call.doHoldResume();
|
|
2332
|
-
|
|
2397
|
+
_context41.next = 11;
|
|
2333
2398
|
return _promise.default.resolve();
|
|
2334
2399
|
case 11:
|
|
2335
|
-
|
|
2400
|
+
_context41.next = 13;
|
|
2336
2401
|
return _promise.default.resolve();
|
|
2337
2402
|
case 13:
|
|
2338
2403
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2348,11 +2413,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2348
2413
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2349
2414
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2350
2415
|
roapEvent.data.type = 'ANSWER';
|
|
2351
|
-
|
|
2416
|
+
_context41.next = 22;
|
|
2352
2417
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2353
2418
|
case 22:
|
|
2354
2419
|
roapEvent.data.type = 'OK';
|
|
2355
|
-
|
|
2420
|
+
_context41.next = 25;
|
|
2356
2421
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2357
2422
|
case 25:
|
|
2358
2423
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2367,14 +2432,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2367
2432
|
});
|
|
2368
2433
|
case 30:
|
|
2369
2434
|
case "end":
|
|
2370
|
-
return
|
|
2435
|
+
return _context41.stop();
|
|
2371
2436
|
}
|
|
2372
|
-
},
|
|
2437
|
+
}, _callee41);
|
|
2373
2438
|
})));
|
|
2374
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2439
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2375
2440
|
var responsePayload;
|
|
2376
|
-
return _regenerator.default.wrap(function
|
|
2377
|
-
while (1) switch (
|
|
2441
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2442
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2378
2443
|
case 0:
|
|
2379
2444
|
expect.assertions(4);
|
|
2380
2445
|
responsePayload = {
|
|
@@ -2384,26 +2449,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2384
2449
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2385
2450
|
call['held'] = false;
|
|
2386
2451
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2387
|
-
var
|
|
2388
|
-
return _regenerator.default.wrap(function
|
|
2389
|
-
while (1) switch (
|
|
2452
|
+
var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(errObj) {
|
|
2453
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2454
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2390
2455
|
case 0:
|
|
2391
2456
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2392
2457
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2393
2458
|
case 2:
|
|
2394
2459
|
case "end":
|
|
2395
|
-
return
|
|
2460
|
+
return _context42.stop();
|
|
2396
2461
|
}
|
|
2397
|
-
},
|
|
2462
|
+
}, _callee42);
|
|
2398
2463
|
}));
|
|
2399
2464
|
return function (_x3) {
|
|
2400
|
-
return
|
|
2465
|
+
return _ref43.apply(this, arguments);
|
|
2401
2466
|
};
|
|
2402
2467
|
}());
|
|
2403
|
-
|
|
2468
|
+
_context43.next = 7;
|
|
2404
2469
|
return call.doHoldResume();
|
|
2405
2470
|
case 7:
|
|
2406
|
-
|
|
2471
|
+
_context43.next = 9;
|
|
2407
2472
|
return (0, _testUtil.flushPromises)(2);
|
|
2408
2473
|
case 9:
|
|
2409
2474
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2413,14 +2478,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2413
2478
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2414
2479
|
case 11:
|
|
2415
2480
|
case "end":
|
|
2416
|
-
return
|
|
2481
|
+
return _context43.stop();
|
|
2417
2482
|
}
|
|
2418
|
-
},
|
|
2483
|
+
}, _callee43);
|
|
2419
2484
|
})));
|
|
2420
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2485
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2421
2486
|
var responsePayload, rejectPayload, roapEvent;
|
|
2422
|
-
return _regenerator.default.wrap(function
|
|
2423
|
-
while (1) switch (
|
|
2487
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2488
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2424
2489
|
case 0:
|
|
2425
2490
|
expect.assertions(5);
|
|
2426
2491
|
responsePayload = {
|
|
@@ -2434,24 +2499,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2434
2499
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2435
2500
|
call['held'] = false;
|
|
2436
2501
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2437
|
-
var
|
|
2438
|
-
return _regenerator.default.wrap(function
|
|
2439
|
-
while (1) switch (
|
|
2502
|
+
var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(errObj) {
|
|
2503
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2504
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2440
2505
|
case 0:
|
|
2441
2506
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2442
2507
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2443
2508
|
case 2:
|
|
2444
2509
|
case "end":
|
|
2445
|
-
return
|
|
2510
|
+
return _context44.stop();
|
|
2446
2511
|
}
|
|
2447
|
-
},
|
|
2512
|
+
}, _callee44);
|
|
2448
2513
|
}));
|
|
2449
2514
|
return function (_x4) {
|
|
2450
|
-
return
|
|
2515
|
+
return _ref45.apply(this, arguments);
|
|
2451
2516
|
};
|
|
2452
2517
|
}());
|
|
2453
2518
|
call.doHoldResume();
|
|
2454
|
-
|
|
2519
|
+
_context45.next = 9;
|
|
2455
2520
|
return (0, _testUtil.flushPromises)(2);
|
|
2456
2521
|
case 9:
|
|
2457
2522
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2461,7 +2526,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2461
2526
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2462
2527
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2463
2528
|
roapEvent.data.type = 'ANSWER';
|
|
2464
|
-
|
|
2529
|
+
_context45.next = 15;
|
|
2465
2530
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2466
2531
|
case 15:
|
|
2467
2532
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2469,14 +2534,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2469
2534
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2470
2535
|
case 17:
|
|
2471
2536
|
case "end":
|
|
2472
|
-
return
|
|
2537
|
+
return _context45.stop();
|
|
2473
2538
|
}
|
|
2474
|
-
},
|
|
2539
|
+
}, _callee45);
|
|
2475
2540
|
})));
|
|
2476
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2541
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2477
2542
|
var responsePayload, warnSpy, roapEvent;
|
|
2478
|
-
return _regenerator.default.wrap(function
|
|
2479
|
-
while (1) switch (
|
|
2543
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2544
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2480
2545
|
case 0:
|
|
2481
2546
|
responsePayload = {
|
|
2482
2547
|
statusCode: 200,
|
|
@@ -2487,10 +2552,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2487
2552
|
jest.spyOn(global, 'clearTimeout');
|
|
2488
2553
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2489
2554
|
call['held'] = false;
|
|
2490
|
-
|
|
2555
|
+
_context46.next = 8;
|
|
2491
2556
|
return call.doHoldResume();
|
|
2492
2557
|
case 8:
|
|
2493
|
-
|
|
2558
|
+
_context46.next = 10;
|
|
2494
2559
|
return (0, _testUtil.flushPromises)(2);
|
|
2495
2560
|
case 10:
|
|
2496
2561
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2505,19 +2570,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2505
2570
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2506
2571
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2507
2572
|
roapEvent.data.type = 'ANSWER';
|
|
2508
|
-
|
|
2573
|
+
_context46.next = 17;
|
|
2509
2574
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2510
2575
|
case 17:
|
|
2511
2576
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2512
2577
|
statusCode: 403
|
|
2513
2578
|
});
|
|
2514
2579
|
roapEvent.data.type = 'OK';
|
|
2515
|
-
|
|
2580
|
+
_context46.next = 21;
|
|
2516
2581
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2517
2582
|
case 21:
|
|
2518
2583
|
/* this is for coverage */
|
|
2519
2584
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2520
|
-
|
|
2585
|
+
_context46.next = 24;
|
|
2521
2586
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2522
2587
|
case 24:
|
|
2523
2588
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2529,14 +2594,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2529
2594
|
});
|
|
2530
2595
|
case 27:
|
|
2531
2596
|
case "end":
|
|
2532
|
-
return
|
|
2597
|
+
return _context46.stop();
|
|
2533
2598
|
}
|
|
2534
|
-
},
|
|
2599
|
+
}, _callee46);
|
|
2535
2600
|
})));
|
|
2536
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2601
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2537
2602
|
var responsePayload, warnSpy, roapEvent;
|
|
2538
|
-
return _regenerator.default.wrap(function
|
|
2539
|
-
while (1) switch (
|
|
2603
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2604
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2540
2605
|
case 0:
|
|
2541
2606
|
responsePayload = {
|
|
2542
2607
|
statusCode: 200,
|
|
@@ -2547,10 +2612,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2547
2612
|
jest.spyOn(global, 'clearTimeout');
|
|
2548
2613
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2549
2614
|
call['held'] = true;
|
|
2550
|
-
|
|
2615
|
+
_context47.next = 8;
|
|
2551
2616
|
return call.doHoldResume();
|
|
2552
2617
|
case 8:
|
|
2553
|
-
|
|
2618
|
+
_context47.next = 10;
|
|
2554
2619
|
return (0, _testUtil.flushPromises)(2);
|
|
2555
2620
|
case 10:
|
|
2556
2621
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2565,14 +2630,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2565
2630
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2566
2631
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2567
2632
|
roapEvent.data.type = 'ANSWER';
|
|
2568
|
-
|
|
2633
|
+
_context47.next = 17;
|
|
2569
2634
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2570
2635
|
case 17:
|
|
2571
2636
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2572
2637
|
statusCode: 403
|
|
2573
2638
|
});
|
|
2574
2639
|
roapEvent.data.type = 'OK';
|
|
2575
|
-
|
|
2640
|
+
_context47.next = 21;
|
|
2576
2641
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2577
2642
|
case 21:
|
|
2578
2643
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2584,14 +2649,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2584
2649
|
});
|
|
2585
2650
|
case 24:
|
|
2586
2651
|
case "end":
|
|
2587
|
-
return
|
|
2652
|
+
return _context47.stop();
|
|
2588
2653
|
}
|
|
2589
|
-
},
|
|
2654
|
+
}, _callee47);
|
|
2590
2655
|
})));
|
|
2591
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2656
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2592
2657
|
var responsePayload, roapEvent;
|
|
2593
|
-
return _regenerator.default.wrap(function
|
|
2594
|
-
while (1) switch (
|
|
2658
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2659
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2595
2660
|
case 0:
|
|
2596
2661
|
expect.assertions(5);
|
|
2597
2662
|
responsePayload = {
|
|
@@ -2601,25 +2666,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2601
2666
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2602
2667
|
call['held'] = false;
|
|
2603
2668
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2604
|
-
var
|
|
2605
|
-
return _regenerator.default.wrap(function
|
|
2606
|
-
while (1) switch (
|
|
2669
|
+
var _ref49 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
|
|
2670
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2671
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2607
2672
|
case 0:
|
|
2608
2673
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2609
2674
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2610
2675
|
case 2:
|
|
2611
2676
|
case "end":
|
|
2612
|
-
return
|
|
2677
|
+
return _context48.stop();
|
|
2613
2678
|
}
|
|
2614
|
-
},
|
|
2679
|
+
}, _callee48);
|
|
2615
2680
|
}));
|
|
2616
2681
|
return function (_x5) {
|
|
2617
|
-
return
|
|
2682
|
+
return _ref49.apply(this, arguments);
|
|
2618
2683
|
};
|
|
2619
2684
|
}());
|
|
2620
2685
|
jest.runAllTimers();
|
|
2621
2686
|
call.doHoldResume();
|
|
2622
|
-
|
|
2687
|
+
_context49.next = 9;
|
|
2623
2688
|
return (0, _testUtil.flushPromises)(2);
|
|
2624
2689
|
case 9:
|
|
2625
2690
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2632,11 +2697,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2632
2697
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2633
2698
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2634
2699
|
roapEvent.data.type = 'ANSWER';
|
|
2635
|
-
|
|
2700
|
+
_context49.next = 15;
|
|
2636
2701
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2637
2702
|
case 15:
|
|
2638
2703
|
roapEvent.data.type = 'OK';
|
|
2639
|
-
|
|
2704
|
+
_context49.next = 18;
|
|
2640
2705
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2641
2706
|
case 18:
|
|
2642
2707
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2648,14 +2713,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2648
2713
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2649
2714
|
case 21:
|
|
2650
2715
|
case "end":
|
|
2651
|
-
return
|
|
2716
|
+
return _context49.stop();
|
|
2652
2717
|
}
|
|
2653
|
-
},
|
|
2718
|
+
}, _callee49);
|
|
2654
2719
|
})));
|
|
2655
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2720
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2656
2721
|
var responsePayload, warnSpy, roapEvent;
|
|
2657
|
-
return _regenerator.default.wrap(function
|
|
2658
|
-
while (1) switch (
|
|
2722
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2723
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2659
2724
|
case 0:
|
|
2660
2725
|
expect.assertions(7);
|
|
2661
2726
|
responsePayload = {
|
|
@@ -2668,25 +2733,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2668
2733
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2669
2734
|
call['held'] = true;
|
|
2670
2735
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2671
|
-
var
|
|
2672
|
-
return _regenerator.default.wrap(function
|
|
2673
|
-
while (1) switch (
|
|
2736
|
+
var _ref51 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(correlationId) {
|
|
2737
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2738
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2674
2739
|
case 0:
|
|
2675
2740
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2676
2741
|
case 1:
|
|
2677
2742
|
case "end":
|
|
2678
|
-
return
|
|
2743
|
+
return _context50.stop();
|
|
2679
2744
|
}
|
|
2680
|
-
},
|
|
2745
|
+
}, _callee50);
|
|
2681
2746
|
}));
|
|
2682
2747
|
return function (_x6) {
|
|
2683
|
-
return
|
|
2748
|
+
return _ref51.apply(this, arguments);
|
|
2684
2749
|
};
|
|
2685
2750
|
}());
|
|
2686
|
-
|
|
2751
|
+
_context51.next = 10;
|
|
2687
2752
|
return call.doHoldResume();
|
|
2688
2753
|
case 10:
|
|
2689
|
-
|
|
2754
|
+
_context51.next = 12;
|
|
2690
2755
|
return (0, _testUtil.flushPromises)(2);
|
|
2691
2756
|
case 12:
|
|
2692
2757
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2702,11 +2767,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2702
2767
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2703
2768
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2704
2769
|
roapEvent.data.type = 'ANSWER';
|
|
2705
|
-
|
|
2770
|
+
_context51.next = 20;
|
|
2706
2771
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2707
2772
|
case 20:
|
|
2708
2773
|
roapEvent.data.type = 'OK';
|
|
2709
|
-
|
|
2774
|
+
_context51.next = 23;
|
|
2710
2775
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2711
2776
|
case 23:
|
|
2712
2777
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2721,14 +2786,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2721
2786
|
});
|
|
2722
2787
|
case 28:
|
|
2723
2788
|
case "end":
|
|
2724
|
-
return
|
|
2789
|
+
return _context51.stop();
|
|
2725
2790
|
}
|
|
2726
|
-
},
|
|
2791
|
+
}, _callee51);
|
|
2727
2792
|
})));
|
|
2728
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2793
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2729
2794
|
var responsePayload, warnSpy, roapEvent;
|
|
2730
|
-
return _regenerator.default.wrap(function
|
|
2731
|
-
while (1) switch (
|
|
2795
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2796
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2732
2797
|
case 0:
|
|
2733
2798
|
expect.assertions(7);
|
|
2734
2799
|
responsePayload = {
|
|
@@ -2741,26 +2806,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2741
2806
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2742
2807
|
call['held'] = true;
|
|
2743
2808
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2744
|
-
var
|
|
2745
|
-
return _regenerator.default.wrap(function
|
|
2746
|
-
while (1) switch (
|
|
2809
|
+
var _ref53 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(correlationId) {
|
|
2810
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2811
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2747
2812
|
case 0:
|
|
2748
2813
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2749
2814
|
case 1:
|
|
2750
2815
|
case "end":
|
|
2751
|
-
return
|
|
2816
|
+
return _context52.stop();
|
|
2752
2817
|
}
|
|
2753
|
-
},
|
|
2818
|
+
}, _callee52);
|
|
2754
2819
|
}));
|
|
2755
2820
|
return function (_x7) {
|
|
2756
|
-
return
|
|
2821
|
+
return _ref53.apply(this, arguments);
|
|
2757
2822
|
};
|
|
2758
2823
|
}());
|
|
2759
2824
|
call.doHoldResume();
|
|
2760
|
-
|
|
2825
|
+
_context53.next = 11;
|
|
2761
2826
|
return _promise.default.resolve();
|
|
2762
2827
|
case 11:
|
|
2763
|
-
|
|
2828
|
+
_context53.next = 13;
|
|
2764
2829
|
return _promise.default.resolve();
|
|
2765
2830
|
case 13:
|
|
2766
2831
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2776,11 +2841,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2776
2841
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2777
2842
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2778
2843
|
roapEvent.data.type = 'ANSWER';
|
|
2779
|
-
|
|
2844
|
+
_context53.next = 21;
|
|
2780
2845
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2781
2846
|
case 21:
|
|
2782
2847
|
roapEvent.data.type = 'OK';
|
|
2783
|
-
|
|
2848
|
+
_context53.next = 24;
|
|
2784
2849
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2785
2850
|
case 24:
|
|
2786
2851
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2795,14 +2860,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2795
2860
|
});
|
|
2796
2861
|
case 29:
|
|
2797
2862
|
case "end":
|
|
2798
|
-
return
|
|
2863
|
+
return _context53.stop();
|
|
2799
2864
|
}
|
|
2800
|
-
},
|
|
2865
|
+
}, _callee53);
|
|
2801
2866
|
})));
|
|
2802
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2867
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2803
2868
|
var responsePayload;
|
|
2804
|
-
return _regenerator.default.wrap(function
|
|
2805
|
-
while (1) switch (
|
|
2869
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2870
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2806
2871
|
case 0:
|
|
2807
2872
|
expect.assertions(4);
|
|
2808
2873
|
responsePayload = {
|
|
@@ -2812,26 +2877,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2812
2877
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2813
2878
|
call['held'] = true;
|
|
2814
2879
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2815
|
-
var
|
|
2816
|
-
return _regenerator.default.wrap(function
|
|
2817
|
-
while (1) switch (
|
|
2880
|
+
var _ref55 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
|
|
2881
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2882
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2818
2883
|
case 0:
|
|
2819
2884
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2820
2885
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2821
2886
|
case 2:
|
|
2822
2887
|
case "end":
|
|
2823
|
-
return
|
|
2888
|
+
return _context54.stop();
|
|
2824
2889
|
}
|
|
2825
|
-
},
|
|
2890
|
+
}, _callee54);
|
|
2826
2891
|
}));
|
|
2827
2892
|
return function (_x8) {
|
|
2828
|
-
return
|
|
2893
|
+
return _ref55.apply(this, arguments);
|
|
2829
2894
|
};
|
|
2830
2895
|
}());
|
|
2831
|
-
|
|
2896
|
+
_context55.next = 7;
|
|
2832
2897
|
return call.doHoldResume();
|
|
2833
2898
|
case 7:
|
|
2834
|
-
|
|
2899
|
+
_context55.next = 9;
|
|
2835
2900
|
return (0, _testUtil.flushPromises)(2);
|
|
2836
2901
|
case 9:
|
|
2837
2902
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2842,14 +2907,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2842
2907
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2843
2908
|
case 11:
|
|
2844
2909
|
case "end":
|
|
2845
|
-
return
|
|
2910
|
+
return _context55.stop();
|
|
2846
2911
|
}
|
|
2847
|
-
},
|
|
2912
|
+
}, _callee55);
|
|
2848
2913
|
})));
|
|
2849
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2914
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2850
2915
|
var responsePayload, rejectPayload, roapEvent;
|
|
2851
|
-
return _regenerator.default.wrap(function
|
|
2852
|
-
while (1) switch (
|
|
2916
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2917
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2853
2918
|
case 0:
|
|
2854
2919
|
expect.assertions(5);
|
|
2855
2920
|
responsePayload = {
|
|
@@ -2863,24 +2928,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2863
2928
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2864
2929
|
call['held'] = true;
|
|
2865
2930
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2866
|
-
var
|
|
2867
|
-
return _regenerator.default.wrap(function
|
|
2868
|
-
while (1) switch (
|
|
2931
|
+
var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(errObj) {
|
|
2932
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2933
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2869
2934
|
case 0:
|
|
2870
2935
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2871
2936
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2872
2937
|
case 2:
|
|
2873
2938
|
case "end":
|
|
2874
|
-
return
|
|
2939
|
+
return _context56.stop();
|
|
2875
2940
|
}
|
|
2876
|
-
},
|
|
2941
|
+
}, _callee56);
|
|
2877
2942
|
}));
|
|
2878
2943
|
return function (_x9) {
|
|
2879
|
-
return
|
|
2944
|
+
return _ref57.apply(this, arguments);
|
|
2880
2945
|
};
|
|
2881
2946
|
}());
|
|
2882
2947
|
call.doHoldResume();
|
|
2883
|
-
|
|
2948
|
+
_context57.next = 9;
|
|
2884
2949
|
return (0, _testUtil.flushPromises)(2);
|
|
2885
2950
|
case 9:
|
|
2886
2951
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2891,7 +2956,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2891
2956
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2892
2957
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2893
2958
|
roapEvent.data.type = 'ANSWER';
|
|
2894
|
-
|
|
2959
|
+
_context57.next = 15;
|
|
2895
2960
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2896
2961
|
case 15:
|
|
2897
2962
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2899,14 +2964,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2899
2964
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2900
2965
|
case 17:
|
|
2901
2966
|
case "end":
|
|
2902
|
-
return
|
|
2967
|
+
return _context57.stop();
|
|
2903
2968
|
}
|
|
2904
|
-
},
|
|
2969
|
+
}, _callee57);
|
|
2905
2970
|
})));
|
|
2906
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2971
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
2907
2972
|
var responsePayload, roapEvent;
|
|
2908
|
-
return _regenerator.default.wrap(function
|
|
2909
|
-
while (1) switch (
|
|
2973
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
2974
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2910
2975
|
case 0:
|
|
2911
2976
|
expect.assertions(5);
|
|
2912
2977
|
responsePayload = {
|
|
@@ -2916,24 +2981,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2916
2981
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2917
2982
|
call['held'] = true;
|
|
2918
2983
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2919
|
-
var
|
|
2920
|
-
return _regenerator.default.wrap(function
|
|
2921
|
-
while (1) switch (
|
|
2984
|
+
var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(errObj) {
|
|
2985
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2986
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2922
2987
|
case 0:
|
|
2923
2988
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2924
2989
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2925
2990
|
case 2:
|
|
2926
2991
|
case "end":
|
|
2927
|
-
return
|
|
2992
|
+
return _context58.stop();
|
|
2928
2993
|
}
|
|
2929
|
-
},
|
|
2994
|
+
}, _callee58);
|
|
2930
2995
|
}));
|
|
2931
|
-
return function (
|
|
2932
|
-
return
|
|
2996
|
+
return function (_x0) {
|
|
2997
|
+
return _ref59.apply(this, arguments);
|
|
2933
2998
|
};
|
|
2934
2999
|
}());
|
|
2935
3000
|
call.doHoldResume();
|
|
2936
|
-
|
|
3001
|
+
_context59.next = 8;
|
|
2937
3002
|
return (0, _testUtil.flushPromises)(2);
|
|
2938
3003
|
case 8:
|
|
2939
3004
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2946,11 +3011,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2946
3011
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2947
3012
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2948
3013
|
roapEvent.data.type = 'ANSWER';
|
|
2949
|
-
|
|
3014
|
+
_context59.next = 14;
|
|
2950
3015
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2951
3016
|
case 14:
|
|
2952
3017
|
roapEvent.data.type = 'OK';
|
|
2953
|
-
|
|
3018
|
+
_context59.next = 17;
|
|
2954
3019
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2955
3020
|
case 17:
|
|
2956
3021
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2960,9 +3025,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2960
3025
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2961
3026
|
case 20:
|
|
2962
3027
|
case "end":
|
|
2963
|
-
return
|
|
3028
|
+
return _context59.stop();
|
|
2964
3029
|
}
|
|
2965
|
-
},
|
|
3030
|
+
}, _callee59);
|
|
2966
3031
|
})));
|
|
2967
3032
|
});
|
|
2968
3033
|
describe('Call transfer tests', function () {
|
|
@@ -2995,10 +3060,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2995
3060
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2996
3061
|
secondCall['held'] = false;
|
|
2997
3062
|
});
|
|
2998
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3063
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
|
|
2999
3064
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3000
|
-
return _regenerator.default.wrap(function
|
|
3001
|
-
while (1) switch (
|
|
3065
|
+
return _regenerator.default.wrap(function _callee62$(_context62) {
|
|
3066
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3002
3067
|
case 0:
|
|
3003
3068
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3004
3069
|
responsePayload = {
|
|
@@ -3010,41 +3075,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3010
3075
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3011
3076
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3012
3077
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3013
|
-
var
|
|
3014
|
-
return _regenerator.default.wrap(function
|
|
3015
|
-
while (1) switch (
|
|
3078
|
+
var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
|
|
3079
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
3080
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3016
3081
|
case 0:
|
|
3017
3082
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3018
3083
|
case 1:
|
|
3019
3084
|
case "end":
|
|
3020
|
-
return
|
|
3085
|
+
return _context60.stop();
|
|
3021
3086
|
}
|
|
3022
|
-
},
|
|
3087
|
+
}, _callee60);
|
|
3023
3088
|
}));
|
|
3024
|
-
return function (
|
|
3025
|
-
return
|
|
3089
|
+
return function (_x1) {
|
|
3090
|
+
return _ref61.apply(this, arguments);
|
|
3026
3091
|
};
|
|
3027
3092
|
}());
|
|
3028
3093
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3029
|
-
var
|
|
3030
|
-
return _regenerator.default.wrap(function
|
|
3031
|
-
while (1) switch (
|
|
3094
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
|
|
3095
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
3096
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3032
3097
|
case 0:
|
|
3033
3098
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3034
3099
|
case 1:
|
|
3035
3100
|
case "end":
|
|
3036
|
-
return
|
|
3101
|
+
return _context61.stop();
|
|
3037
3102
|
}
|
|
3038
|
-
},
|
|
3103
|
+
}, _callee61);
|
|
3039
3104
|
}));
|
|
3040
|
-
return function (
|
|
3041
|
-
return
|
|
3105
|
+
return function (_x10) {
|
|
3106
|
+
return _ref62.apply(this, arguments);
|
|
3042
3107
|
};
|
|
3043
3108
|
}());
|
|
3044
|
-
|
|
3109
|
+
_context62.next = 10;
|
|
3045
3110
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3046
3111
|
case 10:
|
|
3047
|
-
|
|
3112
|
+
_context62.next = 12;
|
|
3048
3113
|
return (0, _testUtil.flushPromises)(2);
|
|
3049
3114
|
case 12:
|
|
3050
3115
|
expect(requestSpy).toBeCalled();
|
|
@@ -3067,14 +3132,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3067
3132
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3068
3133
|
case 24:
|
|
3069
3134
|
case "end":
|
|
3070
|
-
return
|
|
3135
|
+
return _context62.stop();
|
|
3071
3136
|
}
|
|
3072
|
-
},
|
|
3137
|
+
}, _callee62);
|
|
3073
3138
|
})));
|
|
3074
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3139
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
3075
3140
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3076
|
-
return _regenerator.default.wrap(function
|
|
3077
|
-
while (1) switch (
|
|
3141
|
+
return _regenerator.default.wrap(function _callee64$(_context64) {
|
|
3142
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3078
3143
|
case 0:
|
|
3079
3144
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3080
3145
|
responsePayload = {
|
|
@@ -3086,25 +3151,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3086
3151
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3087
3152
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3088
3153
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3089
|
-
var
|
|
3090
|
-
return _regenerator.default.wrap(function
|
|
3091
|
-
while (1) switch (
|
|
3154
|
+
var _ref64 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(correlationId) {
|
|
3155
|
+
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
3156
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3092
3157
|
case 0:
|
|
3093
3158
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3094
3159
|
case 1:
|
|
3095
3160
|
case "end":
|
|
3096
|
-
return
|
|
3161
|
+
return _context63.stop();
|
|
3097
3162
|
}
|
|
3098
|
-
},
|
|
3163
|
+
}, _callee63);
|
|
3099
3164
|
}));
|
|
3100
|
-
return function (
|
|
3101
|
-
return
|
|
3165
|
+
return function (_x11) {
|
|
3166
|
+
return _ref64.apply(this, arguments);
|
|
3102
3167
|
};
|
|
3103
3168
|
}());
|
|
3104
|
-
|
|
3169
|
+
_context64.next = 9;
|
|
3105
3170
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3106
3171
|
case 9:
|
|
3107
|
-
|
|
3172
|
+
_context64.next = 11;
|
|
3108
3173
|
return (0, _testUtil.flushPromises)(2);
|
|
3109
3174
|
case 11:
|
|
3110
3175
|
expect(requestSpy).toBeCalled();
|
|
@@ -3123,14 +3188,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3123
3188
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3124
3189
|
case 21:
|
|
3125
3190
|
case "end":
|
|
3126
|
-
return
|
|
3191
|
+
return _context64.stop();
|
|
3127
3192
|
}
|
|
3128
|
-
},
|
|
3193
|
+
}, _callee64);
|
|
3129
3194
|
})));
|
|
3130
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3195
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3131
3196
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3132
|
-
return _regenerator.default.wrap(function
|
|
3133
|
-
while (1) switch (
|
|
3197
|
+
return _regenerator.default.wrap(function _callee65$(_context65) {
|
|
3198
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3134
3199
|
case 0:
|
|
3135
3200
|
responsePayload = {
|
|
3136
3201
|
statusCode: 403,
|
|
@@ -3140,12 +3205,13 @@ describe('Supplementary Services tests', function () {
|
|
|
3140
3205
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3141
3206
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3142
3207
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3143
|
-
|
|
3208
|
+
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3209
|
+
_context65.next = 8;
|
|
3144
3210
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3145
|
-
case
|
|
3146
|
-
|
|
3211
|
+
case 8:
|
|
3212
|
+
_context65.next = 10;
|
|
3147
3213
|
return (0, _testUtil.flushPromises)(1);
|
|
3148
|
-
case
|
|
3214
|
+
case 10:
|
|
3149
3215
|
expect(requestSpy).toBeCalled();
|
|
3150
3216
|
/* We should be in CALL_ESTABLISHED state */
|
|
3151
3217
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -3155,22 +3221,23 @@ describe('Supplementary Services tests', function () {
|
|
|
3155
3221
|
expect.anything(), call.getCorrelationId(), responsePayload, 'completeTransfer', 'call');
|
|
3156
3222
|
expect(uploadLogsSpy).toHaveBeenCalledWith({
|
|
3157
3223
|
correlationId: call.getCorrelationId(),
|
|
3158
|
-
callId: call.getCallId()
|
|
3224
|
+
callId: call.getCallId(),
|
|
3225
|
+
broadworksCorrelationInfo: 'dummy-broadworks-correlation-info'
|
|
3159
3226
|
});
|
|
3160
3227
|
/* check whether error event is being emitted by sdk */
|
|
3161
3228
|
expect(emitSpy).toBeCalledOnceWith(_types2.CALL_EVENT_KEYS.TRANSFER_ERROR, expect.any(_Errors.CallError));
|
|
3162
3229
|
expect(warnSpy).toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3163
3230
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3164
|
-
case
|
|
3231
|
+
case 18:
|
|
3165
3232
|
case "end":
|
|
3166
|
-
return
|
|
3233
|
+
return _context65.stop();
|
|
3167
3234
|
}
|
|
3168
|
-
},
|
|
3235
|
+
}, _callee65);
|
|
3169
3236
|
})));
|
|
3170
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3237
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3171
3238
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3172
|
-
return _regenerator.default.wrap(function
|
|
3173
|
-
while (1) switch (
|
|
3239
|
+
return _regenerator.default.wrap(function _callee66$(_context66) {
|
|
3240
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3174
3241
|
case 0:
|
|
3175
3242
|
responsePayload = {
|
|
3176
3243
|
statusCode: 403,
|
|
@@ -3180,10 +3247,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3180
3247
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3181
3248
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3182
3249
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3183
|
-
|
|
3250
|
+
_context66.next = 7;
|
|
3184
3251
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3185
3252
|
case 7:
|
|
3186
|
-
|
|
3253
|
+
_context66.next = 9;
|
|
3187
3254
|
return (0, _testUtil.flushPromises)(2);
|
|
3188
3255
|
case 9:
|
|
3189
3256
|
expect(requestSpy).toBeCalled();
|
|
@@ -3204,18 +3271,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3204
3271
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3205
3272
|
case 18:
|
|
3206
3273
|
case "end":
|
|
3207
|
-
return
|
|
3274
|
+
return _context66.stop();
|
|
3208
3275
|
}
|
|
3209
|
-
},
|
|
3276
|
+
}, _callee66);
|
|
3210
3277
|
})));
|
|
3211
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3278
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3212
3279
|
var requestSpy, warnSpy;
|
|
3213
|
-
return _regenerator.default.wrap(function
|
|
3214
|
-
while (1) switch (
|
|
3280
|
+
return _regenerator.default.wrap(function _callee67$(_context67) {
|
|
3281
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3215
3282
|
case 0:
|
|
3216
3283
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3217
3284
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3218
|
-
|
|
3285
|
+
_context67.next = 4;
|
|
3219
3286
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3220
3287
|
case 4:
|
|
3221
3288
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3227,18 +3294,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3227
3294
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3228
3295
|
case 10:
|
|
3229
3296
|
case "end":
|
|
3230
|
-
return
|
|
3297
|
+
return _context67.stop();
|
|
3231
3298
|
}
|
|
3232
|
-
},
|
|
3299
|
+
}, _callee67);
|
|
3233
3300
|
})));
|
|
3234
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3301
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
|
|
3235
3302
|
var requestSpy, warnSpy;
|
|
3236
|
-
return _regenerator.default.wrap(function
|
|
3237
|
-
while (1) switch (
|
|
3303
|
+
return _regenerator.default.wrap(function _callee68$(_context68) {
|
|
3304
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3238
3305
|
case 0:
|
|
3239
3306
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3240
3307
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3241
|
-
|
|
3308
|
+
_context68.next = 4;
|
|
3242
3309
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3243
3310
|
case 4:
|
|
3244
3311
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3250,9 +3317,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3250
3317
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3251
3318
|
case 10:
|
|
3252
3319
|
case "end":
|
|
3253
|
-
return
|
|
3320
|
+
return _context68.stop();
|
|
3254
3321
|
}
|
|
3255
|
-
},
|
|
3322
|
+
}, _callee68);
|
|
3256
3323
|
})));
|
|
3257
3324
|
});
|
|
3258
3325
|
});
|