@webex/calling 3.9.0-next.7 → 3.9.0-next.9
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 +51 -46
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +146 -147
- 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 +9 -10
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +66 -59
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +108 -109
- 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 +142 -85
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +184 -173
- 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 +343 -320
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +405 -406
- 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 +67 -68
- 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 +2 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +7 -7
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +6 -6
- 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 +239 -230
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +172 -173
- 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 +5 -4
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +14 -14
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +2 -6
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +244 -238
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +89 -90
- 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 +2 -2
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Logger/index.js.map +1 -1
- package/dist/Logger/index.test.js.map +1 -1
- package/dist/Logger/types.js.map +1 -1
- package/dist/Metrics/index.js +109 -46
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +8 -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 +42 -39
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +54 -47
- 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 +12 -11
- 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 +78 -70
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
- 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 +80 -63
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +95 -104
- 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 +4 -0
- package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
- package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
- package/dist/module/CallingClient/CallingClient.js +62 -20
- package/dist/module/CallingClient/calling/call.js +66 -43
- package/dist/module/CallingClient/constants.js +2 -1
- package/dist/module/CallingClient/registration/register.js +6 -3
- package/dist/module/CallingClient/registration/webWorker.js +2 -1
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +1 -4
- package/dist/module/Contacts/ContactsClient.js +23 -17
- package/dist/module/Contacts/constants.js +1 -1
- package/dist/module/Metrics/index.js +42 -0
- package/dist/module/Metrics/types.js +7 -0
- package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
- package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
- package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
- package/dist/module/common/Utils.js +22 -8
- 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.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -1
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- 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/windowsChromiumIceWarmupUtils.d.ts +2 -4
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -1
- 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/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +10 -2
- 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/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/package.json +9 -7
|
@@ -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,10 +1302,10 @@ 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);
|
|
@@ -1322,14 +1321,14 @@ describe('State Machine handler tests', function () {
|
|
|
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,14 @@ 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('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1664
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1666
1665
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1667
|
-
return _regenerator.default.wrap(function
|
|
1668
|
-
while (1) switch (
|
|
1666
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1667
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1669
1668
|
case 0:
|
|
1670
1669
|
statusPayload = {
|
|
1671
1670
|
statusCode: 200,
|
|
@@ -1698,7 +1697,7 @@ describe('State Machine handler tests', function () {
|
|
|
1698
1697
|
seq: 1,
|
|
1699
1698
|
messageType: 'ANSWER'
|
|
1700
1699
|
};
|
|
1701
|
-
|
|
1700
|
+
_context32.next = 17;
|
|
1702
1701
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1703
1702
|
case 17:
|
|
1704
1703
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1720,7 +1719,7 @@ describe('State Machine handler tests', function () {
|
|
|
1720
1719
|
seq: 2,
|
|
1721
1720
|
messageType: 'OFFER_REQUEST'
|
|
1722
1721
|
};
|
|
1723
|
-
|
|
1722
|
+
_context32.next = 23;
|
|
1724
1723
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1725
1724
|
case 23:
|
|
1726
1725
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1770,7 +1769,7 @@ describe('State Machine handler tests', function () {
|
|
|
1770
1769
|
};
|
|
1771
1770
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1772
1771
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1773
|
-
|
|
1772
|
+
_context32.next = 49;
|
|
1774
1773
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1775
1774
|
case 49:
|
|
1776
1775
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1779,7 +1778,7 @@ describe('State Machine handler tests', function () {
|
|
|
1779
1778
|
seq: 3,
|
|
1780
1779
|
messageType: 'ANSWER'
|
|
1781
1780
|
};
|
|
1782
|
-
|
|
1781
|
+
_context32.next = 54;
|
|
1783
1782
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1784
1783
|
case 54:
|
|
1785
1784
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1798,7 +1797,7 @@ describe('State Machine handler tests', function () {
|
|
|
1798
1797
|
messageType: 'OK'
|
|
1799
1798
|
}
|
|
1800
1799
|
};
|
|
1801
|
-
|
|
1800
|
+
_context32.next = 63;
|
|
1802
1801
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1803
1802
|
case 63:
|
|
1804
1803
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1813,14 +1812,14 @@ describe('State Machine handler tests', function () {
|
|
|
1813
1812
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1814
1813
|
case 70:
|
|
1815
1814
|
case "end":
|
|
1816
|
-
return
|
|
1815
|
+
return _context32.stop();
|
|
1817
1816
|
}
|
|
1818
|
-
},
|
|
1817
|
+
}, _callee32);
|
|
1819
1818
|
})));
|
|
1820
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1819
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1821
1820
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1822
|
-
return _regenerator.default.wrap(function
|
|
1823
|
-
while (1) switch (
|
|
1821
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1822
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1824
1823
|
case 0:
|
|
1825
1824
|
mockStatusBody = {
|
|
1826
1825
|
device: {
|
|
@@ -1860,7 +1859,7 @@ describe('State Machine handler tests', function () {
|
|
|
1860
1859
|
seq: 1,
|
|
1861
1860
|
messageType: 'ANSWER'
|
|
1862
1861
|
};
|
|
1863
|
-
|
|
1862
|
+
_context33.next = 18;
|
|
1864
1863
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1865
1864
|
case 18:
|
|
1866
1865
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1882,7 +1881,7 @@ describe('State Machine handler tests', function () {
|
|
|
1882
1881
|
seq: 2,
|
|
1883
1882
|
messageType: 'OFFER_REQUEST'
|
|
1884
1883
|
};
|
|
1885
|
-
|
|
1884
|
+
_context33.next = 24;
|
|
1886
1885
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1887
1886
|
case 24:
|
|
1888
1887
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1932,7 +1931,7 @@ describe('State Machine handler tests', function () {
|
|
|
1932
1931
|
};
|
|
1933
1932
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1934
1933
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1935
|
-
|
|
1934
|
+
_context33.next = 50;
|
|
1936
1935
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1937
1936
|
case 50:
|
|
1938
1937
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1941,7 +1940,7 @@ describe('State Machine handler tests', function () {
|
|
|
1941
1940
|
seq: 3,
|
|
1942
1941
|
messageType: 'ANSWER'
|
|
1943
1942
|
};
|
|
1944
|
-
|
|
1943
|
+
_context33.next = 55;
|
|
1945
1944
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1946
1945
|
case 55:
|
|
1947
1946
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1958,7 +1957,7 @@ describe('State Machine handler tests', function () {
|
|
|
1958
1957
|
}
|
|
1959
1958
|
};
|
|
1960
1959
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1961
|
-
|
|
1960
|
+
_context33.next = 62;
|
|
1962
1961
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1963
1962
|
case 62:
|
|
1964
1963
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1974,14 +1973,14 @@ describe('State Machine handler tests', function () {
|
|
|
1974
1973
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1975
1974
|
case 70:
|
|
1976
1975
|
case "end":
|
|
1977
|
-
return
|
|
1976
|
+
return _context33.stop();
|
|
1978
1977
|
}
|
|
1979
|
-
},
|
|
1978
|
+
}, _callee33);
|
|
1980
1979
|
})));
|
|
1981
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
1980
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1982
1981
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1983
|
-
return _regenerator.default.wrap(function
|
|
1984
|
-
while (1) switch (
|
|
1982
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1983
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1985
1984
|
case 0:
|
|
1986
1985
|
statusPayload = {
|
|
1987
1986
|
statusCode: 200,
|
|
@@ -2048,9 +2047,9 @@ describe('State Machine handler tests', function () {
|
|
|
2048
2047
|
});
|
|
2049
2048
|
case 33:
|
|
2050
2049
|
case "end":
|
|
2051
|
-
return
|
|
2050
|
+
return _context34.stop();
|
|
2052
2051
|
}
|
|
2053
|
-
},
|
|
2052
|
+
}, _callee34);
|
|
2054
2053
|
})));
|
|
2055
2054
|
describe('Call event timers tests', function () {
|
|
2056
2055
|
var callManager;
|
|
@@ -2061,10 +2060,10 @@ describe('State Machine handler tests', function () {
|
|
|
2061
2060
|
afterEach(function () {
|
|
2062
2061
|
jest.clearAllTimers();
|
|
2063
2062
|
});
|
|
2064
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2063
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
2065
2064
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2066
|
-
return _regenerator.default.wrap(function
|
|
2067
|
-
while (1) switch (
|
|
2065
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
2066
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2068
2067
|
case 0:
|
|
2069
2068
|
statusPayload = {
|
|
2070
2069
|
statusCode: 200,
|
|
@@ -2081,7 +2080,7 @@ describe('State Machine handler tests', function () {
|
|
|
2081
2080
|
webex.request.mockReturnValue(statusPayload);
|
|
2082
2081
|
|
|
2083
2082
|
// handleOutgoingCallSetup is asynchronous
|
|
2084
|
-
|
|
2083
|
+
_context35.next = 9;
|
|
2085
2084
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2086
2085
|
case 9:
|
|
2087
2086
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2124,14 +2123,14 @@ describe('State Machine handler tests', function () {
|
|
|
2124
2123
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2125
2124
|
case 32:
|
|
2126
2125
|
case "end":
|
|
2127
|
-
return
|
|
2126
|
+
return _context35.stop();
|
|
2128
2127
|
}
|
|
2129
|
-
},
|
|
2128
|
+
}, _callee35);
|
|
2130
2129
|
})));
|
|
2131
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2130
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
2132
2131
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2133
|
-
return _regenerator.default.wrap(function
|
|
2134
|
-
while (1) switch (
|
|
2132
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
2133
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2135
2134
|
case 0:
|
|
2136
2135
|
statusPayload = {
|
|
2137
2136
|
statusCode: 200,
|
|
@@ -2150,7 +2149,7 @@ describe('State Machine handler tests', function () {
|
|
|
2150
2149
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2151
2150
|
|
|
2152
2151
|
// handleOutgoingCallSetup is asynchronous
|
|
2153
|
-
|
|
2152
|
+
_context36.next = 11;
|
|
2154
2153
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2155
2154
|
case 11:
|
|
2156
2155
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2162,9 +2161,9 @@ describe('State Machine handler tests', function () {
|
|
|
2162
2161
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2163
2162
|
case 18:
|
|
2164
2163
|
case "end":
|
|
2165
|
-
return
|
|
2164
|
+
return _context36.stop();
|
|
2166
2165
|
}
|
|
2167
|
-
},
|
|
2166
|
+
}, _callee36);
|
|
2168
2167
|
})));
|
|
2169
2168
|
});
|
|
2170
2169
|
});
|
|
@@ -2224,10 +2223,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2224
2223
|
beforeEach(function () {
|
|
2225
2224
|
call.removeAllListeners();
|
|
2226
2225
|
});
|
|
2227
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2226
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
2228
2227
|
var responsePayload, warnSpy, roapEvent;
|
|
2229
|
-
return _regenerator.default.wrap(function
|
|
2230
|
-
while (1) switch (
|
|
2228
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
2229
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2231
2230
|
case 0:
|
|
2232
2231
|
expect.assertions(7);
|
|
2233
2232
|
responsePayload = {
|
|
@@ -2240,25 +2239,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2240
2239
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2241
2240
|
call['held'] = false;
|
|
2242
2241
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2243
|
-
var
|
|
2244
|
-
return _regenerator.default.wrap(function
|
|
2245
|
-
while (1) switch (
|
|
2242
|
+
var _ref38 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(correlationId) {
|
|
2243
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
2244
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2246
2245
|
case 0:
|
|
2247
2246
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2248
2247
|
case 1:
|
|
2249
2248
|
case "end":
|
|
2250
|
-
return
|
|
2249
|
+
return _context37.stop();
|
|
2251
2250
|
}
|
|
2252
|
-
},
|
|
2251
|
+
}, _callee37);
|
|
2253
2252
|
}));
|
|
2254
2253
|
return function (_x) {
|
|
2255
|
-
return
|
|
2254
|
+
return _ref38.apply(this, arguments);
|
|
2256
2255
|
};
|
|
2257
2256
|
}());
|
|
2258
|
-
|
|
2257
|
+
_context38.next = 10;
|
|
2259
2258
|
return call.doHoldResume();
|
|
2260
2259
|
case 10:
|
|
2261
|
-
|
|
2260
|
+
_context38.next = 12;
|
|
2262
2261
|
return (0, _testUtil.flushPromises)(2);
|
|
2263
2262
|
case 12:
|
|
2264
2263
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2274,11 +2273,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2274
2273
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2275
2274
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2276
2275
|
roapEvent.data.type = 'ANSWER';
|
|
2277
|
-
|
|
2276
|
+
_context38.next = 20;
|
|
2278
2277
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2279
2278
|
case 20:
|
|
2280
2279
|
roapEvent.data.type = 'OK';
|
|
2281
|
-
|
|
2280
|
+
_context38.next = 23;
|
|
2282
2281
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2283
2282
|
case 23:
|
|
2284
2283
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2293,14 +2292,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2293
2292
|
});
|
|
2294
2293
|
case 28:
|
|
2295
2294
|
case "end":
|
|
2296
|
-
return
|
|
2295
|
+
return _context38.stop();
|
|
2297
2296
|
}
|
|
2298
|
-
},
|
|
2297
|
+
}, _callee38);
|
|
2299
2298
|
})));
|
|
2300
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2299
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2301
2300
|
var responsePayload, warnSpy, roapEvent;
|
|
2302
|
-
return _regenerator.default.wrap(function
|
|
2303
|
-
while (1) switch (
|
|
2301
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
2302
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2304
2303
|
case 0:
|
|
2305
2304
|
expect.assertions(8);
|
|
2306
2305
|
responsePayload = {
|
|
@@ -2313,26 +2312,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2313
2312
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2314
2313
|
call['held'] = false;
|
|
2315
2314
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2316
|
-
var
|
|
2317
|
-
return _regenerator.default.wrap(function
|
|
2318
|
-
while (1) switch (
|
|
2315
|
+
var _ref40 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(correlationId) {
|
|
2316
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
2317
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2319
2318
|
case 0:
|
|
2320
2319
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2321
2320
|
case 1:
|
|
2322
2321
|
case "end":
|
|
2323
|
-
return
|
|
2322
|
+
return _context39.stop();
|
|
2324
2323
|
}
|
|
2325
|
-
},
|
|
2324
|
+
}, _callee39);
|
|
2326
2325
|
}));
|
|
2327
2326
|
return function (_x2) {
|
|
2328
|
-
return
|
|
2327
|
+
return _ref40.apply(this, arguments);
|
|
2329
2328
|
};
|
|
2330
2329
|
}());
|
|
2331
2330
|
call.doHoldResume();
|
|
2332
|
-
|
|
2331
|
+
_context40.next = 11;
|
|
2333
2332
|
return _promise.default.resolve();
|
|
2334
2333
|
case 11:
|
|
2335
|
-
|
|
2334
|
+
_context40.next = 13;
|
|
2336
2335
|
return _promise.default.resolve();
|
|
2337
2336
|
case 13:
|
|
2338
2337
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2348,11 +2347,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2348
2347
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2349
2348
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2350
2349
|
roapEvent.data.type = 'ANSWER';
|
|
2351
|
-
|
|
2350
|
+
_context40.next = 22;
|
|
2352
2351
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2353
2352
|
case 22:
|
|
2354
2353
|
roapEvent.data.type = 'OK';
|
|
2355
|
-
|
|
2354
|
+
_context40.next = 25;
|
|
2356
2355
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2357
2356
|
case 25:
|
|
2358
2357
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2367,14 +2366,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2367
2366
|
});
|
|
2368
2367
|
case 30:
|
|
2369
2368
|
case "end":
|
|
2370
|
-
return
|
|
2369
|
+
return _context40.stop();
|
|
2371
2370
|
}
|
|
2372
|
-
},
|
|
2371
|
+
}, _callee40);
|
|
2373
2372
|
})));
|
|
2374
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2373
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2375
2374
|
var responsePayload;
|
|
2376
|
-
return _regenerator.default.wrap(function
|
|
2377
|
-
while (1) switch (
|
|
2375
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2376
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2378
2377
|
case 0:
|
|
2379
2378
|
expect.assertions(4);
|
|
2380
2379
|
responsePayload = {
|
|
@@ -2384,26 +2383,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2384
2383
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2385
2384
|
call['held'] = false;
|
|
2386
2385
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2387
|
-
var
|
|
2388
|
-
return _regenerator.default.wrap(function
|
|
2389
|
-
while (1) switch (
|
|
2386
|
+
var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(errObj) {
|
|
2387
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2388
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2390
2389
|
case 0:
|
|
2391
2390
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2392
2391
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2393
2392
|
case 2:
|
|
2394
2393
|
case "end":
|
|
2395
|
-
return
|
|
2394
|
+
return _context41.stop();
|
|
2396
2395
|
}
|
|
2397
|
-
},
|
|
2396
|
+
}, _callee41);
|
|
2398
2397
|
}));
|
|
2399
2398
|
return function (_x3) {
|
|
2400
|
-
return
|
|
2399
|
+
return _ref42.apply(this, arguments);
|
|
2401
2400
|
};
|
|
2402
2401
|
}());
|
|
2403
|
-
|
|
2402
|
+
_context42.next = 7;
|
|
2404
2403
|
return call.doHoldResume();
|
|
2405
2404
|
case 7:
|
|
2406
|
-
|
|
2405
|
+
_context42.next = 9;
|
|
2407
2406
|
return (0, _testUtil.flushPromises)(2);
|
|
2408
2407
|
case 9:
|
|
2409
2408
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2413,14 +2412,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2413
2412
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2414
2413
|
case 11:
|
|
2415
2414
|
case "end":
|
|
2416
|
-
return
|
|
2415
|
+
return _context42.stop();
|
|
2417
2416
|
}
|
|
2418
|
-
},
|
|
2417
|
+
}, _callee42);
|
|
2419
2418
|
})));
|
|
2420
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2419
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2421
2420
|
var responsePayload, rejectPayload, roapEvent;
|
|
2422
|
-
return _regenerator.default.wrap(function
|
|
2423
|
-
while (1) switch (
|
|
2421
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2422
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2424
2423
|
case 0:
|
|
2425
2424
|
expect.assertions(5);
|
|
2426
2425
|
responsePayload = {
|
|
@@ -2434,24 +2433,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2434
2433
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2435
2434
|
call['held'] = false;
|
|
2436
2435
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2437
|
-
var
|
|
2438
|
-
return _regenerator.default.wrap(function
|
|
2439
|
-
while (1) switch (
|
|
2436
|
+
var _ref44 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(errObj) {
|
|
2437
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2438
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2440
2439
|
case 0:
|
|
2441
2440
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2442
2441
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2443
2442
|
case 2:
|
|
2444
2443
|
case "end":
|
|
2445
|
-
return
|
|
2444
|
+
return _context43.stop();
|
|
2446
2445
|
}
|
|
2447
|
-
},
|
|
2446
|
+
}, _callee43);
|
|
2448
2447
|
}));
|
|
2449
2448
|
return function (_x4) {
|
|
2450
|
-
return
|
|
2449
|
+
return _ref44.apply(this, arguments);
|
|
2451
2450
|
};
|
|
2452
2451
|
}());
|
|
2453
2452
|
call.doHoldResume();
|
|
2454
|
-
|
|
2453
|
+
_context44.next = 9;
|
|
2455
2454
|
return (0, _testUtil.flushPromises)(2);
|
|
2456
2455
|
case 9:
|
|
2457
2456
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2461,7 +2460,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2461
2460
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2462
2461
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2463
2462
|
roapEvent.data.type = 'ANSWER';
|
|
2464
|
-
|
|
2463
|
+
_context44.next = 15;
|
|
2465
2464
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2466
2465
|
case 15:
|
|
2467
2466
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2469,14 +2468,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2469
2468
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2470
2469
|
case 17:
|
|
2471
2470
|
case "end":
|
|
2472
|
-
return
|
|
2471
|
+
return _context44.stop();
|
|
2473
2472
|
}
|
|
2474
|
-
},
|
|
2473
|
+
}, _callee44);
|
|
2475
2474
|
})));
|
|
2476
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2475
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2477
2476
|
var responsePayload, warnSpy, roapEvent;
|
|
2478
|
-
return _regenerator.default.wrap(function
|
|
2479
|
-
while (1) switch (
|
|
2477
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2478
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2480
2479
|
case 0:
|
|
2481
2480
|
responsePayload = {
|
|
2482
2481
|
statusCode: 200,
|
|
@@ -2487,10 +2486,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2487
2486
|
jest.spyOn(global, 'clearTimeout');
|
|
2488
2487
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2489
2488
|
call['held'] = false;
|
|
2490
|
-
|
|
2489
|
+
_context45.next = 8;
|
|
2491
2490
|
return call.doHoldResume();
|
|
2492
2491
|
case 8:
|
|
2493
|
-
|
|
2492
|
+
_context45.next = 10;
|
|
2494
2493
|
return (0, _testUtil.flushPromises)(2);
|
|
2495
2494
|
case 10:
|
|
2496
2495
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2505,19 +2504,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2505
2504
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2506
2505
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2507
2506
|
roapEvent.data.type = 'ANSWER';
|
|
2508
|
-
|
|
2507
|
+
_context45.next = 17;
|
|
2509
2508
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2510
2509
|
case 17:
|
|
2511
2510
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2512
2511
|
statusCode: 403
|
|
2513
2512
|
});
|
|
2514
2513
|
roapEvent.data.type = 'OK';
|
|
2515
|
-
|
|
2514
|
+
_context45.next = 21;
|
|
2516
2515
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2517
2516
|
case 21:
|
|
2518
2517
|
/* this is for coverage */
|
|
2519
2518
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2520
|
-
|
|
2519
|
+
_context45.next = 24;
|
|
2521
2520
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2522
2521
|
case 24:
|
|
2523
2522
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2529,14 +2528,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2529
2528
|
});
|
|
2530
2529
|
case 27:
|
|
2531
2530
|
case "end":
|
|
2532
|
-
return
|
|
2531
|
+
return _context45.stop();
|
|
2533
2532
|
}
|
|
2534
|
-
},
|
|
2533
|
+
}, _callee45);
|
|
2535
2534
|
})));
|
|
2536
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2535
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2537
2536
|
var responsePayload, warnSpy, roapEvent;
|
|
2538
|
-
return _regenerator.default.wrap(function
|
|
2539
|
-
while (1) switch (
|
|
2537
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2538
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2540
2539
|
case 0:
|
|
2541
2540
|
responsePayload = {
|
|
2542
2541
|
statusCode: 200,
|
|
@@ -2547,10 +2546,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2547
2546
|
jest.spyOn(global, 'clearTimeout');
|
|
2548
2547
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2549
2548
|
call['held'] = true;
|
|
2550
|
-
|
|
2549
|
+
_context46.next = 8;
|
|
2551
2550
|
return call.doHoldResume();
|
|
2552
2551
|
case 8:
|
|
2553
|
-
|
|
2552
|
+
_context46.next = 10;
|
|
2554
2553
|
return (0, _testUtil.flushPromises)(2);
|
|
2555
2554
|
case 10:
|
|
2556
2555
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2565,14 +2564,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2565
2564
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2566
2565
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2567
2566
|
roapEvent.data.type = 'ANSWER';
|
|
2568
|
-
|
|
2567
|
+
_context46.next = 17;
|
|
2569
2568
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2570
2569
|
case 17:
|
|
2571
2570
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2572
2571
|
statusCode: 403
|
|
2573
2572
|
});
|
|
2574
2573
|
roapEvent.data.type = 'OK';
|
|
2575
|
-
|
|
2574
|
+
_context46.next = 21;
|
|
2576
2575
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2577
2576
|
case 21:
|
|
2578
2577
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2584,14 +2583,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2584
2583
|
});
|
|
2585
2584
|
case 24:
|
|
2586
2585
|
case "end":
|
|
2587
|
-
return
|
|
2586
|
+
return _context46.stop();
|
|
2588
2587
|
}
|
|
2589
|
-
},
|
|
2588
|
+
}, _callee46);
|
|
2590
2589
|
})));
|
|
2591
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2590
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2592
2591
|
var responsePayload, roapEvent;
|
|
2593
|
-
return _regenerator.default.wrap(function
|
|
2594
|
-
while (1) switch (
|
|
2592
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2593
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2595
2594
|
case 0:
|
|
2596
2595
|
expect.assertions(5);
|
|
2597
2596
|
responsePayload = {
|
|
@@ -2601,25 +2600,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2601
2600
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2602
2601
|
call['held'] = false;
|
|
2603
2602
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2604
|
-
var
|
|
2605
|
-
return _regenerator.default.wrap(function
|
|
2606
|
-
while (1) switch (
|
|
2603
|
+
var _ref48 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(errObj) {
|
|
2604
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2605
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2607
2606
|
case 0:
|
|
2608
2607
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2609
2608
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2610
2609
|
case 2:
|
|
2611
2610
|
case "end":
|
|
2612
|
-
return
|
|
2611
|
+
return _context47.stop();
|
|
2613
2612
|
}
|
|
2614
|
-
},
|
|
2613
|
+
}, _callee47);
|
|
2615
2614
|
}));
|
|
2616
2615
|
return function (_x5) {
|
|
2617
|
-
return
|
|
2616
|
+
return _ref48.apply(this, arguments);
|
|
2618
2617
|
};
|
|
2619
2618
|
}());
|
|
2620
2619
|
jest.runAllTimers();
|
|
2621
2620
|
call.doHoldResume();
|
|
2622
|
-
|
|
2621
|
+
_context48.next = 9;
|
|
2623
2622
|
return (0, _testUtil.flushPromises)(2);
|
|
2624
2623
|
case 9:
|
|
2625
2624
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2632,11 +2631,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2632
2631
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2633
2632
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2634
2633
|
roapEvent.data.type = 'ANSWER';
|
|
2635
|
-
|
|
2634
|
+
_context48.next = 15;
|
|
2636
2635
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2637
2636
|
case 15:
|
|
2638
2637
|
roapEvent.data.type = 'OK';
|
|
2639
|
-
|
|
2638
|
+
_context48.next = 18;
|
|
2640
2639
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2641
2640
|
case 18:
|
|
2642
2641
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2648,14 +2647,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2648
2647
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2649
2648
|
case 21:
|
|
2650
2649
|
case "end":
|
|
2651
|
-
return
|
|
2650
|
+
return _context48.stop();
|
|
2652
2651
|
}
|
|
2653
|
-
},
|
|
2652
|
+
}, _callee48);
|
|
2654
2653
|
})));
|
|
2655
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2654
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2656
2655
|
var responsePayload, warnSpy, roapEvent;
|
|
2657
|
-
return _regenerator.default.wrap(function
|
|
2658
|
-
while (1) switch (
|
|
2656
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2657
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2659
2658
|
case 0:
|
|
2660
2659
|
expect.assertions(7);
|
|
2661
2660
|
responsePayload = {
|
|
@@ -2668,25 +2667,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2668
2667
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2669
2668
|
call['held'] = true;
|
|
2670
2669
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2671
|
-
var
|
|
2672
|
-
return _regenerator.default.wrap(function
|
|
2673
|
-
while (1) switch (
|
|
2670
|
+
var _ref50 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(correlationId) {
|
|
2671
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2672
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2674
2673
|
case 0:
|
|
2675
2674
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2676
2675
|
case 1:
|
|
2677
2676
|
case "end":
|
|
2678
|
-
return
|
|
2677
|
+
return _context49.stop();
|
|
2679
2678
|
}
|
|
2680
|
-
},
|
|
2679
|
+
}, _callee49);
|
|
2681
2680
|
}));
|
|
2682
2681
|
return function (_x6) {
|
|
2683
|
-
return
|
|
2682
|
+
return _ref50.apply(this, arguments);
|
|
2684
2683
|
};
|
|
2685
2684
|
}());
|
|
2686
|
-
|
|
2685
|
+
_context50.next = 10;
|
|
2687
2686
|
return call.doHoldResume();
|
|
2688
2687
|
case 10:
|
|
2689
|
-
|
|
2688
|
+
_context50.next = 12;
|
|
2690
2689
|
return (0, _testUtil.flushPromises)(2);
|
|
2691
2690
|
case 12:
|
|
2692
2691
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2702,11 +2701,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2702
2701
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2703
2702
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2704
2703
|
roapEvent.data.type = 'ANSWER';
|
|
2705
|
-
|
|
2704
|
+
_context50.next = 20;
|
|
2706
2705
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2707
2706
|
case 20:
|
|
2708
2707
|
roapEvent.data.type = 'OK';
|
|
2709
|
-
|
|
2708
|
+
_context50.next = 23;
|
|
2710
2709
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2711
2710
|
case 23:
|
|
2712
2711
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2721,14 +2720,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2721
2720
|
});
|
|
2722
2721
|
case 28:
|
|
2723
2722
|
case "end":
|
|
2724
|
-
return
|
|
2723
|
+
return _context50.stop();
|
|
2725
2724
|
}
|
|
2726
|
-
},
|
|
2725
|
+
}, _callee50);
|
|
2727
2726
|
})));
|
|
2728
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2727
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2729
2728
|
var responsePayload, warnSpy, roapEvent;
|
|
2730
|
-
return _regenerator.default.wrap(function
|
|
2731
|
-
while (1) switch (
|
|
2729
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2730
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2732
2731
|
case 0:
|
|
2733
2732
|
expect.assertions(7);
|
|
2734
2733
|
responsePayload = {
|
|
@@ -2741,26 +2740,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2741
2740
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2742
2741
|
call['held'] = true;
|
|
2743
2742
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2744
|
-
var
|
|
2745
|
-
return _regenerator.default.wrap(function
|
|
2746
|
-
while (1) switch (
|
|
2743
|
+
var _ref52 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(correlationId) {
|
|
2744
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2745
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2747
2746
|
case 0:
|
|
2748
2747
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2749
2748
|
case 1:
|
|
2750
2749
|
case "end":
|
|
2751
|
-
return
|
|
2750
|
+
return _context51.stop();
|
|
2752
2751
|
}
|
|
2753
|
-
},
|
|
2752
|
+
}, _callee51);
|
|
2754
2753
|
}));
|
|
2755
2754
|
return function (_x7) {
|
|
2756
|
-
return
|
|
2755
|
+
return _ref52.apply(this, arguments);
|
|
2757
2756
|
};
|
|
2758
2757
|
}());
|
|
2759
2758
|
call.doHoldResume();
|
|
2760
|
-
|
|
2759
|
+
_context52.next = 11;
|
|
2761
2760
|
return _promise.default.resolve();
|
|
2762
2761
|
case 11:
|
|
2763
|
-
|
|
2762
|
+
_context52.next = 13;
|
|
2764
2763
|
return _promise.default.resolve();
|
|
2765
2764
|
case 13:
|
|
2766
2765
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2776,11 +2775,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2776
2775
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2777
2776
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2778
2777
|
roapEvent.data.type = 'ANSWER';
|
|
2779
|
-
|
|
2778
|
+
_context52.next = 21;
|
|
2780
2779
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2781
2780
|
case 21:
|
|
2782
2781
|
roapEvent.data.type = 'OK';
|
|
2783
|
-
|
|
2782
|
+
_context52.next = 24;
|
|
2784
2783
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2785
2784
|
case 24:
|
|
2786
2785
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2795,14 +2794,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2795
2794
|
});
|
|
2796
2795
|
case 29:
|
|
2797
2796
|
case "end":
|
|
2798
|
-
return
|
|
2797
|
+
return _context52.stop();
|
|
2799
2798
|
}
|
|
2800
|
-
},
|
|
2799
|
+
}, _callee52);
|
|
2801
2800
|
})));
|
|
2802
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2801
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2803
2802
|
var responsePayload;
|
|
2804
|
-
return _regenerator.default.wrap(function
|
|
2805
|
-
while (1) switch (
|
|
2803
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2804
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2806
2805
|
case 0:
|
|
2807
2806
|
expect.assertions(4);
|
|
2808
2807
|
responsePayload = {
|
|
@@ -2812,26 +2811,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2812
2811
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2813
2812
|
call['held'] = true;
|
|
2814
2813
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2815
|
-
var
|
|
2816
|
-
return _regenerator.default.wrap(function
|
|
2817
|
-
while (1) switch (
|
|
2814
|
+
var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(errObj) {
|
|
2815
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2816
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2818
2817
|
case 0:
|
|
2819
2818
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2820
2819
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2821
2820
|
case 2:
|
|
2822
2821
|
case "end":
|
|
2823
|
-
return
|
|
2822
|
+
return _context53.stop();
|
|
2824
2823
|
}
|
|
2825
|
-
},
|
|
2824
|
+
}, _callee53);
|
|
2826
2825
|
}));
|
|
2827
2826
|
return function (_x8) {
|
|
2828
|
-
return
|
|
2827
|
+
return _ref54.apply(this, arguments);
|
|
2829
2828
|
};
|
|
2830
2829
|
}());
|
|
2831
|
-
|
|
2830
|
+
_context54.next = 7;
|
|
2832
2831
|
return call.doHoldResume();
|
|
2833
2832
|
case 7:
|
|
2834
|
-
|
|
2833
|
+
_context54.next = 9;
|
|
2835
2834
|
return (0, _testUtil.flushPromises)(2);
|
|
2836
2835
|
case 9:
|
|
2837
2836
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2842,14 +2841,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2842
2841
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2843
2842
|
case 11:
|
|
2844
2843
|
case "end":
|
|
2845
|
-
return
|
|
2844
|
+
return _context54.stop();
|
|
2846
2845
|
}
|
|
2847
|
-
},
|
|
2846
|
+
}, _callee54);
|
|
2848
2847
|
})));
|
|
2849
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2848
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
2850
2849
|
var responsePayload, rejectPayload, roapEvent;
|
|
2851
|
-
return _regenerator.default.wrap(function
|
|
2852
|
-
while (1) switch (
|
|
2850
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2851
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2853
2852
|
case 0:
|
|
2854
2853
|
expect.assertions(5);
|
|
2855
2854
|
responsePayload = {
|
|
@@ -2863,24 +2862,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2863
2862
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2864
2863
|
call['held'] = true;
|
|
2865
2864
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2866
|
-
var
|
|
2867
|
-
return _regenerator.default.wrap(function
|
|
2868
|
-
while (1) switch (
|
|
2865
|
+
var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(errObj) {
|
|
2866
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2867
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2869
2868
|
case 0:
|
|
2870
2869
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2871
2870
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2872
2871
|
case 2:
|
|
2873
2872
|
case "end":
|
|
2874
|
-
return
|
|
2873
|
+
return _context55.stop();
|
|
2875
2874
|
}
|
|
2876
|
-
},
|
|
2875
|
+
}, _callee55);
|
|
2877
2876
|
}));
|
|
2878
2877
|
return function (_x9) {
|
|
2879
|
-
return
|
|
2878
|
+
return _ref56.apply(this, arguments);
|
|
2880
2879
|
};
|
|
2881
2880
|
}());
|
|
2882
2881
|
call.doHoldResume();
|
|
2883
|
-
|
|
2882
|
+
_context56.next = 9;
|
|
2884
2883
|
return (0, _testUtil.flushPromises)(2);
|
|
2885
2884
|
case 9:
|
|
2886
2885
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2891,7 +2890,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2891
2890
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2892
2891
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2893
2892
|
roapEvent.data.type = 'ANSWER';
|
|
2894
|
-
|
|
2893
|
+
_context56.next = 15;
|
|
2895
2894
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2896
2895
|
case 15:
|
|
2897
2896
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2899,14 +2898,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2899
2898
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2900
2899
|
case 17:
|
|
2901
2900
|
case "end":
|
|
2902
|
-
return
|
|
2901
|
+
return _context56.stop();
|
|
2903
2902
|
}
|
|
2904
|
-
},
|
|
2903
|
+
}, _callee56);
|
|
2905
2904
|
})));
|
|
2906
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2905
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2907
2906
|
var responsePayload, roapEvent;
|
|
2908
|
-
return _regenerator.default.wrap(function
|
|
2909
|
-
while (1) switch (
|
|
2907
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2908
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2910
2909
|
case 0:
|
|
2911
2910
|
expect.assertions(5);
|
|
2912
2911
|
responsePayload = {
|
|
@@ -2916,24 +2915,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2916
2915
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2917
2916
|
call['held'] = true;
|
|
2918
2917
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2919
|
-
var
|
|
2920
|
-
return _regenerator.default.wrap(function
|
|
2921
|
-
while (1) switch (
|
|
2918
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(errObj) {
|
|
2919
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2920
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2922
2921
|
case 0:
|
|
2923
2922
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2924
2923
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2925
2924
|
case 2:
|
|
2926
2925
|
case "end":
|
|
2927
|
-
return
|
|
2926
|
+
return _context57.stop();
|
|
2928
2927
|
}
|
|
2929
|
-
},
|
|
2928
|
+
}, _callee57);
|
|
2930
2929
|
}));
|
|
2931
|
-
return function (
|
|
2932
|
-
return
|
|
2930
|
+
return function (_x0) {
|
|
2931
|
+
return _ref58.apply(this, arguments);
|
|
2933
2932
|
};
|
|
2934
2933
|
}());
|
|
2935
2934
|
call.doHoldResume();
|
|
2936
|
-
|
|
2935
|
+
_context58.next = 8;
|
|
2937
2936
|
return (0, _testUtil.flushPromises)(2);
|
|
2938
2937
|
case 8:
|
|
2939
2938
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2946,11 +2945,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2946
2945
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2947
2946
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2948
2947
|
roapEvent.data.type = 'ANSWER';
|
|
2949
|
-
|
|
2948
|
+
_context58.next = 14;
|
|
2950
2949
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2951
2950
|
case 14:
|
|
2952
2951
|
roapEvent.data.type = 'OK';
|
|
2953
|
-
|
|
2952
|
+
_context58.next = 17;
|
|
2954
2953
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2955
2954
|
case 17:
|
|
2956
2955
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2960,9 +2959,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2960
2959
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2961
2960
|
case 20:
|
|
2962
2961
|
case "end":
|
|
2963
|
-
return
|
|
2962
|
+
return _context58.stop();
|
|
2964
2963
|
}
|
|
2965
|
-
},
|
|
2964
|
+
}, _callee58);
|
|
2966
2965
|
})));
|
|
2967
2966
|
});
|
|
2968
2967
|
describe('Call transfer tests', function () {
|
|
@@ -2995,10 +2994,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2995
2994
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2996
2995
|
secondCall['held'] = false;
|
|
2997
2996
|
});
|
|
2998
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
2997
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
2999
2998
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3000
|
-
return _regenerator.default.wrap(function
|
|
3001
|
-
while (1) switch (
|
|
2999
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
3000
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3002
3001
|
case 0:
|
|
3003
3002
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3004
3003
|
responsePayload = {
|
|
@@ -3010,41 +3009,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3010
3009
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3011
3010
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3012
3011
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3013
|
-
var
|
|
3014
|
-
return _regenerator.default.wrap(function
|
|
3015
|
-
while (1) switch (
|
|
3012
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
|
|
3013
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
3014
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3016
3015
|
case 0:
|
|
3017
3016
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3018
3017
|
case 1:
|
|
3019
3018
|
case "end":
|
|
3020
|
-
return
|
|
3019
|
+
return _context59.stop();
|
|
3021
3020
|
}
|
|
3022
|
-
},
|
|
3021
|
+
}, _callee59);
|
|
3023
3022
|
}));
|
|
3024
|
-
return function (
|
|
3025
|
-
return
|
|
3023
|
+
return function (_x1) {
|
|
3024
|
+
return _ref60.apply(this, arguments);
|
|
3026
3025
|
};
|
|
3027
3026
|
}());
|
|
3028
3027
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3029
|
-
var
|
|
3030
|
-
return _regenerator.default.wrap(function
|
|
3031
|
-
while (1) switch (
|
|
3028
|
+
var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
|
|
3029
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
3030
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3032
3031
|
case 0:
|
|
3033
3032
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3034
3033
|
case 1:
|
|
3035
3034
|
case "end":
|
|
3036
|
-
return
|
|
3035
|
+
return _context60.stop();
|
|
3037
3036
|
}
|
|
3038
|
-
},
|
|
3037
|
+
}, _callee60);
|
|
3039
3038
|
}));
|
|
3040
|
-
return function (
|
|
3041
|
-
return
|
|
3039
|
+
return function (_x10) {
|
|
3040
|
+
return _ref61.apply(this, arguments);
|
|
3042
3041
|
};
|
|
3043
3042
|
}());
|
|
3044
|
-
|
|
3043
|
+
_context61.next = 10;
|
|
3045
3044
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3046
3045
|
case 10:
|
|
3047
|
-
|
|
3046
|
+
_context61.next = 12;
|
|
3048
3047
|
return (0, _testUtil.flushPromises)(2);
|
|
3049
3048
|
case 12:
|
|
3050
3049
|
expect(requestSpy).toBeCalled();
|
|
@@ -3067,14 +3066,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3067
3066
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3068
3067
|
case 24:
|
|
3069
3068
|
case "end":
|
|
3070
|
-
return
|
|
3069
|
+
return _context61.stop();
|
|
3071
3070
|
}
|
|
3072
|
-
},
|
|
3071
|
+
}, _callee61);
|
|
3073
3072
|
})));
|
|
3074
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3073
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
3075
3074
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3076
|
-
return _regenerator.default.wrap(function
|
|
3077
|
-
while (1) switch (
|
|
3075
|
+
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
3076
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3078
3077
|
case 0:
|
|
3079
3078
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3080
3079
|
responsePayload = {
|
|
@@ -3086,25 +3085,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3086
3085
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3087
3086
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3088
3087
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3089
|
-
var
|
|
3090
|
-
return _regenerator.default.wrap(function
|
|
3091
|
-
while (1) switch (
|
|
3088
|
+
var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(correlationId) {
|
|
3089
|
+
return _regenerator.default.wrap(function _callee62$(_context62) {
|
|
3090
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3092
3091
|
case 0:
|
|
3093
3092
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3094
3093
|
case 1:
|
|
3095
3094
|
case "end":
|
|
3096
|
-
return
|
|
3095
|
+
return _context62.stop();
|
|
3097
3096
|
}
|
|
3098
|
-
},
|
|
3097
|
+
}, _callee62);
|
|
3099
3098
|
}));
|
|
3100
|
-
return function (
|
|
3101
|
-
return
|
|
3099
|
+
return function (_x11) {
|
|
3100
|
+
return _ref63.apply(this, arguments);
|
|
3102
3101
|
};
|
|
3103
3102
|
}());
|
|
3104
|
-
|
|
3103
|
+
_context63.next = 9;
|
|
3105
3104
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3106
3105
|
case 9:
|
|
3107
|
-
|
|
3106
|
+
_context63.next = 11;
|
|
3108
3107
|
return (0, _testUtil.flushPromises)(2);
|
|
3109
3108
|
case 11:
|
|
3110
3109
|
expect(requestSpy).toBeCalled();
|
|
@@ -3123,14 +3122,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3123
3122
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3124
3123
|
case 21:
|
|
3125
3124
|
case "end":
|
|
3126
|
-
return
|
|
3125
|
+
return _context63.stop();
|
|
3127
3126
|
}
|
|
3128
|
-
},
|
|
3127
|
+
}, _callee63);
|
|
3129
3128
|
})));
|
|
3130
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3129
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
3131
3130
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3132
|
-
return _regenerator.default.wrap(function
|
|
3133
|
-
while (1) switch (
|
|
3131
|
+
return _regenerator.default.wrap(function _callee64$(_context64) {
|
|
3132
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3134
3133
|
case 0:
|
|
3135
3134
|
responsePayload = {
|
|
3136
3135
|
statusCode: 403,
|
|
@@ -3141,10 +3140,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3141
3140
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3142
3141
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3143
3142
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3144
|
-
|
|
3143
|
+
_context64.next = 8;
|
|
3145
3144
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3146
3145
|
case 8:
|
|
3147
|
-
|
|
3146
|
+
_context64.next = 10;
|
|
3148
3147
|
return (0, _testUtil.flushPromises)(1);
|
|
3149
3148
|
case 10:
|
|
3150
3149
|
expect(requestSpy).toBeCalled();
|
|
@@ -3165,14 +3164,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3165
3164
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3166
3165
|
case 18:
|
|
3167
3166
|
case "end":
|
|
3168
|
-
return
|
|
3167
|
+
return _context64.stop();
|
|
3169
3168
|
}
|
|
3170
|
-
},
|
|
3169
|
+
}, _callee64);
|
|
3171
3170
|
})));
|
|
3172
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3171
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3173
3172
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3174
|
-
return _regenerator.default.wrap(function
|
|
3175
|
-
while (1) switch (
|
|
3173
|
+
return _regenerator.default.wrap(function _callee65$(_context65) {
|
|
3174
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3176
3175
|
case 0:
|
|
3177
3176
|
responsePayload = {
|
|
3178
3177
|
statusCode: 403,
|
|
@@ -3182,10 +3181,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3182
3181
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3183
3182
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3184
3183
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3185
|
-
|
|
3184
|
+
_context65.next = 7;
|
|
3186
3185
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3187
3186
|
case 7:
|
|
3188
|
-
|
|
3187
|
+
_context65.next = 9;
|
|
3189
3188
|
return (0, _testUtil.flushPromises)(2);
|
|
3190
3189
|
case 9:
|
|
3191
3190
|
expect(requestSpy).toBeCalled();
|
|
@@ -3206,18 +3205,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3206
3205
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3207
3206
|
case 18:
|
|
3208
3207
|
case "end":
|
|
3209
|
-
return
|
|
3208
|
+
return _context65.stop();
|
|
3210
3209
|
}
|
|
3211
|
-
},
|
|
3210
|
+
}, _callee65);
|
|
3212
3211
|
})));
|
|
3213
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3212
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3214
3213
|
var requestSpy, warnSpy;
|
|
3215
|
-
return _regenerator.default.wrap(function
|
|
3216
|
-
while (1) switch (
|
|
3214
|
+
return _regenerator.default.wrap(function _callee66$(_context66) {
|
|
3215
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3217
3216
|
case 0:
|
|
3218
3217
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3219
3218
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3220
|
-
|
|
3219
|
+
_context66.next = 4;
|
|
3221
3220
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3222
3221
|
case 4:
|
|
3223
3222
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3229,18 +3228,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3229
3228
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3230
3229
|
case 10:
|
|
3231
3230
|
case "end":
|
|
3232
|
-
return
|
|
3231
|
+
return _context66.stop();
|
|
3233
3232
|
}
|
|
3234
|
-
},
|
|
3233
|
+
}, _callee66);
|
|
3235
3234
|
})));
|
|
3236
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(
|
|
3235
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3237
3236
|
var requestSpy, warnSpy;
|
|
3238
|
-
return _regenerator.default.wrap(function
|
|
3239
|
-
while (1) switch (
|
|
3237
|
+
return _regenerator.default.wrap(function _callee67$(_context67) {
|
|
3238
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3240
3239
|
case 0:
|
|
3241
3240
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3242
3241
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3243
|
-
|
|
3242
|
+
_context67.next = 4;
|
|
3244
3243
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3245
3244
|
case 4:
|
|
3246
3245
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3252,9 +3251,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3252
3251
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3253
3252
|
case 10:
|
|
3254
3253
|
case "end":
|
|
3255
|
-
return
|
|
3254
|
+
return _context67.stop();
|
|
3256
3255
|
}
|
|
3257
|
-
},
|
|
3256
|
+
}, _callee67);
|
|
3258
3257
|
})));
|
|
3259
3258
|
});
|
|
3260
3259
|
});
|