@webex/calling 3.10.0-next.13 → 3.10.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallHistory/CallHistory.js +118 -124
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +189 -201
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +17 -18
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +14 -14
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +71 -24
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +136 -47
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +135 -137
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +145 -149
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +198 -201
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +168 -168
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +7 -8
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +24 -24
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +364 -366
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +340 -340
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +15 -18
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +113 -113
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/line/index.js +57 -74
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +22 -22
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +293 -300
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +246 -246
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +24 -24
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +20 -20
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +28 -28
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +250 -253
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +60 -60
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +7 -10
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +6 -9
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +6 -8
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +6 -9
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Events/impl/index.js +11 -13
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Metrics/index.js +1 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/SDKConnector/index.js +1 -2
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +126 -127
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +98 -98
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +84 -85
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +58 -61
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +20 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +116 -117
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +140 -140
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/common/Utils.js +168 -167
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +120 -120
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +3 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +3 -3
- package/dist/common/testUtil.js.map +1 -1
- package/dist/module/CallSettings/UcmBackendConnector.js +20 -6
- package/dist/module/common/constants.js +2 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -26,7 +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 _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
|
|
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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
30
30
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
31
31
|
/* eslint-disable dot-notation */
|
|
32
32
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
@@ -136,7 +136,7 @@ describe('Call Tests', function () {
|
|
|
136
136
|
});
|
|
137
137
|
it('should log a warning when sending a digit fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
138
138
|
var tone, errorMessage, mockMediaConnection, callManager, call, realMediaConnection, warnSpy, infoSpy;
|
|
139
|
-
return _regenerator.default.wrap(function
|
|
139
|
+
return _regenerator.default.wrap(function (_context) {
|
|
140
140
|
while (1) switch (_context.prev = _context.next) {
|
|
141
141
|
case 0:
|
|
142
142
|
tone = '1';
|
|
@@ -171,14 +171,14 @@ describe('Call Tests', function () {
|
|
|
171
171
|
// Restore the real mediaConnection object
|
|
172
172
|
call.mediaConnection = realMediaConnection;
|
|
173
173
|
call.end();
|
|
174
|
-
_context.next =
|
|
174
|
+
_context.next = 1;
|
|
175
175
|
return (0, _Utils.waitForMsecs)(50);
|
|
176
|
-
case
|
|
176
|
+
case 1:
|
|
177
177
|
// Need to add a small delay for Promise and callback to finish.
|
|
178
178
|
|
|
179
179
|
/* After call ends, call manager should have 0 record */
|
|
180
180
|
expect((0, _keys.default)(callManager.getActiveCalls()).length).toBe(0);
|
|
181
|
-
case
|
|
181
|
+
case 2:
|
|
182
182
|
case "end":
|
|
183
183
|
return _context.stop();
|
|
184
184
|
}
|
|
@@ -186,7 +186,7 @@ describe('Call Tests', function () {
|
|
|
186
186
|
})));
|
|
187
187
|
it('delete call object when ending the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
188
188
|
var callManager, mockStream, localAudioStream, call, infoSpy;
|
|
189
|
-
return _regenerator.default.wrap(function
|
|
189
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
190
190
|
while (1) switch (_context2.prev = _context2.next) {
|
|
191
191
|
case 0:
|
|
192
192
|
webex.request.mockReturnValue({
|
|
@@ -225,9 +225,9 @@ describe('Call Tests', function () {
|
|
|
225
225
|
file: 'call',
|
|
226
226
|
method: 'end'
|
|
227
227
|
});
|
|
228
|
-
_context2.next =
|
|
228
|
+
_context2.next = 1;
|
|
229
229
|
return (0, _Utils.waitForMsecs)(50);
|
|
230
|
-
case
|
|
230
|
+
case 1:
|
|
231
231
|
// Need to add a small delay for Promise and callback to finish.
|
|
232
232
|
expect(parseMediaQualityStatisticsMock).toHaveBeenCalledTimes(1);
|
|
233
233
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
@@ -236,7 +236,7 @@ describe('Call Tests', function () {
|
|
|
236
236
|
|
|
237
237
|
/* After call ends, call manager should have 0 record */
|
|
238
238
|
expect((0, _keys.default)(callManager.getActiveCalls()).length).toBe(0);
|
|
239
|
-
case
|
|
239
|
+
case 2:
|
|
240
240
|
case "end":
|
|
241
241
|
return _context2.stop();
|
|
242
242
|
}
|
|
@@ -244,7 +244,7 @@ describe('Call Tests', function () {
|
|
|
244
244
|
})));
|
|
245
245
|
it('Check whether media requests succeed or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
246
246
|
var mediaResponse, call, response;
|
|
247
|
-
return _regenerator.default.wrap(function
|
|
247
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
248
248
|
while (1) switch (_context3.prev = _context3.next) {
|
|
249
249
|
case 0:
|
|
250
250
|
webex.request.mockReturnValue({
|
|
@@ -268,12 +268,12 @@ describe('Call Tests', function () {
|
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
270
|
call = callManager.createCall(_types3.CallDirection.INBOUND, deviceId, mockLineId, dest);
|
|
271
|
-
_context3.next =
|
|
271
|
+
_context3.next = 1;
|
|
272
272
|
return call['postMedia']({});
|
|
273
|
-
case
|
|
273
|
+
case 1:
|
|
274
274
|
response = _context3.sent;
|
|
275
275
|
expect(response.body).toStrictEqual(mediaResponse.body);
|
|
276
|
-
case
|
|
276
|
+
case 2:
|
|
277
277
|
case "end":
|
|
278
278
|
return _context3.stop();
|
|
279
279
|
}
|
|
@@ -281,18 +281,18 @@ describe('Call Tests', function () {
|
|
|
281
281
|
})));
|
|
282
282
|
it('check whether callerId midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
283
283
|
var call;
|
|
284
|
-
return _regenerator.default.wrap(function
|
|
284
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
285
285
|
while (1) switch (_context4.prev = _context4.next) {
|
|
286
286
|
case 0:
|
|
287
287
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
288
288
|
call.handleMidCallEvent(dummyMidCallEvent);
|
|
289
|
-
_context4.next =
|
|
289
|
+
_context4.next = 1;
|
|
290
290
|
return (0, _Utils.waitForMsecs)(50);
|
|
291
|
-
case
|
|
291
|
+
case 1:
|
|
292
292
|
expect(call.getCallerInfo().name).toStrictEqual('Bob Marley');
|
|
293
293
|
expect(call.getCallerInfo().num).toStrictEqual('5010');
|
|
294
294
|
expect(call.getCallerInfo().avatarSrc).toBeFalsy();
|
|
295
|
-
case
|
|
295
|
+
case 2:
|
|
296
296
|
case "end":
|
|
297
297
|
return _context4.stop();
|
|
298
298
|
}
|
|
@@ -300,55 +300,55 @@ describe('Call Tests', function () {
|
|
|
300
300
|
})));
|
|
301
301
|
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
302
302
|
var call, logSpy, corelationId;
|
|
303
|
-
return _regenerator.default.wrap(function
|
|
303
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
304
304
|
while (1) switch (_context5.prev = _context5.next) {
|
|
305
305
|
case 0:
|
|
306
306
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
307
307
|
dummyMidCallEvent.eventType = 'callState';
|
|
308
308
|
logSpy = jest.spyOn(_Logger.default, 'log');
|
|
309
309
|
call.handleMidCallEvent(dummyMidCallEvent);
|
|
310
|
-
_context5.next =
|
|
310
|
+
_context5.next = 1;
|
|
311
311
|
return (0, _Utils.waitForMsecs)(50);
|
|
312
|
-
case
|
|
312
|
+
case 1:
|
|
313
313
|
corelationId = call.getCorrelationId();
|
|
314
314
|
expect(logSpy).toHaveBeenLastCalledWith("Received Midcall call event for correlationId : ".concat(corelationId), {
|
|
315
315
|
file: 'call',
|
|
316
316
|
method: 'handleMidCallEvent'
|
|
317
317
|
});
|
|
318
|
-
case
|
|
318
|
+
case 2:
|
|
319
319
|
case "end":
|
|
320
320
|
return _context5.stop();
|
|
321
321
|
}
|
|
322
322
|
}, _callee5);
|
|
323
323
|
})));
|
|
324
324
|
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
325
|
-
var call, callRtpStats;
|
|
326
|
-
return _regenerator.default.wrap(function
|
|
325
|
+
var call, callRtpStats, _t;
|
|
326
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
327
327
|
while (1) switch (_context6.prev = _context6.next) {
|
|
328
328
|
case 0:
|
|
329
329
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
330
330
|
_context6.prev = 1;
|
|
331
|
-
_context6.next =
|
|
331
|
+
_context6.next = 2;
|
|
332
332
|
return call.getCallRtpStats();
|
|
333
|
-
case
|
|
333
|
+
case 2:
|
|
334
334
|
callRtpStats = _context6.sent;
|
|
335
|
-
_context6.next =
|
|
335
|
+
_context6.next = 4;
|
|
336
336
|
break;
|
|
337
|
-
case
|
|
338
|
-
_context6.prev =
|
|
339
|
-
|
|
340
|
-
console.error(
|
|
341
|
-
case
|
|
337
|
+
case 3:
|
|
338
|
+
_context6.prev = 3;
|
|
339
|
+
_t = _context6["catch"](1);
|
|
340
|
+
console.error(_t);
|
|
341
|
+
case 4:
|
|
342
342
|
expect(callRtpStats).toStrictEqual(disconnectStats);
|
|
343
|
-
case
|
|
343
|
+
case 5:
|
|
344
344
|
case "end":
|
|
345
345
|
return _context6.stop();
|
|
346
346
|
}
|
|
347
|
-
}, _callee6, null, [[1,
|
|
347
|
+
}, _callee6, null, [[1, 3]]);
|
|
348
348
|
})));
|
|
349
349
|
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
350
350
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, logSpy;
|
|
351
|
-
return _regenerator.default.wrap(function
|
|
351
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
352
352
|
while (1) switch (_context7.prev = _context7.next) {
|
|
353
353
|
case 0:
|
|
354
354
|
mockStream = {
|
|
@@ -380,7 +380,7 @@ describe('Call Tests', function () {
|
|
|
380
380
|
file: 'call',
|
|
381
381
|
method: 'dial'
|
|
382
382
|
});
|
|
383
|
-
case
|
|
383
|
+
case 1:
|
|
384
384
|
case "end":
|
|
385
385
|
return _context7.stop();
|
|
386
386
|
}
|
|
@@ -388,7 +388,7 @@ describe('Call Tests', function () {
|
|
|
388
388
|
})));
|
|
389
389
|
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
390
390
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, infoSpy;
|
|
391
|
-
return _regenerator.default.wrap(function
|
|
391
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
392
392
|
while (1) switch (_context8.prev = _context8.next) {
|
|
393
393
|
case 0:
|
|
394
394
|
mockStream = {
|
|
@@ -421,7 +421,7 @@ describe('Call Tests', function () {
|
|
|
421
421
|
call.answer(localAudioStream);
|
|
422
422
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
423
423
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
424
|
-
case
|
|
424
|
+
case 1:
|
|
425
425
|
case "end":
|
|
426
426
|
return _context8.stop();
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ describe('Call Tests', function () {
|
|
|
429
429
|
})));
|
|
430
430
|
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
431
431
|
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
432
|
-
return _regenerator.default.wrap(function
|
|
432
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
433
433
|
while (1) switch (_context9.prev = _context9.next) {
|
|
434
434
|
case 0:
|
|
435
435
|
mockStream = {
|
|
@@ -486,16 +486,16 @@ describe('Call Tests', function () {
|
|
|
486
486
|
});
|
|
487
487
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
488
488
|
call.end();
|
|
489
|
-
_context9.next =
|
|
489
|
+
_context9.next = 1;
|
|
490
490
|
return (0, _Utils.waitForMsecs)(50);
|
|
491
|
-
case
|
|
491
|
+
case 1:
|
|
492
492
|
/* Checks for switching off the listeners on call disconnect */
|
|
493
493
|
expect(offStreamSpy).toBeCalledTimes(2);
|
|
494
494
|
expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
|
|
495
495
|
expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
496
496
|
expect(offEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Enabled, expect.any(Function));
|
|
497
497
|
expect(offEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Disabled, expect.any(Function));
|
|
498
|
-
case
|
|
498
|
+
case 2:
|
|
499
499
|
case "end":
|
|
500
500
|
return _context9.stop();
|
|
501
501
|
}
|
|
@@ -503,7 +503,7 @@ describe('Call Tests', function () {
|
|
|
503
503
|
})));
|
|
504
504
|
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
505
505
|
var mockStream, localAudioStream, warnSpy, call;
|
|
506
|
-
return _regenerator.default.wrap(function
|
|
506
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
507
507
|
while (1) switch (_context0.prev = _context0.next) {
|
|
508
508
|
case 0:
|
|
509
509
|
mockStream = {
|
|
@@ -528,9 +528,9 @@ describe('Call Tests', function () {
|
|
|
528
528
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
529
529
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
530
530
|
call.answer(localAudioStream);
|
|
531
|
-
_context0.next =
|
|
531
|
+
_context0.next = 1;
|
|
532
532
|
return (0, _Utils.waitForMsecs)(50);
|
|
533
|
-
case
|
|
533
|
+
case 1:
|
|
534
534
|
expect(warnSpy).toBeCalledTimes(2);
|
|
535
535
|
expect(warnSpy).toBeCalledWith("Did not find a local track while answering the call ".concat(call.getCorrelationId()), {
|
|
536
536
|
file: 'call',
|
|
@@ -541,7 +541,7 @@ describe('Call Tests', function () {
|
|
|
541
541
|
expect(call.getDisconnectReason().code).toBe(_types5.DisconnectCode.MEDIA_INACTIVITY);
|
|
542
542
|
expect(call.getDisconnectReason().cause).toBe(_types5.DisconnectCause.MEDIA_INACTIVITY);
|
|
543
543
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
544
|
-
case
|
|
544
|
+
case 2:
|
|
545
545
|
case "end":
|
|
546
546
|
return _context0.stop();
|
|
547
547
|
}
|
|
@@ -549,7 +549,7 @@ describe('Call Tests', function () {
|
|
|
549
549
|
})));
|
|
550
550
|
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
551
551
|
var mockStream, localAudioStream, warnSpy, call;
|
|
552
|
-
return _regenerator.default.wrap(function
|
|
552
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
553
553
|
while (1) switch (_context1.prev = _context1.next) {
|
|
554
554
|
case 0:
|
|
555
555
|
mockStream = {
|
|
@@ -562,9 +562,9 @@ describe('Call Tests', function () {
|
|
|
562
562
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
563
563
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
564
564
|
call.dial(localAudioStream);
|
|
565
|
-
_context1.next =
|
|
565
|
+
_context1.next = 1;
|
|
566
566
|
return (0, _Utils.waitForMsecs)(50);
|
|
567
|
-
case
|
|
567
|
+
case 1:
|
|
568
568
|
expect(warnSpy).toBeCalledTimes(1);
|
|
569
569
|
expect(warnSpy).toBeCalledWith("Did not find a local track while dialing the call ".concat(call.getCorrelationId()), {
|
|
570
570
|
file: 'call',
|
|
@@ -573,7 +573,7 @@ describe('Call Tests', function () {
|
|
|
573
573
|
expect(call['callStateMachine'].state.value).toBe('S_IDLE');
|
|
574
574
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_IDLE');
|
|
575
575
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
576
|
-
case
|
|
576
|
+
case 2:
|
|
577
577
|
case "end":
|
|
578
578
|
return _context1.stop();
|
|
579
579
|
}
|
|
@@ -653,7 +653,7 @@ describe('Call Tests', function () {
|
|
|
653
653
|
});
|
|
654
654
|
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
655
655
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
656
|
-
return _regenerator.default.wrap(function
|
|
656
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
657
657
|
while (1) switch (_context10.prev = _context10.next) {
|
|
658
658
|
case 0:
|
|
659
659
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
@@ -728,7 +728,7 @@ describe('Call Tests', function () {
|
|
|
728
728
|
call.mute(localAudioStream, _types5.MUTE_TYPE.USER);
|
|
729
729
|
expect(call.isMuted()).toEqual(false);
|
|
730
730
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
731
|
-
case
|
|
731
|
+
case 1:
|
|
732
732
|
case "end":
|
|
733
733
|
return _context10.stop();
|
|
734
734
|
}
|
|
@@ -742,7 +742,7 @@ describe('Call Tests', function () {
|
|
|
742
742
|
var call;
|
|
743
743
|
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
744
744
|
var requestSpy, requestArgs;
|
|
745
|
-
return _regenerator.default.wrap(function
|
|
745
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
746
746
|
while (1) switch (_context11.prev = _context11.next) {
|
|
747
747
|
case 0:
|
|
748
748
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
@@ -754,7 +754,7 @@ describe('Call Tests', function () {
|
|
|
754
754
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
755
755
|
requestArgs = requestSpy.mock.calls[0][0];
|
|
756
756
|
expect('callee' in requestArgs.body).toBe(true);
|
|
757
|
-
case
|
|
757
|
+
case 1:
|
|
758
758
|
case "end":
|
|
759
759
|
return _context11.stop();
|
|
760
760
|
}
|
|
@@ -762,7 +762,7 @@ describe('Call Tests', function () {
|
|
|
762
762
|
})));
|
|
763
763
|
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
764
764
|
var requestSpy, requestArgs;
|
|
765
|
-
return _regenerator.default.wrap(function
|
|
765
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
766
766
|
while (1) switch (_context12.prev = _context12.next) {
|
|
767
767
|
case 0:
|
|
768
768
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
@@ -774,7 +774,7 @@ describe('Call Tests', function () {
|
|
|
774
774
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
775
775
|
requestArgs = requestSpy.mock.calls[0][0];
|
|
776
776
|
expect('callee' in requestArgs.body).toBe(false);
|
|
777
|
-
case
|
|
777
|
+
case 1:
|
|
778
778
|
case "end":
|
|
779
779
|
return _context12.stop();
|
|
780
780
|
}
|
|
@@ -813,7 +813,7 @@ describe('State Machine handler tests', function () {
|
|
|
813
813
|
|
|
814
814
|
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
815
815
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
816
|
-
return _regenerator.default.wrap(function
|
|
816
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
817
817
|
while (1) switch (_context13.prev = _context13.next) {
|
|
818
818
|
case 0:
|
|
819
819
|
statusPayload = {
|
|
@@ -834,9 +834,9 @@ describe('State Machine handler tests', function () {
|
|
|
834
834
|
/* This is to flush all the promises from the Promise queue so that
|
|
835
835
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
836
836
|
*/
|
|
837
|
-
_context13.next =
|
|
837
|
+
_context13.next = 1;
|
|
838
838
|
return (0, _testUtil.flushPromises)(3);
|
|
839
|
-
case
|
|
839
|
+
case 1:
|
|
840
840
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
841
841
|
expect(setInterval).toHaveBeenCalledWith(expect.any(Function), _constants.DEFAULT_SESSION_TIMER);
|
|
842
842
|
expect(funcSpy).toBeCalledTimes(1);
|
|
@@ -848,7 +848,7 @@ describe('State Machine handler tests', function () {
|
|
|
848
848
|
file: 'call',
|
|
849
849
|
method: 'handleCallEstablished'
|
|
850
850
|
});
|
|
851
|
-
case
|
|
851
|
+
case 2:
|
|
852
852
|
case "end":
|
|
853
853
|
return _context13.stop();
|
|
854
854
|
}
|
|
@@ -856,7 +856,7 @@ describe('State Machine handler tests', function () {
|
|
|
856
856
|
})));
|
|
857
857
|
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
858
858
|
var statusPayload, emitSpy, funcSpy;
|
|
859
|
-
return _regenerator.default.wrap(function
|
|
859
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
860
860
|
while (1) switch (_context14.prev = _context14.next) {
|
|
861
861
|
case 0:
|
|
862
862
|
expect.assertions(4);
|
|
@@ -872,16 +872,16 @@ describe('State Machine handler tests', function () {
|
|
|
872
872
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
873
873
|
call['handleCallEstablished']({});
|
|
874
874
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
875
|
-
_context14.next =
|
|
875
|
+
_context14.next = 1;
|
|
876
876
|
return _promise.default.resolve();
|
|
877
|
-
case
|
|
878
|
-
_context14.next =
|
|
877
|
+
case 1:
|
|
878
|
+
_context14.next = 2;
|
|
879
879
|
return _promise.default.resolve();
|
|
880
|
-
case
|
|
880
|
+
case 2:
|
|
881
881
|
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
882
882
|
expect(funcSpy).toBeCalledTimes(1);
|
|
883
883
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
884
|
-
case
|
|
884
|
+
case 3:
|
|
885
885
|
case "end":
|
|
886
886
|
return _context14.stop();
|
|
887
887
|
}
|
|
@@ -889,7 +889,7 @@ describe('State Machine handler tests', function () {
|
|
|
889
889
|
})));
|
|
890
890
|
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
891
891
|
var statusPayload, funcSpy;
|
|
892
|
-
return _regenerator.default.wrap(function
|
|
892
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
893
893
|
while (1) switch (_context15.prev = _context15.next) {
|
|
894
894
|
case 0:
|
|
895
895
|
expect.assertions(4);
|
|
@@ -909,12 +909,12 @@ describe('State Machine handler tests', function () {
|
|
|
909
909
|
/* This is to flush all the promises from the Promise queue so that
|
|
910
910
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
911
911
|
*/
|
|
912
|
-
_context15.next =
|
|
912
|
+
_context15.next = 1;
|
|
913
913
|
return (0, _testUtil.flushPromises)(2);
|
|
914
|
-
case
|
|
914
|
+
case 1:
|
|
915
915
|
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
916
916
|
expect(funcSpy).toBeCalledTimes(1);
|
|
917
|
-
case
|
|
917
|
+
case 2:
|
|
918
918
|
case "end":
|
|
919
919
|
return _context15.stop();
|
|
920
920
|
}
|
|
@@ -922,7 +922,7 @@ describe('State Machine handler tests', function () {
|
|
|
922
922
|
})));
|
|
923
923
|
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
924
924
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
925
|
-
return _regenerator.default.wrap(function
|
|
925
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
926
926
|
while (1) switch (_context16.prev = _context16.next) {
|
|
927
927
|
case 0:
|
|
928
928
|
errorPayload = {
|
|
@@ -941,19 +941,19 @@ describe('State Machine handler tests', function () {
|
|
|
941
941
|
call['handleCallEstablished']({});
|
|
942
942
|
}
|
|
943
943
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
944
|
-
_context16.next =
|
|
944
|
+
_context16.next = 1;
|
|
945
945
|
return (0, _testUtil.flushPromises)(2);
|
|
946
|
-
case
|
|
946
|
+
case 1:
|
|
947
947
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
948
948
|
|
|
949
949
|
// Now advance by 1 second for the retry-after interval
|
|
950
950
|
jest.advanceTimersByTime(1000);
|
|
951
|
-
_context16.next =
|
|
951
|
+
_context16.next = 2;
|
|
952
952
|
return (0, _testUtil.flushPromises)(2);
|
|
953
|
-
case
|
|
953
|
+
case 2:
|
|
954
954
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
955
955
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
956
|
-
case
|
|
956
|
+
case 3:
|
|
957
957
|
case "end":
|
|
958
958
|
return _context16.stop();
|
|
959
959
|
}
|
|
@@ -961,7 +961,7 @@ describe('State Machine handler tests', function () {
|
|
|
961
961
|
})));
|
|
962
962
|
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
963
963
|
var errorPayload, warnSpy, postStatusSpy;
|
|
964
|
-
return _regenerator.default.wrap(function
|
|
964
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
965
965
|
while (1) switch (_context17.prev = _context17.next) {
|
|
966
966
|
case 0:
|
|
967
967
|
errorPayload = {
|
|
@@ -981,27 +981,27 @@ describe('State Machine handler tests', function () {
|
|
|
981
981
|
|
|
982
982
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
983
983
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
984
|
-
_context17.next =
|
|
984
|
+
_context17.next = 1;
|
|
985
985
|
return (0, _testUtil.flushPromises)(2);
|
|
986
|
-
case
|
|
986
|
+
case 1:
|
|
987
987
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
988
988
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
989
989
|
jest.advanceTimersByTime(1000);
|
|
990
|
-
_context17.next =
|
|
990
|
+
_context17.next = 2;
|
|
991
991
|
return (0, _testUtil.flushPromises)(2);
|
|
992
|
-
case
|
|
992
|
+
case 2:
|
|
993
993
|
jest.advanceTimersByTime(1000);
|
|
994
|
-
_context17.next =
|
|
994
|
+
_context17.next = 3;
|
|
995
995
|
return (0, _testUtil.flushPromises)(2);
|
|
996
|
-
case
|
|
996
|
+
case 3:
|
|
997
997
|
jest.advanceTimersByTime(1000);
|
|
998
|
-
_context17.next =
|
|
998
|
+
_context17.next = 4;
|
|
999
999
|
return (0, _testUtil.flushPromises)(2);
|
|
1000
|
-
case
|
|
1000
|
+
case 4:
|
|
1001
1001
|
jest.advanceTimersByTime(1000);
|
|
1002
|
-
_context17.next =
|
|
1002
|
+
_context17.next = 5;
|
|
1003
1003
|
return (0, _testUtil.flushPromises)(2);
|
|
1004
|
-
case
|
|
1004
|
+
case 5:
|
|
1005
1005
|
// The error handler should detect we're at max retry count and stop
|
|
1006
1006
|
expect(warnSpy).toHaveBeenCalledWith("Max keepalive retry attempts reached. Aborting call keepalive for callId: ".concat(call.getCallId()), {
|
|
1007
1007
|
file: 'call',
|
|
@@ -1009,7 +1009,7 @@ describe('State Machine handler tests', function () {
|
|
|
1009
1009
|
});
|
|
1010
1010
|
expect(postStatusSpy).toHaveBeenCalledTimes(5);
|
|
1011
1011
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1012
|
-
case
|
|
1012
|
+
case 6:
|
|
1013
1013
|
case "end":
|
|
1014
1014
|
return _context17.stop();
|
|
1015
1015
|
}
|
|
@@ -1017,7 +1017,7 @@ describe('State Machine handler tests', function () {
|
|
|
1017
1017
|
})));
|
|
1018
1018
|
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
1019
1019
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1020
|
-
return _regenerator.default.wrap(function
|
|
1020
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1021
1021
|
while (1) switch (_context18.prev = _context18.next) {
|
|
1022
1022
|
case 0:
|
|
1023
1023
|
statusPayload = {
|
|
@@ -1072,7 +1072,7 @@ describe('State Machine handler tests', function () {
|
|
|
1072
1072
|
});
|
|
1073
1073
|
expect(deleteSpy).toBeCalledOnceWith();
|
|
1074
1074
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1075
|
-
case
|
|
1075
|
+
case 1:
|
|
1076
1076
|
case "end":
|
|
1077
1077
|
return _context18.stop();
|
|
1078
1078
|
}
|
|
@@ -1080,7 +1080,7 @@ describe('State Machine handler tests', function () {
|
|
|
1080
1080
|
})));
|
|
1081
1081
|
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1082
1082
|
var statusPayload, dummyEvent;
|
|
1083
|
-
return _regenerator.default.wrap(function
|
|
1083
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1084
1084
|
while (1) switch (_context19.prev = _context19.next) {
|
|
1085
1085
|
case 0:
|
|
1086
1086
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
@@ -1099,11 +1099,11 @@ describe('State Machine handler tests', function () {
|
|
|
1099
1099
|
webex.request.mockReturnValue(statusPayload);
|
|
1100
1100
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1101
1101
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1102
|
-
_context19.next =
|
|
1102
|
+
_context19.next = 1;
|
|
1103
1103
|
return call['handleOutgoingCallConnect']({
|
|
1104
1104
|
type: 'E_SEND_CALL_CONNECT'
|
|
1105
1105
|
});
|
|
1106
|
-
case
|
|
1106
|
+
case 1:
|
|
1107
1107
|
/* state should not change since there is no offer received. */
|
|
1108
1108
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1109
1109
|
expect(call.isConnected()).toBeFalsy();
|
|
@@ -1111,7 +1111,7 @@ describe('State Machine handler tests', function () {
|
|
|
1111
1111
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
1112
1112
|
});
|
|
1113
1113
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1114
|
-
case
|
|
1114
|
+
case 2:
|
|
1115
1115
|
case "end":
|
|
1116
1116
|
return _context19.stop();
|
|
1117
1117
|
}
|
|
@@ -1119,7 +1119,7 @@ describe('State Machine handler tests', function () {
|
|
|
1119
1119
|
})));
|
|
1120
1120
|
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1121
1121
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1122
|
-
return _regenerator.default.wrap(function
|
|
1122
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1123
1123
|
while (1) switch (_context20.prev = _context20.next) {
|
|
1124
1124
|
case 0:
|
|
1125
1125
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
@@ -1147,16 +1147,16 @@ describe('State Machine handler tests', function () {
|
|
|
1147
1147
|
webex.request.mockRejectedValueOnce({
|
|
1148
1148
|
statusCode: 403
|
|
1149
1149
|
}).mockResolvedValue(statusPayload);
|
|
1150
|
-
_context20.next =
|
|
1150
|
+
_context20.next = 1;
|
|
1151
1151
|
return call['handleOutgoingCallConnect']({
|
|
1152
1152
|
type: 'E_SEND_CALL_CONNECT'
|
|
1153
1153
|
});
|
|
1154
|
-
case
|
|
1154
|
+
case 1:
|
|
1155
1155
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1156
1156
|
expect(stateMachineSpy).toBeCalledTimes(3);
|
|
1157
1157
|
expect(warnSpy).toBeCalledTimes(3);
|
|
1158
1158
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1159
|
-
case
|
|
1159
|
+
case 2:
|
|
1160
1160
|
case "end":
|
|
1161
1161
|
return _context20.stop();
|
|
1162
1162
|
}
|
|
@@ -1164,7 +1164,7 @@ describe('State Machine handler tests', function () {
|
|
|
1164
1164
|
})));
|
|
1165
1165
|
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1166
1166
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1167
|
-
return _regenerator.default.wrap(function
|
|
1167
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1168
1168
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1169
1169
|
case 0:
|
|
1170
1170
|
statusPayload = {
|
|
@@ -1239,7 +1239,7 @@ describe('State Machine handler tests', function () {
|
|
|
1239
1239
|
type: 'E_SEND_CALL_DISCONNECT'
|
|
1240
1240
|
});
|
|
1241
1241
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1242
|
-
case
|
|
1242
|
+
case 1:
|
|
1243
1243
|
case "end":
|
|
1244
1244
|
return _context21.stop();
|
|
1245
1245
|
}
|
|
@@ -1247,7 +1247,7 @@ describe('State Machine handler tests', function () {
|
|
|
1247
1247
|
})));
|
|
1248
1248
|
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 _callee22() {
|
|
1249
1249
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1250
|
-
return _regenerator.default.wrap(function
|
|
1250
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1251
1251
|
while (1) switch (_context22.prev = _context22.next) {
|
|
1252
1252
|
case 0:
|
|
1253
1253
|
statusPayload = {
|
|
@@ -1314,7 +1314,7 @@ describe('State Machine handler tests', function () {
|
|
|
1314
1314
|
type: 'E_SEND_CALL_DISCONNECT'
|
|
1315
1315
|
});
|
|
1316
1316
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1317
|
-
case
|
|
1317
|
+
case 1:
|
|
1318
1318
|
case "end":
|
|
1319
1319
|
return _context22.stop();
|
|
1320
1320
|
}
|
|
@@ -1322,7 +1322,7 @@ describe('State Machine handler tests', function () {
|
|
|
1322
1322
|
})));
|
|
1323
1323
|
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1324
1324
|
var statusPayload, dummyEvent;
|
|
1325
|
-
return _regenerator.default.wrap(function
|
|
1325
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1326
1326
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1327
1327
|
case 0:
|
|
1328
1328
|
statusPayload = {
|
|
@@ -1360,7 +1360,7 @@ describe('State Machine handler tests', function () {
|
|
|
1360
1360
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
1361
1361
|
});
|
|
1362
1362
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1363
|
-
case
|
|
1363
|
+
case 1:
|
|
1364
1364
|
case "end":
|
|
1365
1365
|
return _context23.stop();
|
|
1366
1366
|
}
|
|
@@ -1368,7 +1368,7 @@ describe('State Machine handler tests', function () {
|
|
|
1368
1368
|
})));
|
|
1369
1369
|
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1370
1370
|
var statusPayload, dummyEvent, errorSpy;
|
|
1371
|
-
return _regenerator.default.wrap(function
|
|
1371
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1372
1372
|
while (1) switch (_context24.prev = _context24.next) {
|
|
1373
1373
|
case 0:
|
|
1374
1374
|
statusPayload = {
|
|
@@ -1386,16 +1386,16 @@ describe('State Machine handler tests', function () {
|
|
|
1386
1386
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1387
1387
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1388
1388
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1389
|
-
_context24.next =
|
|
1389
|
+
_context24.next = 1;
|
|
1390
1390
|
return (0, _testUtil.flushPromises)(3);
|
|
1391
|
-
case
|
|
1391
|
+
case 1:
|
|
1392
1392
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1393
1393
|
expect(errorSpy).toHaveBeenCalled();
|
|
1394
1394
|
expect(uploadLogsSpy).toHaveBeenCalledWith({
|
|
1395
1395
|
correlationId: call.getCorrelationId(),
|
|
1396
1396
|
callId: call.getCallId()
|
|
1397
1397
|
});
|
|
1398
|
-
case
|
|
1398
|
+
case 2:
|
|
1399
1399
|
case "end":
|
|
1400
1400
|
return _context24.stop();
|
|
1401
1401
|
}
|
|
@@ -1403,7 +1403,7 @@ describe('State Machine handler tests', function () {
|
|
|
1403
1403
|
})));
|
|
1404
1404
|
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1405
1405
|
var statusPayload, dummyEvent, warnSpy;
|
|
1406
|
-
return _regenerator.default.wrap(function
|
|
1406
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1407
1407
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1408
1408
|
case 0:
|
|
1409
1409
|
statusPayload = {
|
|
@@ -1423,12 +1423,12 @@ describe('State Machine handler tests', function () {
|
|
|
1423
1423
|
webex.request.mockRejectedValue(statusPayload);
|
|
1424
1424
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1425
1425
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1426
|
-
_context25.next =
|
|
1426
|
+
_context25.next = 1;
|
|
1427
1427
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1428
|
-
case
|
|
1429
|
-
_context25.next =
|
|
1428
|
+
case 1:
|
|
1429
|
+
_context25.next = 2;
|
|
1430
1430
|
return (0, _testUtil.flushPromises)(2);
|
|
1431
|
-
case
|
|
1431
|
+
case 2:
|
|
1432
1432
|
expect(call.isConnected()).toBe(false);
|
|
1433
1433
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1434
1434
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
@@ -1440,7 +1440,7 @@ describe('State Machine handler tests', function () {
|
|
|
1440
1440
|
file: 'call',
|
|
1441
1441
|
method: 'handleRoapError'
|
|
1442
1442
|
});
|
|
1443
|
-
case
|
|
1443
|
+
case 3:
|
|
1444
1444
|
case "end":
|
|
1445
1445
|
return _context25.stop();
|
|
1446
1446
|
}
|
|
@@ -1448,7 +1448,7 @@ describe('State Machine handler tests', function () {
|
|
|
1448
1448
|
})));
|
|
1449
1449
|
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1450
1450
|
var statusPayload, dummyEvent;
|
|
1451
|
-
return _regenerator.default.wrap(function
|
|
1451
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1452
1452
|
while (1) switch (_context26.prev = _context26.next) {
|
|
1453
1453
|
case 0:
|
|
1454
1454
|
statusPayload = {
|
|
@@ -1470,7 +1470,7 @@ describe('State Machine handler tests', function () {
|
|
|
1470
1470
|
and an initiateOffer request to be sent to SDK only once */
|
|
1471
1471
|
expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
|
|
1472
1472
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1473
|
-
case
|
|
1473
|
+
case 1:
|
|
1474
1474
|
case "end":
|
|
1475
1475
|
return _context26.stop();
|
|
1476
1476
|
}
|
|
@@ -1478,7 +1478,7 @@ describe('State Machine handler tests', function () {
|
|
|
1478
1478
|
})));
|
|
1479
1479
|
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1480
1480
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1481
|
-
return _regenerator.default.wrap(function
|
|
1481
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1482
1482
|
while (1) switch (_context27.prev = _context27.next) {
|
|
1483
1483
|
case 0:
|
|
1484
1484
|
statusPayload = {
|
|
@@ -1501,9 +1501,9 @@ describe('State Machine handler tests', function () {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
};
|
|
1503
1503
|
call['connected'] = true;
|
|
1504
|
-
_context27.next =
|
|
1504
|
+
_context27.next = 1;
|
|
1505
1505
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1506
|
-
case
|
|
1506
|
+
case 1:
|
|
1507
1507
|
jest.advanceTimersByTime(1005);
|
|
1508
1508
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
1509
1509
|
expect(funcSpy).toHaveBeenCalledWith(dummyEvent.data);
|
|
@@ -1511,7 +1511,7 @@ describe('State Machine handler tests', function () {
|
|
|
1511
1511
|
/* first failure , and second because of retry-after */
|
|
1512
1512
|
expect(funcSpy).toHaveBeenCalledTimes(2);
|
|
1513
1513
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1514
|
-
case
|
|
1514
|
+
case 2:
|
|
1515
1515
|
case "end":
|
|
1516
1516
|
return _context27.stop();
|
|
1517
1517
|
}
|
|
@@ -1519,7 +1519,7 @@ describe('State Machine handler tests', function () {
|
|
|
1519
1519
|
})));
|
|
1520
1520
|
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1521
1521
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1522
|
-
return _regenerator.default.wrap(function
|
|
1522
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1523
1523
|
while (1) switch (_context28.prev = _context28.next) {
|
|
1524
1524
|
case 0:
|
|
1525
1525
|
statusPayload = {
|
|
@@ -1542,16 +1542,16 @@ describe('State Machine handler tests', function () {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
};
|
|
1544
1544
|
call['connected'] = false;
|
|
1545
|
-
_context28.next =
|
|
1545
|
+
_context28.next = 1;
|
|
1546
1546
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1547
|
-
case
|
|
1547
|
+
case 1:
|
|
1548
1548
|
jest.advanceTimersByTime(1005);
|
|
1549
1549
|
expect(funcSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
1550
1550
|
|
|
1551
1551
|
/* These shouldn't be called as call is not connected yet */
|
|
1552
1552
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
1553
1553
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1554
|
-
case
|
|
1554
|
+
case 2:
|
|
1555
1555
|
case "end":
|
|
1556
1556
|
return _context28.stop();
|
|
1557
1557
|
}
|
|
@@ -1559,7 +1559,7 @@ describe('State Machine handler tests', function () {
|
|
|
1559
1559
|
})));
|
|
1560
1560
|
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1561
1561
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1562
|
-
return _regenerator.default.wrap(function
|
|
1562
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1563
1563
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1564
1564
|
case 0:
|
|
1565
1565
|
statusPayload = {
|
|
@@ -1582,9 +1582,9 @@ describe('State Machine handler tests', function () {
|
|
|
1582
1582
|
};
|
|
1583
1583
|
call['connected'] = true;
|
|
1584
1584
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1585
|
-
_context29.next =
|
|
1585
|
+
_context29.next = 1;
|
|
1586
1586
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1587
|
-
case
|
|
1587
|
+
case 1:
|
|
1588
1588
|
jest.advanceTimersByTime(1005);
|
|
1589
1589
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
1590
1590
|
expect(funcSpy).toHaveBeenCalledWith(dummyEvent.data);
|
|
@@ -1592,7 +1592,7 @@ describe('State Machine handler tests', function () {
|
|
|
1592
1592
|
/* first failure , and second because of retry-after */
|
|
1593
1593
|
expect(funcSpy).toHaveBeenCalledTimes(2);
|
|
1594
1594
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1595
|
-
case
|
|
1595
|
+
case 2:
|
|
1596
1596
|
case "end":
|
|
1597
1597
|
return _context29.stop();
|
|
1598
1598
|
}
|
|
@@ -1600,7 +1600,7 @@ describe('State Machine handler tests', function () {
|
|
|
1600
1600
|
})));
|
|
1601
1601
|
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1602
1602
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1603
|
-
return _regenerator.default.wrap(function
|
|
1603
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1604
1604
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1605
1605
|
case 0:
|
|
1606
1606
|
statusPayload = {
|
|
@@ -1622,9 +1622,9 @@ describe('State Machine handler tests', function () {
|
|
|
1622
1622
|
}
|
|
1623
1623
|
};
|
|
1624
1624
|
call['connected'] = false;
|
|
1625
|
-
_context30.next =
|
|
1625
|
+
_context30.next = 1;
|
|
1626
1626
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1627
|
-
case
|
|
1627
|
+
case 1:
|
|
1628
1628
|
jest.advanceTimersByTime(1005);
|
|
1629
1629
|
expect(funcSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
1630
1630
|
expect(funcSpy).toHaveBeenCalledTimes(1);
|
|
@@ -1632,7 +1632,7 @@ describe('State Machine handler tests', function () {
|
|
|
1632
1632
|
/* These shouldn't be called as call is not connected yet */
|
|
1633
1633
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
1634
1634
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1635
|
-
case
|
|
1635
|
+
case 2:
|
|
1636
1636
|
case "end":
|
|
1637
1637
|
return _context30.stop();
|
|
1638
1638
|
}
|
|
@@ -1640,7 +1640,7 @@ describe('State Machine handler tests', function () {
|
|
|
1640
1640
|
})));
|
|
1641
1641
|
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1642
1642
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1643
|
-
return _regenerator.default.wrap(function
|
|
1643
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1644
1644
|
while (1) switch (_context31.prev = _context31.next) {
|
|
1645
1645
|
case 0:
|
|
1646
1646
|
statusPayload = {
|
|
@@ -1664,7 +1664,7 @@ describe('State Machine handler tests', function () {
|
|
|
1664
1664
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
1665
1665
|
expect(warnSpy).not.toHaveBeenCalled();
|
|
1666
1666
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1667
|
-
case
|
|
1667
|
+
case 1:
|
|
1668
1668
|
case "end":
|
|
1669
1669
|
return _context31.stop();
|
|
1670
1670
|
}
|
|
@@ -1672,7 +1672,7 @@ describe('State Machine handler tests', function () {
|
|
|
1672
1672
|
})));
|
|
1673
1673
|
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1674
1674
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1675
|
-
return _regenerator.default.wrap(function
|
|
1675
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
1676
1676
|
while (1) switch (_context32.prev = _context32.next) {
|
|
1677
1677
|
case 0:
|
|
1678
1678
|
statusPayload = {
|
|
@@ -1695,9 +1695,9 @@ describe('State Machine handler tests', function () {
|
|
|
1695
1695
|
};
|
|
1696
1696
|
call['connected'] = true;
|
|
1697
1697
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1698
|
-
_context32.next =
|
|
1698
|
+
_context32.next = 1;
|
|
1699
1699
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1700
|
-
case
|
|
1700
|
+
case 1:
|
|
1701
1701
|
jest.advanceTimersByTime(1005);
|
|
1702
1702
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
1703
1703
|
expect(funcSpy).toHaveBeenCalled();
|
|
@@ -1705,7 +1705,7 @@ describe('State Machine handler tests', function () {
|
|
|
1705
1705
|
/* first failure , and second because of retry-after */
|
|
1706
1706
|
expect(funcSpy).toHaveBeenCalledTimes(2);
|
|
1707
1707
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1708
|
-
case
|
|
1708
|
+
case 2:
|
|
1709
1709
|
case "end":
|
|
1710
1710
|
return _context32.stop();
|
|
1711
1711
|
}
|
|
@@ -1713,7 +1713,7 @@ describe('State Machine handler tests', function () {
|
|
|
1713
1713
|
})));
|
|
1714
1714
|
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1715
1715
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1716
|
-
return _regenerator.default.wrap(function
|
|
1716
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
1717
1717
|
while (1) switch (_context33.prev = _context33.next) {
|
|
1718
1718
|
case 0:
|
|
1719
1719
|
statusPayload = {
|
|
@@ -1735,7 +1735,7 @@ describe('State Machine handler tests', function () {
|
|
|
1735
1735
|
call.sendMediaStateMachineEvt(errorEvent);
|
|
1736
1736
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
1737
1737
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1738
|
-
case
|
|
1738
|
+
case 1:
|
|
1739
1739
|
case "end":
|
|
1740
1740
|
return _context33.stop();
|
|
1741
1741
|
}
|
|
@@ -1743,7 +1743,7 @@ describe('State Machine handler tests', function () {
|
|
|
1743
1743
|
})));
|
|
1744
1744
|
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1745
1745
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1746
|
-
return _regenerator.default.wrap(function
|
|
1746
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
1747
1747
|
while (1) switch (_context34.prev = _context34.next) {
|
|
1748
1748
|
case 0:
|
|
1749
1749
|
statusPayload = {
|
|
@@ -1762,9 +1762,9 @@ describe('State Machine handler tests', function () {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
};
|
|
1764
1764
|
call['connected'] = false;
|
|
1765
|
-
_context34.next =
|
|
1765
|
+
_context34.next = 1;
|
|
1766
1766
|
return call['handleRoapError']({}, errorEvent);
|
|
1767
|
-
case
|
|
1767
|
+
case 1:
|
|
1768
1768
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
1769
1769
|
expect(warnSpy).toBeCalledOnceWith('Call failed due to media issue', {
|
|
1770
1770
|
file: 'call',
|
|
@@ -1776,7 +1776,7 @@ describe('State Machine handler tests', function () {
|
|
|
1776
1776
|
},
|
|
1777
1777
|
type: 'E_UNKNOWN'
|
|
1778
1778
|
});
|
|
1779
|
-
case
|
|
1779
|
+
case 2:
|
|
1780
1780
|
case "end":
|
|
1781
1781
|
return _context34.stop();
|
|
1782
1782
|
}
|
|
@@ -1784,7 +1784,7 @@ describe('State Machine handler tests', function () {
|
|
|
1784
1784
|
})));
|
|
1785
1785
|
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1786
1786
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1787
|
-
return _regenerator.default.wrap(function
|
|
1787
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
1788
1788
|
while (1) switch (_context35.prev = _context35.next) {
|
|
1789
1789
|
case 0:
|
|
1790
1790
|
statusPayload = {
|
|
@@ -1823,12 +1823,12 @@ describe('State Machine handler tests', function () {
|
|
|
1823
1823
|
messageType: 'ANSWER'
|
|
1824
1824
|
}
|
|
1825
1825
|
};
|
|
1826
|
-
_context35.next =
|
|
1826
|
+
_context35.next = 1;
|
|
1827
1827
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1828
|
-
case
|
|
1829
|
-
_context35.next =
|
|
1828
|
+
case 1:
|
|
1829
|
+
_context35.next = 2;
|
|
1830
1830
|
return (0, _testUtil.flushPromises)(2);
|
|
1831
|
-
case
|
|
1831
|
+
case 2:
|
|
1832
1832
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
1833
1833
|
expect(warnSpy).toHaveBeenCalledWith('Failed to send MediaAnswer request', {
|
|
1834
1834
|
file: 'call',
|
|
@@ -1842,7 +1842,7 @@ describe('State Machine handler tests', function () {
|
|
|
1842
1842
|
// Final state should be torn down and cleared for unconnected call
|
|
1843
1843
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1844
1844
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1845
|
-
case
|
|
1845
|
+
case 3:
|
|
1846
1846
|
case "end":
|
|
1847
1847
|
return _context35.stop();
|
|
1848
1848
|
}
|
|
@@ -1850,7 +1850,7 @@ describe('State Machine handler tests', function () {
|
|
|
1850
1850
|
})));
|
|
1851
1851
|
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1852
1852
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1853
|
-
return _regenerator.default.wrap(function
|
|
1853
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
1854
1854
|
while (1) switch (_context36.prev = _context36.next) {
|
|
1855
1855
|
case 0:
|
|
1856
1856
|
statusPayload = {
|
|
@@ -1884,9 +1884,9 @@ describe('State Machine handler tests', function () {
|
|
|
1884
1884
|
seq: 1,
|
|
1885
1885
|
messageType: 'ANSWER'
|
|
1886
1886
|
};
|
|
1887
|
-
_context36.next =
|
|
1887
|
+
_context36.next = 1;
|
|
1888
1888
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1889
|
-
case
|
|
1889
|
+
case 1:
|
|
1890
1890
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
1891
1891
|
|
|
1892
1892
|
/* we receive roap Offer Request followed by roap Ok from mobius and handle
|
|
@@ -1906,9 +1906,9 @@ describe('State Machine handler tests', function () {
|
|
|
1906
1906
|
seq: 2,
|
|
1907
1907
|
messageType: 'OFFER_REQUEST'
|
|
1908
1908
|
};
|
|
1909
|
-
_context36.next =
|
|
1909
|
+
_context36.next = 2;
|
|
1910
1910
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1911
|
-
case
|
|
1911
|
+
case 2:
|
|
1912
1912
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
1913
1913
|
expect(_testUtil.mediaConnection.roapMessageReceived).not.toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1914
1914
|
call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
@@ -1956,18 +1956,18 @@ describe('State Machine handler tests', function () {
|
|
|
1956
1956
|
};
|
|
1957
1957
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1958
1958
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1959
|
-
_context36.next =
|
|
1959
|
+
_context36.next = 3;
|
|
1960
1960
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1961
|
-
case
|
|
1961
|
+
case 3:
|
|
1962
1962
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1963
1963
|
dummyEvent.type = 'E_SEND_ROAP_ANSWER';
|
|
1964
1964
|
dummyEvent.data = {
|
|
1965
1965
|
seq: 3,
|
|
1966
1966
|
messageType: 'ANSWER'
|
|
1967
1967
|
};
|
|
1968
|
-
_context36.next =
|
|
1968
|
+
_context36.next = 4;
|
|
1969
1969
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1970
|
-
case
|
|
1970
|
+
case 4:
|
|
1971
1971
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1972
1972
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1973
1973
|
dummyEvent.data = {
|
|
@@ -1984,9 +1984,9 @@ describe('State Machine handler tests', function () {
|
|
|
1984
1984
|
messageType: 'OK'
|
|
1985
1985
|
}
|
|
1986
1986
|
};
|
|
1987
|
-
_context36.next =
|
|
1987
|
+
_context36.next = 5;
|
|
1988
1988
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1989
|
-
case
|
|
1989
|
+
case 5:
|
|
1990
1990
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
1991
1991
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1992
1992
|
dummyEvent.type = 'E_SEND_ROAP_ANSWER';
|
|
@@ -1997,7 +1997,7 @@ describe('State Machine handler tests', function () {
|
|
|
1997
1997
|
expect(call['mediaStateMachine'].state.value).toBe('S_RECV_ROAP_OFFER');
|
|
1998
1998
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1999
1999
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2000
|
-
case
|
|
2000
|
+
case 6:
|
|
2001
2001
|
case "end":
|
|
2002
2002
|
return _context36.stop();
|
|
2003
2003
|
}
|
|
@@ -2005,7 +2005,7 @@ describe('State Machine handler tests', function () {
|
|
|
2005
2005
|
})));
|
|
2006
2006
|
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
2007
2007
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2008
|
-
return _regenerator.default.wrap(function
|
|
2008
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2009
2009
|
while (1) switch (_context37.prev = _context37.next) {
|
|
2010
2010
|
case 0:
|
|
2011
2011
|
mockStatusBody = {
|
|
@@ -2046,9 +2046,9 @@ describe('State Machine handler tests', function () {
|
|
|
2046
2046
|
seq: 1,
|
|
2047
2047
|
messageType: 'ANSWER'
|
|
2048
2048
|
};
|
|
2049
|
-
_context37.next =
|
|
2049
|
+
_context37.next = 1;
|
|
2050
2050
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2051
|
-
case
|
|
2051
|
+
case 1:
|
|
2052
2052
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
2053
2053
|
|
|
2054
2054
|
/* we receive roap Offer Request followed by roap Ok from mobius and handle
|
|
@@ -2068,9 +2068,9 @@ describe('State Machine handler tests', function () {
|
|
|
2068
2068
|
seq: 2,
|
|
2069
2069
|
messageType: 'OFFER_REQUEST'
|
|
2070
2070
|
};
|
|
2071
|
-
_context37.next =
|
|
2071
|
+
_context37.next = 2;
|
|
2072
2072
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2073
|
-
case
|
|
2073
|
+
case 2:
|
|
2074
2074
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
2075
2075
|
expect(_testUtil.mediaConnection.roapMessageReceived).not.toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2076
2076
|
call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
@@ -2118,18 +2118,18 @@ describe('State Machine handler tests', function () {
|
|
|
2118
2118
|
};
|
|
2119
2119
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2120
2120
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2121
|
-
_context37.next =
|
|
2121
|
+
_context37.next = 3;
|
|
2122
2122
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2123
|
-
case
|
|
2123
|
+
case 3:
|
|
2124
2124
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2125
2125
|
dummyEvent.type = 'E_SEND_ROAP_ANSWER';
|
|
2126
2126
|
dummyEvent.data = {
|
|
2127
2127
|
seq: 3,
|
|
2128
2128
|
messageType: 'ANSWER'
|
|
2129
2129
|
};
|
|
2130
|
-
_context37.next =
|
|
2130
|
+
_context37.next = 4;
|
|
2131
2131
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2132
|
-
case
|
|
2132
|
+
case 4:
|
|
2133
2133
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2134
2134
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2135
2135
|
dummyEvent.data = {
|
|
@@ -2144,9 +2144,9 @@ describe('State Machine handler tests', function () {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
};
|
|
2146
2146
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2147
|
-
_context37.next =
|
|
2147
|
+
_context37.next = 5;
|
|
2148
2148
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2149
|
-
case
|
|
2149
|
+
case 5:
|
|
2150
2150
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
2151
2151
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
2152
2152
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2158,7 +2158,7 @@ describe('State Machine handler tests', function () {
|
|
|
2158
2158
|
expect(call['mediaStateMachine'].state.value).toBe('S_RECV_ROAP_OFFER');
|
|
2159
2159
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2160
2160
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2161
|
-
case
|
|
2161
|
+
case 6:
|
|
2162
2162
|
case "end":
|
|
2163
2163
|
return _context37.stop();
|
|
2164
2164
|
}
|
|
@@ -2166,7 +2166,7 @@ describe('State Machine handler tests', function () {
|
|
|
2166
2166
|
})));
|
|
2167
2167
|
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
2168
2168
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2169
|
-
return _regenerator.default.wrap(function
|
|
2169
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2170
2170
|
while (1) switch (_context38.prev = _context38.next) {
|
|
2171
2171
|
case 0:
|
|
2172
2172
|
statusPayload = {
|
|
@@ -2232,7 +2232,7 @@ describe('State Machine handler tests', function () {
|
|
|
2232
2232
|
file: 'call',
|
|
2233
2233
|
method: 'handleCallHold'
|
|
2234
2234
|
});
|
|
2235
|
-
case
|
|
2235
|
+
case 1:
|
|
2236
2236
|
case "end":
|
|
2237
2237
|
return _context38.stop();
|
|
2238
2238
|
}
|
|
@@ -2240,7 +2240,7 @@ describe('State Machine handler tests', function () {
|
|
|
2240
2240
|
})));
|
|
2241
2241
|
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2242
2242
|
var emitSpy, deleteSpy;
|
|
2243
|
-
return _regenerator.default.wrap(function
|
|
2243
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2244
2244
|
while (1) switch (_context39.prev = _context39.next) {
|
|
2245
2245
|
case 0:
|
|
2246
2246
|
emitSpy = jest.spyOn(call, 'emit');
|
|
@@ -2250,13 +2250,13 @@ describe('State Machine handler tests', function () {
|
|
|
2250
2250
|
call.sendCallStateMachineEvt({
|
|
2251
2251
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2252
2252
|
});
|
|
2253
|
-
_context39.next =
|
|
2253
|
+
_context39.next = 1;
|
|
2254
2254
|
return (0, _testUtil.flushPromises)(1);
|
|
2255
|
-
case
|
|
2255
|
+
case 1:
|
|
2256
2256
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
2257
2257
|
expect(deleteSpy).toHaveBeenCalled();
|
|
2258
2258
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2259
|
-
case
|
|
2259
|
+
case 2:
|
|
2260
2260
|
case "end":
|
|
2261
2261
|
return _context39.stop();
|
|
2262
2262
|
}
|
|
@@ -2273,7 +2273,7 @@ describe('State Machine handler tests', function () {
|
|
|
2273
2273
|
});
|
|
2274
2274
|
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2275
2275
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2276
|
-
return _regenerator.default.wrap(function
|
|
2276
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2277
2277
|
while (1) switch (_context40.prev = _context40.next) {
|
|
2278
2278
|
case 0:
|
|
2279
2279
|
statusPayload = {
|
|
@@ -2291,9 +2291,9 @@ describe('State Machine handler tests', function () {
|
|
|
2291
2291
|
webex.request.mockReturnValue(statusPayload);
|
|
2292
2292
|
|
|
2293
2293
|
// handleOutgoingCallSetup is asynchronous
|
|
2294
|
-
_context40.next =
|
|
2294
|
+
_context40.next = 1;
|
|
2295
2295
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2296
|
-
case
|
|
2296
|
+
case 1:
|
|
2297
2297
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
2298
2298
|
dummyEvent.type = 'E_RECV_CALL_PROGRESS';
|
|
2299
2299
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
@@ -2332,7 +2332,7 @@ describe('State Machine handler tests', function () {
|
|
|
2332
2332
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
2333
2333
|
expect(deleteSpy).toHaveBeenCalledTimes(1);
|
|
2334
2334
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2335
|
-
case
|
|
2335
|
+
case 2:
|
|
2336
2336
|
case "end":
|
|
2337
2337
|
return _context40.stop();
|
|
2338
2338
|
}
|
|
@@ -2340,7 +2340,7 @@ describe('State Machine handler tests', function () {
|
|
|
2340
2340
|
})));
|
|
2341
2341
|
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2342
2342
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2343
|
-
return _regenerator.default.wrap(function
|
|
2343
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2344
2344
|
while (1) switch (_context41.prev = _context41.next) {
|
|
2345
2345
|
case 0:
|
|
2346
2346
|
statusPayload = {
|
|
@@ -2360,9 +2360,9 @@ describe('State Machine handler tests', function () {
|
|
|
2360
2360
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2361
2361
|
|
|
2362
2362
|
// handleOutgoingCallSetup is asynchronous
|
|
2363
|
-
_context41.next =
|
|
2363
|
+
_context41.next = 1;
|
|
2364
2364
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2365
|
-
case
|
|
2365
|
+
case 1:
|
|
2366
2366
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
2367
2367
|
logSpy.mockClear();
|
|
2368
2368
|
jest.advanceTimersByTime(10000);
|
|
@@ -2370,7 +2370,7 @@ describe('State Machine handler tests', function () {
|
|
|
2370
2370
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
2371
2371
|
expect(deleteSpy).toHaveBeenCalledTimes(1);
|
|
2372
2372
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2373
|
-
case
|
|
2373
|
+
case 2:
|
|
2374
2374
|
case "end":
|
|
2375
2375
|
return _context41.stop();
|
|
2376
2376
|
}
|
|
@@ -2436,7 +2436,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2436
2436
|
});
|
|
2437
2437
|
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2438
2438
|
var responsePayload, warnSpy, roapEvent;
|
|
2439
|
-
return _regenerator.default.wrap(function
|
|
2439
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2440
2440
|
while (1) switch (_context43.prev = _context43.next) {
|
|
2441
2441
|
case 0:
|
|
2442
2442
|
expect.assertions(7);
|
|
@@ -2451,7 +2451,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2451
2451
|
call['held'] = false;
|
|
2452
2452
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2453
2453
|
var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(correlationId) {
|
|
2454
|
-
return _regenerator.default.wrap(function
|
|
2454
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2455
2455
|
while (1) switch (_context42.prev = _context42.next) {
|
|
2456
2456
|
case 0:
|
|
2457
2457
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
@@ -2465,12 +2465,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2465
2465
|
return _ref43.apply(this, arguments);
|
|
2466
2466
|
};
|
|
2467
2467
|
}());
|
|
2468
|
-
_context43.next =
|
|
2468
|
+
_context43.next = 1;
|
|
2469
2469
|
return call.doHoldResume();
|
|
2470
|
-
case
|
|
2471
|
-
_context43.next =
|
|
2470
|
+
case 1:
|
|
2471
|
+
_context43.next = 2;
|
|
2472
2472
|
return (0, _testUtil.flushPromises)(2);
|
|
2473
|
-
case
|
|
2473
|
+
case 2:
|
|
2474
2474
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
2475
2475
|
call.handleMidCallEvent(mockHeldEvent);
|
|
2476
2476
|
|
|
@@ -2484,13 +2484,13 @@ describe('Supplementary Services tests', function () {
|
|
|
2484
2484
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2485
2485
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2486
2486
|
roapEvent.data.type = 'ANSWER';
|
|
2487
|
-
_context43.next =
|
|
2487
|
+
_context43.next = 3;
|
|
2488
2488
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2489
|
-
case
|
|
2489
|
+
case 3:
|
|
2490
2490
|
roapEvent.data.type = 'OK';
|
|
2491
|
-
_context43.next =
|
|
2491
|
+
_context43.next = 4;
|
|
2492
2492
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2493
|
-
case
|
|
2493
|
+
case 4:
|
|
2494
2494
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
2495
2495
|
/* isHeld flag should be set and an Hold event should be emitted */
|
|
2496
2496
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2501,7 +2501,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2501
2501
|
file: 'call',
|
|
2502
2502
|
method: 'handleCallHold'
|
|
2503
2503
|
});
|
|
2504
|
-
case
|
|
2504
|
+
case 5:
|
|
2505
2505
|
case "end":
|
|
2506
2506
|
return _context43.stop();
|
|
2507
2507
|
}
|
|
@@ -2509,7 +2509,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2509
2509
|
})));
|
|
2510
2510
|
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2511
2511
|
var responsePayload, warnSpy, roapEvent;
|
|
2512
|
-
return _regenerator.default.wrap(function
|
|
2512
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2513
2513
|
while (1) switch (_context45.prev = _context45.next) {
|
|
2514
2514
|
case 0:
|
|
2515
2515
|
expect.assertions(8);
|
|
@@ -2524,7 +2524,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2524
2524
|
call['held'] = false;
|
|
2525
2525
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2526
2526
|
var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(correlationId) {
|
|
2527
|
-
return _regenerator.default.wrap(function
|
|
2527
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2528
2528
|
while (1) switch (_context44.prev = _context44.next) {
|
|
2529
2529
|
case 0:
|
|
2530
2530
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
@@ -2539,12 +2539,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2539
2539
|
};
|
|
2540
2540
|
}());
|
|
2541
2541
|
call.doHoldResume();
|
|
2542
|
-
_context45.next =
|
|
2542
|
+
_context45.next = 1;
|
|
2543
2543
|
return _promise.default.resolve();
|
|
2544
|
-
case
|
|
2545
|
-
_context45.next =
|
|
2544
|
+
case 1:
|
|
2545
|
+
_context45.next = 2;
|
|
2546
2546
|
return _promise.default.resolve();
|
|
2547
|
-
case
|
|
2547
|
+
case 2:
|
|
2548
2548
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
2549
2549
|
call.handleMidCallEvent(mockHeldEvent);
|
|
2550
2550
|
|
|
@@ -2558,13 +2558,13 @@ describe('Supplementary Services tests', function () {
|
|
|
2558
2558
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2559
2559
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2560
2560
|
roapEvent.data.type = 'ANSWER';
|
|
2561
|
-
_context45.next =
|
|
2561
|
+
_context45.next = 3;
|
|
2562
2562
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2563
|
-
case
|
|
2563
|
+
case 3:
|
|
2564
2564
|
roapEvent.data.type = 'OK';
|
|
2565
|
-
_context45.next =
|
|
2565
|
+
_context45.next = 4;
|
|
2566
2566
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2567
|
-
case
|
|
2567
|
+
case 4:
|
|
2568
2568
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
2569
2569
|
/* isHeld flag should be set and an Hold event should be emitted */
|
|
2570
2570
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2575,7 +2575,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2575
2575
|
file: 'call',
|
|
2576
2576
|
method: 'handleCallHold'
|
|
2577
2577
|
});
|
|
2578
|
-
case
|
|
2578
|
+
case 5:
|
|
2579
2579
|
case "end":
|
|
2580
2580
|
return _context45.stop();
|
|
2581
2581
|
}
|
|
@@ -2583,7 +2583,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2583
2583
|
})));
|
|
2584
2584
|
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2585
2585
|
var responsePayload;
|
|
2586
|
-
return _regenerator.default.wrap(function
|
|
2586
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2587
2587
|
while (1) switch (_context47.prev = _context47.next) {
|
|
2588
2588
|
case 0:
|
|
2589
2589
|
expect.assertions(4);
|
|
@@ -2595,12 +2595,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2595
2595
|
call['held'] = false;
|
|
2596
2596
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2597
2597
|
var _ref47 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(errObj) {
|
|
2598
|
-
return _regenerator.default.wrap(function
|
|
2598
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2599
2599
|
while (1) switch (_context46.prev = _context46.next) {
|
|
2600
2600
|
case 0:
|
|
2601
2601
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2602
2602
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2603
|
-
case
|
|
2603
|
+
case 1:
|
|
2604
2604
|
case "end":
|
|
2605
2605
|
return _context46.stop();
|
|
2606
2606
|
}
|
|
@@ -2610,18 +2610,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2610
2610
|
return _ref47.apply(this, arguments);
|
|
2611
2611
|
};
|
|
2612
2612
|
}());
|
|
2613
|
-
_context47.next =
|
|
2613
|
+
_context47.next = 1;
|
|
2614
2614
|
return call.doHoldResume();
|
|
2615
|
-
case
|
|
2616
|
-
_context47.next =
|
|
2615
|
+
case 1:
|
|
2616
|
+
_context47.next = 2;
|
|
2617
2617
|
return (0, _testUtil.flushPromises)(2);
|
|
2618
|
-
case
|
|
2618
|
+
case 2:
|
|
2619
2619
|
expect(call.isHeld()).toStrictEqual(false);
|
|
2620
2620
|
|
|
2621
2621
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
2622
2622
|
*/
|
|
2623
2623
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2624
|
-
case
|
|
2624
|
+
case 3:
|
|
2625
2625
|
case "end":
|
|
2626
2626
|
return _context47.stop();
|
|
2627
2627
|
}
|
|
@@ -2629,7 +2629,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2629
2629
|
})));
|
|
2630
2630
|
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2631
2631
|
var responsePayload, rejectPayload, roapEvent;
|
|
2632
|
-
return _regenerator.default.wrap(function
|
|
2632
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
2633
2633
|
while (1) switch (_context49.prev = _context49.next) {
|
|
2634
2634
|
case 0:
|
|
2635
2635
|
expect.assertions(5);
|
|
@@ -2645,12 +2645,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2645
2645
|
call['held'] = false;
|
|
2646
2646
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2647
2647
|
var _ref49 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
|
|
2648
|
-
return _regenerator.default.wrap(function
|
|
2648
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2649
2649
|
while (1) switch (_context48.prev = _context48.next) {
|
|
2650
2650
|
case 0:
|
|
2651
2651
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2652
2652
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2653
|
-
case
|
|
2653
|
+
case 1:
|
|
2654
2654
|
case "end":
|
|
2655
2655
|
return _context48.stop();
|
|
2656
2656
|
}
|
|
@@ -2661,9 +2661,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2661
2661
|
};
|
|
2662
2662
|
}());
|
|
2663
2663
|
call.doHoldResume();
|
|
2664
|
-
_context49.next =
|
|
2664
|
+
_context49.next = 1;
|
|
2665
2665
|
return (0, _testUtil.flushPromises)(2);
|
|
2666
|
-
case
|
|
2666
|
+
case 1:
|
|
2667
2667
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
2668
2668
|
*/
|
|
2669
2669
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_HOLD');
|
|
@@ -2671,13 +2671,13 @@ describe('Supplementary Services tests', function () {
|
|
|
2671
2671
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2672
2672
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2673
2673
|
roapEvent.data.type = 'ANSWER';
|
|
2674
|
-
_context49.next =
|
|
2674
|
+
_context49.next = 2;
|
|
2675
2675
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2676
|
-
case
|
|
2676
|
+
case 2:
|
|
2677
2677
|
expect(call.isHeld()).toStrictEqual(false);
|
|
2678
2678
|
/* We should return back to call established state */
|
|
2679
2679
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2680
|
-
case
|
|
2680
|
+
case 3:
|
|
2681
2681
|
case "end":
|
|
2682
2682
|
return _context49.stop();
|
|
2683
2683
|
}
|
|
@@ -2685,7 +2685,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2685
2685
|
})));
|
|
2686
2686
|
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2687
2687
|
var responsePayload, warnSpy, roapEvent;
|
|
2688
|
-
return _regenerator.default.wrap(function
|
|
2688
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
2689
2689
|
while (1) switch (_context50.prev = _context50.next) {
|
|
2690
2690
|
case 0:
|
|
2691
2691
|
responsePayload = {
|
|
@@ -2697,12 +2697,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2697
2697
|
jest.spyOn(global, 'clearTimeout');
|
|
2698
2698
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2699
2699
|
call['held'] = false;
|
|
2700
|
-
_context50.next =
|
|
2700
|
+
_context50.next = 1;
|
|
2701
2701
|
return call.doHoldResume();
|
|
2702
|
-
case
|
|
2703
|
-
_context50.next =
|
|
2702
|
+
case 1:
|
|
2703
|
+
_context50.next = 2;
|
|
2704
2704
|
return (0, _testUtil.flushPromises)(2);
|
|
2705
|
-
case
|
|
2705
|
+
case 2:
|
|
2706
2706
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
2707
2707
|
|
|
2708
2708
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2715,21 +2715,21 @@ describe('Supplementary Services tests', function () {
|
|
|
2715
2715
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2716
2716
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2717
2717
|
roapEvent.data.type = 'ANSWER';
|
|
2718
|
-
_context50.next =
|
|
2718
|
+
_context50.next = 3;
|
|
2719
2719
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2720
|
-
case
|
|
2720
|
+
case 3:
|
|
2721
2721
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2722
2722
|
statusCode: 403
|
|
2723
2723
|
});
|
|
2724
2724
|
roapEvent.data.type = 'OK';
|
|
2725
|
-
_context50.next =
|
|
2725
|
+
_context50.next = 4;
|
|
2726
2726
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2727
|
-
case
|
|
2727
|
+
case 4:
|
|
2728
2728
|
/* this is for coverage */
|
|
2729
2729
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2730
|
-
_context50.next =
|
|
2730
|
+
_context50.next = 5;
|
|
2731
2731
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2732
|
-
case
|
|
2732
|
+
case 5:
|
|
2733
2733
|
expect(call.isHeld()).toStrictEqual(false);
|
|
2734
2734
|
/* We should return back to call established state */
|
|
2735
2735
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -2737,7 +2737,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2737
2737
|
file: 'call',
|
|
2738
2738
|
method: 'handleRoapEstablished'
|
|
2739
2739
|
});
|
|
2740
|
-
case
|
|
2740
|
+
case 6:
|
|
2741
2741
|
case "end":
|
|
2742
2742
|
return _context50.stop();
|
|
2743
2743
|
}
|
|
@@ -2745,7 +2745,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2745
2745
|
})));
|
|
2746
2746
|
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2747
2747
|
var responsePayload, warnSpy, roapEvent;
|
|
2748
|
-
return _regenerator.default.wrap(function
|
|
2748
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
2749
2749
|
while (1) switch (_context51.prev = _context51.next) {
|
|
2750
2750
|
case 0:
|
|
2751
2751
|
responsePayload = {
|
|
@@ -2757,12 +2757,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2757
2757
|
jest.spyOn(global, 'clearTimeout');
|
|
2758
2758
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2759
2759
|
call['held'] = true;
|
|
2760
|
-
_context51.next =
|
|
2760
|
+
_context51.next = 1;
|
|
2761
2761
|
return call.doHoldResume();
|
|
2762
|
-
case
|
|
2763
|
-
_context51.next =
|
|
2762
|
+
case 1:
|
|
2763
|
+
_context51.next = 2;
|
|
2764
2764
|
return (0, _testUtil.flushPromises)(2);
|
|
2765
|
-
case
|
|
2765
|
+
case 2:
|
|
2766
2766
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
2767
2767
|
|
|
2768
2768
|
/* At this point, the Call State should be S_CALL_RESUME
|
|
@@ -2775,16 +2775,16 @@ describe('Supplementary Services tests', function () {
|
|
|
2775
2775
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2776
2776
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2777
2777
|
roapEvent.data.type = 'ANSWER';
|
|
2778
|
-
_context51.next =
|
|
2778
|
+
_context51.next = 3;
|
|
2779
2779
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2780
|
-
case
|
|
2780
|
+
case 3:
|
|
2781
2781
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2782
2782
|
statusCode: 403
|
|
2783
2783
|
});
|
|
2784
2784
|
roapEvent.data.type = 'OK';
|
|
2785
|
-
_context51.next =
|
|
2785
|
+
_context51.next = 4;
|
|
2786
2786
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2787
|
-
case
|
|
2787
|
+
case 4:
|
|
2788
2788
|
expect(call.isHeld()).toStrictEqual(true);
|
|
2789
2789
|
/* We should return back to call established state */
|
|
2790
2790
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -2792,7 +2792,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2792
2792
|
file: 'call',
|
|
2793
2793
|
method: 'handleRoapEstablished'
|
|
2794
2794
|
});
|
|
2795
|
-
case
|
|
2795
|
+
case 5:
|
|
2796
2796
|
case "end":
|
|
2797
2797
|
return _context51.stop();
|
|
2798
2798
|
}
|
|
@@ -2800,7 +2800,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2800
2800
|
})));
|
|
2801
2801
|
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2802
2802
|
var responsePayload, roapEvent;
|
|
2803
|
-
return _regenerator.default.wrap(function
|
|
2803
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
2804
2804
|
while (1) switch (_context53.prev = _context53.next) {
|
|
2805
2805
|
case 0:
|
|
2806
2806
|
expect.assertions(5);
|
|
@@ -2812,12 +2812,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2812
2812
|
call['held'] = false;
|
|
2813
2813
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2814
2814
|
var _ref53 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
|
|
2815
|
-
return _regenerator.default.wrap(function
|
|
2815
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
2816
2816
|
while (1) switch (_context52.prev = _context52.next) {
|
|
2817
2817
|
case 0:
|
|
2818
2818
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2819
2819
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2820
|
-
case
|
|
2820
|
+
case 1:
|
|
2821
2821
|
case "end":
|
|
2822
2822
|
return _context52.stop();
|
|
2823
2823
|
}
|
|
@@ -2829,9 +2829,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2829
2829
|
}());
|
|
2830
2830
|
jest.runAllTimers();
|
|
2831
2831
|
call.doHoldResume();
|
|
2832
|
-
_context53.next =
|
|
2832
|
+
_context53.next = 1;
|
|
2833
2833
|
return (0, _testUtil.flushPromises)(2);
|
|
2834
|
-
case
|
|
2834
|
+
case 1:
|
|
2835
2835
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
2836
2836
|
*/
|
|
2837
2837
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_HOLD');
|
|
@@ -2842,13 +2842,13 @@ describe('Supplementary Services tests', function () {
|
|
|
2842
2842
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2843
2843
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2844
2844
|
roapEvent.data.type = 'ANSWER';
|
|
2845
|
-
_context53.next =
|
|
2845
|
+
_context53.next = 2;
|
|
2846
2846
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2847
|
-
case
|
|
2847
|
+
case 2:
|
|
2848
2848
|
roapEvent.data.type = 'OK';
|
|
2849
|
-
_context53.next =
|
|
2849
|
+
_context53.next = 3;
|
|
2850
2850
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2851
|
-
case
|
|
2851
|
+
case 3:
|
|
2852
2852
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
2853
2853
|
jest.advanceTimersByTime(12000);
|
|
2854
2854
|
|
|
@@ -2856,7 +2856,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2856
2856
|
expect(call.isHeld()).toStrictEqual(false);
|
|
2857
2857
|
/* We should return back to call established state */
|
|
2858
2858
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2859
|
-
case
|
|
2859
|
+
case 4:
|
|
2860
2860
|
case "end":
|
|
2861
2861
|
return _context53.stop();
|
|
2862
2862
|
}
|
|
@@ -2864,7 +2864,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2864
2864
|
})));
|
|
2865
2865
|
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2866
2866
|
var responsePayload, warnSpy, roapEvent;
|
|
2867
|
-
return _regenerator.default.wrap(function
|
|
2867
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
2868
2868
|
while (1) switch (_context55.prev = _context55.next) {
|
|
2869
2869
|
case 0:
|
|
2870
2870
|
expect.assertions(7);
|
|
@@ -2879,7 +2879,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2879
2879
|
call['held'] = true;
|
|
2880
2880
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2881
2881
|
var _ref55 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(correlationId) {
|
|
2882
|
-
return _regenerator.default.wrap(function
|
|
2882
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
2883
2883
|
while (1) switch (_context54.prev = _context54.next) {
|
|
2884
2884
|
case 0:
|
|
2885
2885
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
@@ -2893,12 +2893,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2893
2893
|
return _ref55.apply(this, arguments);
|
|
2894
2894
|
};
|
|
2895
2895
|
}());
|
|
2896
|
-
_context55.next =
|
|
2896
|
+
_context55.next = 1;
|
|
2897
2897
|
return call.doHoldResume();
|
|
2898
|
-
case
|
|
2899
|
-
_context55.next =
|
|
2898
|
+
case 1:
|
|
2899
|
+
_context55.next = 2;
|
|
2900
2900
|
return (0, _testUtil.flushPromises)(2);
|
|
2901
|
-
case
|
|
2901
|
+
case 2:
|
|
2902
2902
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
2903
2903
|
call.handleMidCallEvent(mockResumeEvent);
|
|
2904
2904
|
|
|
@@ -2912,13 +2912,13 @@ describe('Supplementary Services tests', function () {
|
|
|
2912
2912
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2913
2913
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2914
2914
|
roapEvent.data.type = 'ANSWER';
|
|
2915
|
-
_context55.next =
|
|
2915
|
+
_context55.next = 3;
|
|
2916
2916
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2917
|
-
case
|
|
2917
|
+
case 3:
|
|
2918
2918
|
roapEvent.data.type = 'OK';
|
|
2919
|
-
_context55.next =
|
|
2919
|
+
_context55.next = 4;
|
|
2920
2920
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2921
|
-
case
|
|
2921
|
+
case 4:
|
|
2922
2922
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
2923
2923
|
/* isHeld flag should not be set and an Resume event should be emitted */
|
|
2924
2924
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2929,7 +2929,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2929
2929
|
file: 'call',
|
|
2930
2930
|
method: 'handleCallResume'
|
|
2931
2931
|
});
|
|
2932
|
-
case
|
|
2932
|
+
case 5:
|
|
2933
2933
|
case "end":
|
|
2934
2934
|
return _context55.stop();
|
|
2935
2935
|
}
|
|
@@ -2937,7 +2937,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2937
2937
|
})));
|
|
2938
2938
|
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2939
2939
|
var responsePayload, warnSpy, roapEvent;
|
|
2940
|
-
return _regenerator.default.wrap(function
|
|
2940
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
2941
2941
|
while (1) switch (_context57.prev = _context57.next) {
|
|
2942
2942
|
case 0:
|
|
2943
2943
|
expect.assertions(7);
|
|
@@ -2952,7 +2952,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2952
2952
|
call['held'] = true;
|
|
2953
2953
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2954
2954
|
var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
|
|
2955
|
-
return _regenerator.default.wrap(function
|
|
2955
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
2956
2956
|
while (1) switch (_context56.prev = _context56.next) {
|
|
2957
2957
|
case 0:
|
|
2958
2958
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
@@ -2967,12 +2967,12 @@ describe('Supplementary Services tests', function () {
|
|
|
2967
2967
|
};
|
|
2968
2968
|
}());
|
|
2969
2969
|
call.doHoldResume();
|
|
2970
|
-
_context57.next =
|
|
2970
|
+
_context57.next = 1;
|
|
2971
2971
|
return _promise.default.resolve();
|
|
2972
|
-
case
|
|
2973
|
-
_context57.next =
|
|
2972
|
+
case 1:
|
|
2973
|
+
_context57.next = 2;
|
|
2974
2974
|
return _promise.default.resolve();
|
|
2975
|
-
case
|
|
2975
|
+
case 2:
|
|
2976
2976
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
2977
2977
|
call.handleMidCallEvent(mockResumeEvent);
|
|
2978
2978
|
|
|
@@ -2986,13 +2986,13 @@ describe('Supplementary Services tests', function () {
|
|
|
2986
2986
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2987
2987
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2988
2988
|
roapEvent.data.type = 'ANSWER';
|
|
2989
|
-
_context57.next =
|
|
2989
|
+
_context57.next = 3;
|
|
2990
2990
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2991
|
-
case
|
|
2991
|
+
case 3:
|
|
2992
2992
|
roapEvent.data.type = 'OK';
|
|
2993
|
-
_context57.next =
|
|
2993
|
+
_context57.next = 4;
|
|
2994
2994
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2995
|
-
case
|
|
2995
|
+
case 4:
|
|
2996
2996
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
2997
2997
|
/* isHeld flag should not be set and an Resume event should be emitted */
|
|
2998
2998
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3003,7 +3003,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3003
3003
|
file: 'call',
|
|
3004
3004
|
method: 'handleCallResume'
|
|
3005
3005
|
});
|
|
3006
|
-
case
|
|
3006
|
+
case 5:
|
|
3007
3007
|
case "end":
|
|
3008
3008
|
return _context57.stop();
|
|
3009
3009
|
}
|
|
@@ -3011,7 +3011,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3011
3011
|
})));
|
|
3012
3012
|
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
3013
3013
|
var responsePayload;
|
|
3014
|
-
return _regenerator.default.wrap(function
|
|
3014
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3015
3015
|
while (1) switch (_context59.prev = _context59.next) {
|
|
3016
3016
|
case 0:
|
|
3017
3017
|
expect.assertions(4);
|
|
@@ -3023,12 +3023,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3023
3023
|
call['held'] = true;
|
|
3024
3024
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3025
3025
|
var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(errObj) {
|
|
3026
|
-
return _regenerator.default.wrap(function
|
|
3026
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3027
3027
|
while (1) switch (_context58.prev = _context58.next) {
|
|
3028
3028
|
case 0:
|
|
3029
3029
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3030
3030
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3031
|
-
case
|
|
3031
|
+
case 1:
|
|
3032
3032
|
case "end":
|
|
3033
3033
|
return _context58.stop();
|
|
3034
3034
|
}
|
|
@@ -3038,19 +3038,19 @@ describe('Supplementary Services tests', function () {
|
|
|
3038
3038
|
return _ref59.apply(this, arguments);
|
|
3039
3039
|
};
|
|
3040
3040
|
}());
|
|
3041
|
-
_context59.next =
|
|
3041
|
+
_context59.next = 1;
|
|
3042
3042
|
return call.doHoldResume();
|
|
3043
|
-
case
|
|
3044
|
-
_context59.next =
|
|
3043
|
+
case 1:
|
|
3044
|
+
_context59.next = 2;
|
|
3045
3045
|
return (0, _testUtil.flushPromises)(2);
|
|
3046
|
-
case
|
|
3046
|
+
case 2:
|
|
3047
3047
|
expect(call.isHeld()).toStrictEqual(true);
|
|
3048
3048
|
|
|
3049
3049
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
3050
3050
|
*/
|
|
3051
3051
|
|
|
3052
3052
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3053
|
-
case
|
|
3053
|
+
case 3:
|
|
3054
3054
|
case "end":
|
|
3055
3055
|
return _context59.stop();
|
|
3056
3056
|
}
|
|
@@ -3058,7 +3058,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3058
3058
|
})));
|
|
3059
3059
|
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
3060
3060
|
var responsePayload, rejectPayload, roapEvent;
|
|
3061
|
-
return _regenerator.default.wrap(function
|
|
3061
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3062
3062
|
while (1) switch (_context61.prev = _context61.next) {
|
|
3063
3063
|
case 0:
|
|
3064
3064
|
expect.assertions(5);
|
|
@@ -3074,12 +3074,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3074
3074
|
call['held'] = true;
|
|
3075
3075
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3076
3076
|
var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(errObj) {
|
|
3077
|
-
return _regenerator.default.wrap(function
|
|
3077
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3078
3078
|
while (1) switch (_context60.prev = _context60.next) {
|
|
3079
3079
|
case 0:
|
|
3080
3080
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3081
3081
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3082
|
-
case
|
|
3082
|
+
case 1:
|
|
3083
3083
|
case "end":
|
|
3084
3084
|
return _context60.stop();
|
|
3085
3085
|
}
|
|
@@ -3090,9 +3090,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3090
3090
|
};
|
|
3091
3091
|
}());
|
|
3092
3092
|
call.doHoldResume();
|
|
3093
|
-
_context61.next =
|
|
3093
|
+
_context61.next = 1;
|
|
3094
3094
|
return (0, _testUtil.flushPromises)(2);
|
|
3095
|
-
case
|
|
3095
|
+
case 1:
|
|
3096
3096
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
3097
3097
|
*/
|
|
3098
3098
|
|
|
@@ -3101,13 +3101,13 @@ describe('Supplementary Services tests', function () {
|
|
|
3101
3101
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3102
3102
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3103
3103
|
roapEvent.data.type = 'ANSWER';
|
|
3104
|
-
_context61.next =
|
|
3104
|
+
_context61.next = 2;
|
|
3105
3105
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3106
|
-
case
|
|
3106
|
+
case 2:
|
|
3107
3107
|
expect(call.isHeld()).toStrictEqual(true);
|
|
3108
3108
|
/* We should return back to call established state */
|
|
3109
3109
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3110
|
-
case
|
|
3110
|
+
case 3:
|
|
3111
3111
|
case "end":
|
|
3112
3112
|
return _context61.stop();
|
|
3113
3113
|
}
|
|
@@ -3115,7 +3115,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3115
3115
|
})));
|
|
3116
3116
|
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
3117
3117
|
var responsePayload, roapEvent;
|
|
3118
|
-
return _regenerator.default.wrap(function
|
|
3118
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3119
3119
|
while (1) switch (_context63.prev = _context63.next) {
|
|
3120
3120
|
case 0:
|
|
3121
3121
|
expect.assertions(5);
|
|
@@ -3127,12 +3127,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3127
3127
|
call['held'] = true;
|
|
3128
3128
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3129
3129
|
var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
|
|
3130
|
-
return _regenerator.default.wrap(function
|
|
3130
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3131
3131
|
while (1) switch (_context62.prev = _context62.next) {
|
|
3132
3132
|
case 0:
|
|
3133
3133
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3134
3134
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3135
|
-
case
|
|
3135
|
+
case 1:
|
|
3136
3136
|
case "end":
|
|
3137
3137
|
return _context62.stop();
|
|
3138
3138
|
}
|
|
@@ -3143,9 +3143,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3143
3143
|
};
|
|
3144
3144
|
}());
|
|
3145
3145
|
call.doHoldResume();
|
|
3146
|
-
_context63.next =
|
|
3146
|
+
_context63.next = 1;
|
|
3147
3147
|
return (0, _testUtil.flushPromises)(2);
|
|
3148
|
-
case
|
|
3148
|
+
case 1:
|
|
3149
3149
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
3150
3150
|
*/
|
|
3151
3151
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_RESUME');
|
|
@@ -3156,19 +3156,19 @@ describe('Supplementary Services tests', function () {
|
|
|
3156
3156
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3157
3157
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3158
3158
|
roapEvent.data.type = 'ANSWER';
|
|
3159
|
-
_context63.next =
|
|
3159
|
+
_context63.next = 2;
|
|
3160
3160
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3161
|
-
case
|
|
3161
|
+
case 2:
|
|
3162
3162
|
roapEvent.data.type = 'OK';
|
|
3163
|
-
_context63.next =
|
|
3163
|
+
_context63.next = 3;
|
|
3164
3164
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3165
|
-
case
|
|
3165
|
+
case 3:
|
|
3166
3166
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
3167
3167
|
jest.advanceTimersByTime(12000);
|
|
3168
3168
|
expect(call.isHeld()).toStrictEqual(true);
|
|
3169
3169
|
/* We should return back to call established state */
|
|
3170
3170
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3171
|
-
case
|
|
3171
|
+
case 4:
|
|
3172
3172
|
case "end":
|
|
3173
3173
|
return _context63.stop();
|
|
3174
3174
|
}
|
|
@@ -3207,7 +3207,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3207
3207
|
});
|
|
3208
3208
|
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3209
3209
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3210
|
-
return _regenerator.default.wrap(function
|
|
3210
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3211
3211
|
while (1) switch (_context66.prev = _context66.next) {
|
|
3212
3212
|
case 0:
|
|
3213
3213
|
expect.assertions(12); // Updated to match actual assertion count
|
|
@@ -3221,7 +3221,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3221
3221
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3222
3222
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3223
3223
|
var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(correlationId) {
|
|
3224
|
-
return _regenerator.default.wrap(function
|
|
3224
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3225
3225
|
while (1) switch (_context64.prev = _context64.next) {
|
|
3226
3226
|
case 0:
|
|
3227
3227
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
@@ -3237,7 +3237,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3237
3237
|
}());
|
|
3238
3238
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3239
3239
|
var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(correlationId) {
|
|
3240
|
-
return _regenerator.default.wrap(function
|
|
3240
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3241
3241
|
while (1) switch (_context65.prev = _context65.next) {
|
|
3242
3242
|
case 0:
|
|
3243
3243
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
@@ -3251,12 +3251,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3251
3251
|
return _ref66.apply(this, arguments);
|
|
3252
3252
|
};
|
|
3253
3253
|
}());
|
|
3254
|
-
_context66.next =
|
|
3254
|
+
_context66.next = 1;
|
|
3255
3255
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3256
|
-
case
|
|
3257
|
-
_context66.next =
|
|
3256
|
+
case 1:
|
|
3257
|
+
_context66.next = 2;
|
|
3258
3258
|
return (0, _testUtil.flushPromises)(2);
|
|
3259
|
-
case
|
|
3259
|
+
case 2:
|
|
3260
3260
|
expect(requestSpy).toBeCalled();
|
|
3261
3261
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined);
|
|
3262
3262
|
call.sendCallStateMachineEvt({
|
|
@@ -3275,7 +3275,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3275
3275
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3276
3276
|
expect(infoSpy).toHaveBeenCalledWith("Initiating Consult transfer between : ".concat(call.getCallId(), " and ").concat(secondCall.getCallId()), transferLoggingContext);
|
|
3277
3277
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3278
|
-
case
|
|
3278
|
+
case 3:
|
|
3279
3279
|
case "end":
|
|
3280
3280
|
return _context66.stop();
|
|
3281
3281
|
}
|
|
@@ -3283,7 +3283,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3283
3283
|
})));
|
|
3284
3284
|
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
|
|
3285
3285
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3286
|
-
return _regenerator.default.wrap(function
|
|
3286
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3287
3287
|
while (1) switch (_context68.prev = _context68.next) {
|
|
3288
3288
|
case 0:
|
|
3289
3289
|
expect.assertions(10); // Updated to match actual assertion count
|
|
@@ -3297,7 +3297,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3297
3297
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3298
3298
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3299
3299
|
var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
|
|
3300
|
-
return _regenerator.default.wrap(function
|
|
3300
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3301
3301
|
while (1) switch (_context67.prev = _context67.next) {
|
|
3302
3302
|
case 0:
|
|
3303
3303
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
@@ -3311,12 +3311,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3311
3311
|
return _ref68.apply(this, arguments);
|
|
3312
3312
|
};
|
|
3313
3313
|
}());
|
|
3314
|
-
_context68.next =
|
|
3314
|
+
_context68.next = 1;
|
|
3315
3315
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3316
|
-
case
|
|
3317
|
-
_context68.next =
|
|
3316
|
+
case 1:
|
|
3317
|
+
_context68.next = 2;
|
|
3318
3318
|
return (0, _testUtil.flushPromises)(2);
|
|
3319
|
-
case
|
|
3319
|
+
case 2:
|
|
3320
3320
|
expect(requestSpy).toBeCalled();
|
|
3321
3321
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined);
|
|
3322
3322
|
call.sendCallStateMachineEvt({
|
|
@@ -3331,7 +3331,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3331
3331
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3332
3332
|
expect(infoSpy).toHaveBeenCalledWith("Initiating Blind transfer with : ".concat(transfereeNumber), transferLoggingContext);
|
|
3333
3333
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3334
|
-
case
|
|
3334
|
+
case 3:
|
|
3335
3335
|
case "end":
|
|
3336
3336
|
return _context68.stop();
|
|
3337
3337
|
}
|
|
@@ -3339,7 +3339,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3339
3339
|
})));
|
|
3340
3340
|
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
|
|
3341
3341
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3342
|
-
return _regenerator.default.wrap(function
|
|
3342
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3343
3343
|
while (1) switch (_context69.prev = _context69.next) {
|
|
3344
3344
|
case 0:
|
|
3345
3345
|
responsePayload = {
|
|
@@ -3351,12 +3351,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3351
3351
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3352
3352
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3353
3353
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3354
|
-
_context69.next =
|
|
3354
|
+
_context69.next = 1;
|
|
3355
3355
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3356
|
-
case
|
|
3357
|
-
_context69.next =
|
|
3356
|
+
case 1:
|
|
3357
|
+
_context69.next = 2;
|
|
3358
3358
|
return (0, _testUtil.flushPromises)(1);
|
|
3359
|
-
case
|
|
3359
|
+
case 2:
|
|
3360
3360
|
expect(requestSpy).toBeCalled();
|
|
3361
3361
|
/* We should be in CALL_ESTABLISHED state */
|
|
3362
3362
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -3373,7 +3373,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3373
3373
|
expect(emitSpy).toBeCalledOnceWith(_types2.CALL_EVENT_KEYS.TRANSFER_ERROR, expect.any(_Errors.CallError));
|
|
3374
3374
|
expect(warnSpy).toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3375
3375
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3376
|
-
case
|
|
3376
|
+
case 3:
|
|
3377
3377
|
case "end":
|
|
3378
3378
|
return _context69.stop();
|
|
3379
3379
|
}
|
|
@@ -3381,7 +3381,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3381
3381
|
})));
|
|
3382
3382
|
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
|
|
3383
3383
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3384
|
-
return _regenerator.default.wrap(function
|
|
3384
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3385
3385
|
while (1) switch (_context70.prev = _context70.next) {
|
|
3386
3386
|
case 0:
|
|
3387
3387
|
responsePayload = {
|
|
@@ -3392,12 +3392,12 @@ describe('Supplementary Services tests', function () {
|
|
|
3392
3392
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3393
3393
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3394
3394
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3395
|
-
_context70.next =
|
|
3395
|
+
_context70.next = 1;
|
|
3396
3396
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3397
|
-
case
|
|
3398
|
-
_context70.next =
|
|
3397
|
+
case 1:
|
|
3398
|
+
_context70.next = 2;
|
|
3399
3399
|
return (0, _testUtil.flushPromises)(2);
|
|
3400
|
-
case
|
|
3400
|
+
case 2:
|
|
3401
3401
|
expect(requestSpy).toBeCalled();
|
|
3402
3402
|
/* We should be in CALL_ESTABLISHED state */
|
|
3403
3403
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -3414,7 +3414,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3414
3414
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.TRANSFER_ERROR, expect.any(_Errors.CallError));
|
|
3415
3415
|
expect(warnSpy).toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3416
3416
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3417
|
-
case
|
|
3417
|
+
case 3:
|
|
3418
3418
|
case "end":
|
|
3419
3419
|
return _context70.stop();
|
|
3420
3420
|
}
|
|
@@ -3422,14 +3422,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3422
3422
|
})));
|
|
3423
3423
|
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
|
|
3424
3424
|
var requestSpy, warnSpy;
|
|
3425
|
-
return _regenerator.default.wrap(function
|
|
3425
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3426
3426
|
while (1) switch (_context71.prev = _context71.next) {
|
|
3427
3427
|
case 0:
|
|
3428
3428
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3429
3429
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3430
|
-
_context71.next =
|
|
3430
|
+
_context71.next = 1;
|
|
3431
3431
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3432
|
-
case
|
|
3432
|
+
case 1:
|
|
3433
3433
|
/* We should be in CALL_ESTABLISHED state */
|
|
3434
3434
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3435
3435
|
expect(secondCall['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -3437,7 +3437,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3437
3437
|
expect(uploadLogsSpy).not.toBeCalled();
|
|
3438
3438
|
expect(requestSpy).not.toBeCalled();
|
|
3439
3439
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3440
|
-
case
|
|
3440
|
+
case 2:
|
|
3441
3441
|
case "end":
|
|
3442
3442
|
return _context71.stop();
|
|
3443
3443
|
}
|
|
@@ -3445,14 +3445,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3445
3445
|
})));
|
|
3446
3446
|
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3447
3447
|
var requestSpy, warnSpy;
|
|
3448
|
-
return _regenerator.default.wrap(function
|
|
3448
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3449
3449
|
while (1) switch (_context72.prev = _context72.next) {
|
|
3450
3450
|
case 0:
|
|
3451
3451
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3452
3452
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3453
|
-
_context72.next =
|
|
3453
|
+
_context72.next = 1;
|
|
3454
3454
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3455
|
-
case
|
|
3455
|
+
case 1:
|
|
3456
3456
|
/* We should be in CALL_ESTABLISHED state */
|
|
3457
3457
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3458
3458
|
expect(secondCall['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
@@ -3460,7 +3460,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3460
3460
|
expect(uploadLogsSpy).not.toBeCalled();
|
|
3461
3461
|
expect(requestSpy).not.toBeCalled();
|
|
3462
3462
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3463
|
-
case
|
|
3463
|
+
case 2:
|
|
3464
3464
|
case "end":
|
|
3465
3465
|
return _context72.stop();
|
|
3466
3466
|
}
|