@webex/calling 3.12.0-webex-services-ready.4 → 3.13.0
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/CallRecording/WxcCallRecordingConnector.js +345 -174
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -1
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +354 -182
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -1
- package/dist/CallRecording/callRecordingFixtures.js +40 -9
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -1
- package/dist/CallRecording/constants.js +12 -27
- package/dist/CallRecording/constants.js.map +1 -1
- package/dist/CallRecording/types.js +21 -16
- package/dist/CallRecording/types.js.map +1 -1
- package/dist/CallRecording/userhub.js +117 -0
- package/dist/CallRecording/userhub.js.map +1 -0
- package/dist/CallRecording/utils.js +3 -3
- package/dist/CallRecording/utils.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +19 -13
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +383 -185
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +3 -1
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +12 -2
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +15 -8
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +617 -527
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +5 -2
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +23 -2
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +87 -17
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +559 -411
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +646 -83
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js +26 -0
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/common/Utils.js +124 -105
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +346 -243
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/callUtils.js +187 -0
- package/dist/common/callUtils.js.map +1 -0
- package/dist/common/callUtils.test.js +313 -0
- package/dist/common/callUtils.test.js.map +1 -0
- package/dist/common/constants.js +27 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js +11 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +2 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/mobius-socket/mobius-socket-events.test.js +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -1
- package/dist/mobius-socket/mobius-socket.test.js +12 -12
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -1
- package/dist/mobius-socket/socket/socket-base.js +10 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -1
- package/dist/mobius-socket/socket.test.js +34 -14
- package/dist/mobius-socket/socket.test.js.map +1 -1
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +155 -63
- package/dist/module/CallRecording/callRecordingFixtures.js +38 -8
- package/dist/module/CallRecording/constants.js +11 -12
- package/dist/module/CallRecording/userhub.js +100 -0
- package/dist/module/CallingClient/CallingClient.js +12 -11
- package/dist/module/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/module/CallingClient/calling/call.js +10 -3
- package/dist/module/CallingClient/constants.js +3 -0
- package/dist/module/CallingClient/line/index.js +9 -1
- package/dist/module/CallingClient/registration/register.js +69 -16
- package/dist/module/CallingClient/registration/types.js +5 -1
- package/dist/module/Errors/types.js +2 -0
- package/dist/module/common/Utils.js +43 -43
- package/dist/module/common/callUtils.js +90 -0
- package/dist/module/common/constants.js +11 -0
- package/dist/module/common/index.js +1 -0
- package/dist/module/common/testUtil.js +1 -0
- package/dist/module/mobius-socket/socket/socket-base.js +8 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +6 -2
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -1
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +95 -4
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -1
- package/dist/types/CallRecording/constants.d.ts +11 -12
- package/dist/types/CallRecording/constants.d.ts.map +1 -1
- package/dist/types/CallRecording/types.d.ts +11 -3
- package/dist/types/CallRecording/types.d.ts.map +1 -1
- package/dist/types/CallRecording/userhub.d.ts +44 -0
- package/dist/types/CallRecording/userhub.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +3 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +2 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +3 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +22 -0
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +2 -0
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +1 -1
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +1 -0
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +4 -6
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/callUtils.d.ts +6 -0
- package/dist/types/common/callUtils.d.ts.map +1 -0
- package/dist/types/common/constants.d.ts +6 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -1
- package/package.json +12 -11
|
@@ -249,6 +249,9 @@ describe('Call Tests', function () {
|
|
|
249
249
|
// Need to add a small delay for Promise and callback to finish.
|
|
250
250
|
expect(parseMediaQualityStatisticsMock).toHaveBeenCalledTimes(1);
|
|
251
251
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
252
|
+
expect(webex.request.mock.calls[0][0].body.callId).toBe(call.getCallId().replace("".concat(_constants.DEFAULT_LOCAL_CALL_ID, "_"), ''));
|
|
253
|
+
expect(webex.request.mock.calls[0][0].body.callId).not.toContain(_constants.DEFAULT_LOCAL_CALL_ID);
|
|
254
|
+
expect(webex.request.mock.calls[0][0].body.callId).not.toMatch(/^_/);
|
|
252
255
|
expect(call.getDisconnectReason().code).toBe(_types5.DisconnectCode.NORMAL);
|
|
253
256
|
expect(call.getDisconnectReason().cause).toBe(_types5.DisconnectCause.NORMAL);
|
|
254
257
|
|
|
@@ -297,14 +300,83 @@ describe('Call Tests', function () {
|
|
|
297
300
|
}
|
|
298
301
|
}, _callee3);
|
|
299
302
|
})));
|
|
300
|
-
|
|
303
|
+
describe('Host ips in the call payloads', function () {
|
|
304
|
+
var sdpWithHostCandidate = ['v=0', 'm=audio 9 UDP/TLS/RTP/SAVPF 111', 'a=candidate:1 1 UDP 2130706431 10.0.0.5 54321 typ host generation 0'].join('\r\n');
|
|
305
|
+
beforeEach(function () {
|
|
306
|
+
webex.request.mockReturnValue({
|
|
307
|
+
statusCode: 200,
|
|
308
|
+
body: {
|
|
309
|
+
device: {
|
|
310
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
311
|
+
correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
|
|
312
|
+
},
|
|
313
|
+
callId: '8a67806f-fc4d-446b-a131-31e71ea5b020'
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
it.each([['post', 'the host candidates of the offer', {
|
|
318
|
+
sdp: sdpWithHostCandidate
|
|
319
|
+
}, ['10.0.0.5']], ['post', 'nothing when the roap message carries no sdp', {}, []], ['post', 'nothing when the state machine dispatches no roap message', undefined, []], ['postMedia', 'the host candidates of the offer', {
|
|
320
|
+
sdp: sdpWithHostCandidate
|
|
321
|
+
}, ['10.0.0.5']], ['postMedia', 'nothing when the roap message carries no sdp', {}, []], ['postMedia', 'nothing when the state machine dispatches no roap message', undefined, []]])('%s reports %s', /*#__PURE__*/function () {
|
|
322
|
+
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4(method, _name, roapMessage, expected) {
|
|
323
|
+
var call;
|
|
324
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
325
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
326
|
+
case 0:
|
|
327
|
+
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
328
|
+
_context4.next = 1;
|
|
329
|
+
return call[method](roapMessage);
|
|
330
|
+
case 1:
|
|
331
|
+
expect(webex.request.mock.calls[0][0].body.hostIps).toEqual(expected);
|
|
332
|
+
case 2:
|
|
333
|
+
case "end":
|
|
334
|
+
return _context4.stop();
|
|
335
|
+
}
|
|
336
|
+
}, _callee4);
|
|
337
|
+
}));
|
|
338
|
+
return function (_x, _x2, _x3, _x4) {
|
|
339
|
+
return _ref4.apply(this, arguments);
|
|
340
|
+
};
|
|
341
|
+
}());
|
|
342
|
+
});
|
|
343
|
+
it('delete sends the server-assigned callId unchanged', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
344
|
+
var serverCallId, call;
|
|
345
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
346
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
347
|
+
case 0:
|
|
348
|
+
serverCallId = '8a67806f-fc4d-446b-a131-31e71ea5b020';
|
|
349
|
+
webex.request.mockReturnValue({
|
|
350
|
+
statusCode: 200,
|
|
351
|
+
body: {
|
|
352
|
+
device: {
|
|
353
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
354
|
+
correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
|
|
355
|
+
},
|
|
356
|
+
callId: serverCallId
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
360
|
+
call.setCallId(serverCallId);
|
|
361
|
+
call.end();
|
|
362
|
+
_context5.next = 1;
|
|
363
|
+
return (0, _Utils.waitForMsecs)(50);
|
|
364
|
+
case 1:
|
|
365
|
+
expect(webex.request.mock.calls[0][0].body.callId).toBe(serverCallId);
|
|
366
|
+
case 2:
|
|
367
|
+
case "end":
|
|
368
|
+
return _context5.stop();
|
|
369
|
+
}
|
|
370
|
+
}, _callee5);
|
|
371
|
+
})));
|
|
372
|
+
it('check whether callerId midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
301
373
|
var call;
|
|
302
|
-
return _regenerator.default.wrap(function (
|
|
303
|
-
while (1) switch (
|
|
374
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
375
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
304
376
|
case 0:
|
|
305
377
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
306
378
|
call.handleMidCallEvent(dummyMidCallEvent);
|
|
307
|
-
|
|
379
|
+
_context6.next = 1;
|
|
308
380
|
return (0, _Utils.waitForMsecs)(50);
|
|
309
381
|
case 1:
|
|
310
382
|
expect(call.getCallerInfo().name).toStrictEqual('Bob Marley');
|
|
@@ -312,20 +384,20 @@ describe('Call Tests', function () {
|
|
|
312
384
|
expect(call.getCallerInfo().avatarSrc).toBeFalsy();
|
|
313
385
|
case 2:
|
|
314
386
|
case "end":
|
|
315
|
-
return
|
|
387
|
+
return _context6.stop();
|
|
316
388
|
}
|
|
317
|
-
},
|
|
389
|
+
}, _callee6);
|
|
318
390
|
})));
|
|
319
|
-
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
391
|
+
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
320
392
|
var call, logSpy, corelationId;
|
|
321
|
-
return _regenerator.default.wrap(function (
|
|
322
|
-
while (1) switch (
|
|
393
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
394
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
323
395
|
case 0:
|
|
324
396
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
325
397
|
dummyMidCallEvent.eventType = 'callState';
|
|
326
398
|
logSpy = jest.spyOn(_Logger.default, 'log');
|
|
327
399
|
call.handleMidCallEvent(dummyMidCallEvent);
|
|
328
|
-
|
|
400
|
+
_context7.next = 1;
|
|
329
401
|
return (0, _Utils.waitForMsecs)(50);
|
|
330
402
|
case 1:
|
|
331
403
|
corelationId = call.getCorrelationId();
|
|
@@ -335,39 +407,39 @@ describe('Call Tests', function () {
|
|
|
335
407
|
});
|
|
336
408
|
case 2:
|
|
337
409
|
case "end":
|
|
338
|
-
return
|
|
410
|
+
return _context7.stop();
|
|
339
411
|
}
|
|
340
|
-
},
|
|
412
|
+
}, _callee7);
|
|
341
413
|
})));
|
|
342
|
-
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
414
|
+
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
343
415
|
var call, callRtpStats, _t;
|
|
344
|
-
return _regenerator.default.wrap(function (
|
|
345
|
-
while (1) switch (
|
|
416
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
417
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
346
418
|
case 0:
|
|
347
419
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
348
|
-
|
|
349
|
-
|
|
420
|
+
_context8.prev = 1;
|
|
421
|
+
_context8.next = 2;
|
|
350
422
|
return call.getCallRtpStats();
|
|
351
423
|
case 2:
|
|
352
|
-
callRtpStats =
|
|
353
|
-
|
|
424
|
+
callRtpStats = _context8.sent;
|
|
425
|
+
_context8.next = 4;
|
|
354
426
|
break;
|
|
355
427
|
case 3:
|
|
356
|
-
|
|
357
|
-
_t =
|
|
428
|
+
_context8.prev = 3;
|
|
429
|
+
_t = _context8["catch"](1);
|
|
358
430
|
console.error(_t);
|
|
359
431
|
case 4:
|
|
360
432
|
expect(callRtpStats).toStrictEqual(disconnectStats);
|
|
361
433
|
case 5:
|
|
362
434
|
case "end":
|
|
363
|
-
return
|
|
435
|
+
return _context8.stop();
|
|
364
436
|
}
|
|
365
|
-
},
|
|
437
|
+
}, _callee8, null, [[1, 3]]);
|
|
366
438
|
})));
|
|
367
|
-
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
439
|
+
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
368
440
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, logSpy;
|
|
369
|
-
return _regenerator.default.wrap(function (
|
|
370
|
-
while (1) switch (
|
|
441
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
442
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
371
443
|
case 0:
|
|
372
444
|
mockStream = {
|
|
373
445
|
outputStream: {
|
|
@@ -400,14 +472,14 @@ describe('Call Tests', function () {
|
|
|
400
472
|
});
|
|
401
473
|
case 1:
|
|
402
474
|
case "end":
|
|
403
|
-
return
|
|
475
|
+
return _context9.stop();
|
|
404
476
|
}
|
|
405
|
-
},
|
|
477
|
+
}, _callee9);
|
|
406
478
|
})));
|
|
407
|
-
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
479
|
+
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
408
480
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, infoSpy;
|
|
409
|
-
return _regenerator.default.wrap(function (
|
|
410
|
-
while (1) switch (
|
|
481
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
482
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
411
483
|
case 0:
|
|
412
484
|
mockStream = {
|
|
413
485
|
outputStream: {
|
|
@@ -441,9 +513,9 @@ describe('Call Tests', function () {
|
|
|
441
513
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
442
514
|
case 1:
|
|
443
515
|
case "end":
|
|
444
|
-
return
|
|
516
|
+
return _context0.stop();
|
|
445
517
|
}
|
|
446
|
-
},
|
|
518
|
+
}, _callee0);
|
|
447
519
|
})));
|
|
448
520
|
it('registers and unregisters media connection listeners with stable handlers', function () {
|
|
449
521
|
var mockStream = {
|
|
@@ -489,9 +561,9 @@ describe('Call Tests', function () {
|
|
|
489
561
|
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
490
562
|
var getHandlerForEvent = function getHandlerForEvent(eventName) {
|
|
491
563
|
var _mock$calls$find;
|
|
492
|
-
return (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (
|
|
493
|
-
var
|
|
494
|
-
name =
|
|
564
|
+
return (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (_ref1) {
|
|
565
|
+
var _ref10 = (0, _slicedToArray2.default)(_ref1, 1),
|
|
566
|
+
name = _ref10[0];
|
|
495
567
|
return name === eventName;
|
|
496
568
|
})) === null || _mock$calls$find === void 0 ? void 0 : _mock$calls$find[1];
|
|
497
569
|
};
|
|
@@ -538,18 +610,18 @@ describe('Call Tests', function () {
|
|
|
538
610
|
call.dial(localAudioStream);
|
|
539
611
|
var metricSpy = jest.spyOn(call['metricManager'], 'submitMediaMetric');
|
|
540
612
|
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
541
|
-
var roapFailureHandler = (_mock$calls$find2 = call['mediaConnection'].on.mock.calls.find(function (
|
|
542
|
-
var
|
|
543
|
-
name =
|
|
613
|
+
var roapFailureHandler = (_mock$calls$find2 = call['mediaConnection'].on.mock.calls.find(function (_ref11) {
|
|
614
|
+
var _ref12 = (0, _slicedToArray2.default)(_ref11, 1),
|
|
615
|
+
name = _ref12[0];
|
|
544
616
|
return name === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE;
|
|
545
617
|
})) === null || _mock$calls$find2 === void 0 ? void 0 : _mock$calls$find2[1];
|
|
546
618
|
var roapFailure = new Error('Failed to process remote SDP');
|
|
547
619
|
roapFailureHandler(roapFailure);
|
|
548
620
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.MEDIA_ERROR, _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, undefined, expect.any(_Errors.CallError));
|
|
549
|
-
var roapFailureMetricCall = metricSpy.mock.calls.find(function (
|
|
550
|
-
var
|
|
551
|
-
name =
|
|
552
|
-
metricAction =
|
|
621
|
+
var roapFailureMetricCall = metricSpy.mock.calls.find(function (_ref13) {
|
|
622
|
+
var _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
|
|
623
|
+
name = _ref14[0],
|
|
624
|
+
metricAction = _ref14[1];
|
|
553
625
|
return name === _types4.METRIC_EVENT.MEDIA_ERROR && metricAction === _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE;
|
|
554
626
|
});
|
|
555
627
|
expect(roapFailureMetricCall).toBeDefined();
|
|
@@ -559,11 +631,11 @@ describe('Call Tests', function () {
|
|
|
559
631
|
method: 'mediaRoapEventsListener'
|
|
560
632
|
});
|
|
561
633
|
});
|
|
562
|
-
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
634
|
+
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
563
635
|
var _mock$calls$find3;
|
|
564
636
|
var mockStream, localAudioStream, call, handleOutgoingCallConnectSpy, delayedOffer, sendCallStateMachineEvtSpy, sendMediaStateMachineEvtSpy, roapListener;
|
|
565
|
-
return _regenerator.default.wrap(function (
|
|
566
|
-
while (1) switch (
|
|
637
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
638
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
567
639
|
case 0:
|
|
568
640
|
mockStream = {
|
|
569
641
|
outputStream: {
|
|
@@ -590,7 +662,7 @@ describe('Call Tests', function () {
|
|
|
590
662
|
}
|
|
591
663
|
});
|
|
592
664
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
593
|
-
|
|
665
|
+
_context1.next = 1;
|
|
594
666
|
return call.answer(localAudioStream);
|
|
595
667
|
case 1:
|
|
596
668
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
@@ -609,19 +681,19 @@ describe('Call Tests', function () {
|
|
|
609
681
|
type: 'E_RECV_ROAP_OFFER',
|
|
610
682
|
data: delayedOffer
|
|
611
683
|
});
|
|
612
|
-
|
|
684
|
+
_context1.next = 2;
|
|
613
685
|
return (0, _testUtil.flushPromises)(2);
|
|
614
686
|
case 2:
|
|
615
687
|
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenCalledWith(delayedOffer);
|
|
616
688
|
sendCallStateMachineEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
617
689
|
sendMediaStateMachineEvtSpy = jest.spyOn(call, 'sendMediaStateMachineEvt');
|
|
618
|
-
roapListener = (_mock$calls$find3 = call['mediaConnection'].on.mock.calls.find(function (
|
|
619
|
-
var
|
|
620
|
-
eventName =
|
|
690
|
+
roapListener = (_mock$calls$find3 = call['mediaConnection'].on.mock.calls.find(function (_ref16) {
|
|
691
|
+
var _ref17 = (0, _slicedToArray2.default)(_ref16, 1),
|
|
692
|
+
eventName = _ref17[0];
|
|
621
693
|
return eventName === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND;
|
|
622
694
|
})) === null || _mock$calls$find3 === void 0 ? void 0 : _mock$calls$find3[1];
|
|
623
695
|
expect(roapListener).toBeDefined();
|
|
624
|
-
|
|
696
|
+
_context1.next = 3;
|
|
625
697
|
return roapListener({
|
|
626
698
|
roapMessage: {
|
|
627
699
|
messageType: 'ANSWER',
|
|
@@ -631,7 +703,7 @@ describe('Call Tests', function () {
|
|
|
631
703
|
}
|
|
632
704
|
});
|
|
633
705
|
case 3:
|
|
634
|
-
|
|
706
|
+
_context1.next = 4;
|
|
635
707
|
return (0, _testUtil.flushPromises)(2);
|
|
636
708
|
case 4:
|
|
637
709
|
// On ANSWER from media layer, connect is retried first, then ROAP answer is posted.
|
|
@@ -649,9 +721,9 @@ describe('Call Tests', function () {
|
|
|
649
721
|
expect(call['connectPending']).toBe(false);
|
|
650
722
|
case 5:
|
|
651
723
|
case "end":
|
|
652
|
-
return
|
|
724
|
+
return _context1.stop();
|
|
653
725
|
}
|
|
654
|
-
},
|
|
726
|
+
}, _callee1);
|
|
655
727
|
})));
|
|
656
728
|
var iceLiteOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'a=ice-lite\r\nm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\n';
|
|
657
729
|
var fullIceOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\na=ice-ufrag:mLbW\r\n';
|
|
@@ -689,15 +761,15 @@ describe('Call Tests', function () {
|
|
|
689
761
|
reduceTimeoutForIceLite: true
|
|
690
762
|
},
|
|
691
763
|
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
692
|
-
}])('ICE candidates timeout selection', function (
|
|
693
|
-
var name =
|
|
694
|
-
sdp =
|
|
695
|
-
iceGatheringConfig =
|
|
696
|
-
expectedTimeout =
|
|
697
|
-
it("uses ".concat(name), /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
764
|
+
}])('ICE candidates timeout selection', function (_ref18) {
|
|
765
|
+
var name = _ref18.name,
|
|
766
|
+
sdp = _ref18.sdp,
|
|
767
|
+
iceGatheringConfig = _ref18.iceGatheringConfig,
|
|
768
|
+
expectedTimeout = _ref18.expectedTimeout;
|
|
769
|
+
it("uses ".concat(name), /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
698
770
|
var mockStream, localAudioStream, call;
|
|
699
|
-
return _regenerator.default.wrap(function (
|
|
700
|
-
while (1) switch (
|
|
771
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
772
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
701
773
|
case 0:
|
|
702
774
|
mockStream = {
|
|
703
775
|
outputStream: {
|
|
@@ -727,7 +799,7 @@ describe('Call Tests', function () {
|
|
|
727
799
|
sdp: sdp
|
|
728
800
|
}
|
|
729
801
|
});
|
|
730
|
-
|
|
802
|
+
_context10.next = 1;
|
|
731
803
|
return call.answer(localAudioStream);
|
|
732
804
|
case 1:
|
|
733
805
|
expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(_objectSpread(_objectSpread({}, roapMediaConnectionConfig), {}, {
|
|
@@ -735,15 +807,15 @@ describe('Call Tests', function () {
|
|
|
735
807
|
}), roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
|
|
736
808
|
case 2:
|
|
737
809
|
case "end":
|
|
738
|
-
return
|
|
810
|
+
return _context10.stop();
|
|
739
811
|
}
|
|
740
|
-
},
|
|
812
|
+
}, _callee10);
|
|
741
813
|
})));
|
|
742
814
|
});
|
|
743
|
-
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
815
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
744
816
|
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
745
|
-
return _regenerator.default.wrap(function (
|
|
746
|
-
while (1) switch (
|
|
817
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
818
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
747
819
|
case 0:
|
|
748
820
|
mockStream = {
|
|
749
821
|
outputStream: {
|
|
@@ -799,7 +871,7 @@ describe('Call Tests', function () {
|
|
|
799
871
|
});
|
|
800
872
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
801
873
|
call.end();
|
|
802
|
-
|
|
874
|
+
_context11.next = 1;
|
|
803
875
|
return (0, _Utils.waitForMsecs)(50);
|
|
804
876
|
case 1:
|
|
805
877
|
/* Checks for switching off the listeners on call disconnect */
|
|
@@ -810,14 +882,32 @@ describe('Call Tests', function () {
|
|
|
810
882
|
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
811
883
|
case 2:
|
|
812
884
|
case "end":
|
|
813
|
-
return
|
|
885
|
+
return _context11.stop();
|
|
814
886
|
}
|
|
815
|
-
},
|
|
887
|
+
}, _callee11);
|
|
816
888
|
})));
|
|
817
|
-
it('
|
|
889
|
+
it('does not register effect listeners when the added effect cannot be resolved', function () {
|
|
890
|
+
var mockStream = {
|
|
891
|
+
outputStream: {
|
|
892
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
893
|
+
},
|
|
894
|
+
on: jest.fn(),
|
|
895
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
896
|
+
};
|
|
897
|
+
var localAudioStream = mockStream;
|
|
898
|
+
var onStreamSpy = jest.spyOn(localAudioStream, 'on');
|
|
899
|
+
var onEffectSpy = jest.spyOn(mockEffect, 'on');
|
|
900
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
901
|
+
call.dial(localAudioStream);
|
|
902
|
+
expect(function () {
|
|
903
|
+
return onStreamSpy.mock.calls[1][1](undefined);
|
|
904
|
+
}).not.toThrow();
|
|
905
|
+
expect(onEffectSpy).not.toHaveBeenCalled();
|
|
906
|
+
});
|
|
907
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
818
908
|
var mockStream, localAudioStream, warnSpy, call;
|
|
819
|
-
return _regenerator.default.wrap(function (
|
|
820
|
-
while (1) switch (
|
|
909
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
910
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
821
911
|
case 0:
|
|
822
912
|
mockStream = {
|
|
823
913
|
outputStream: {
|
|
@@ -841,7 +931,7 @@ describe('Call Tests', function () {
|
|
|
841
931
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
842
932
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
843
933
|
call.answer(localAudioStream);
|
|
844
|
-
|
|
934
|
+
_context12.next = 1;
|
|
845
935
|
return (0, _Utils.waitForMsecs)(50);
|
|
846
936
|
case 1:
|
|
847
937
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -856,14 +946,14 @@ describe('Call Tests', function () {
|
|
|
856
946
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
857
947
|
case 2:
|
|
858
948
|
case "end":
|
|
859
|
-
return
|
|
949
|
+
return _context12.stop();
|
|
860
950
|
}
|
|
861
|
-
},
|
|
951
|
+
}, _callee12);
|
|
862
952
|
})));
|
|
863
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
953
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
864
954
|
var mockStream, localAudioStream, warnSpy, call;
|
|
865
|
-
return _regenerator.default.wrap(function (
|
|
866
|
-
while (1) switch (
|
|
955
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
956
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
867
957
|
case 0:
|
|
868
958
|
mockStream = {
|
|
869
959
|
outputStream: {
|
|
@@ -875,7 +965,7 @@ describe('Call Tests', function () {
|
|
|
875
965
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
876
966
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
877
967
|
call.dial(localAudioStream);
|
|
878
|
-
|
|
968
|
+
_context13.next = 1;
|
|
879
969
|
return (0, _Utils.waitForMsecs)(50);
|
|
880
970
|
case 1:
|
|
881
971
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -888,9 +978,9 @@ describe('Call Tests', function () {
|
|
|
888
978
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
889
979
|
case 2:
|
|
890
980
|
case "end":
|
|
891
|
-
return
|
|
981
|
+
return _context13.stop();
|
|
892
982
|
}
|
|
893
|
-
},
|
|
983
|
+
}, _callee13);
|
|
894
984
|
})));
|
|
895
985
|
it('update media after call creation with valid stream', function () {
|
|
896
986
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -964,10 +1054,10 @@ describe('Call Tests', function () {
|
|
|
964
1054
|
method: 'dial'
|
|
965
1055
|
});
|
|
966
1056
|
});
|
|
967
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1057
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
968
1058
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
969
|
-
return _regenerator.default.wrap(function (
|
|
970
|
-
while (1) switch (
|
|
1059
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1060
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
971
1061
|
case 0:
|
|
972
1062
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
973
1063
|
webex.request.mockReturnValue({
|
|
@@ -1043,9 +1133,9 @@ describe('Call Tests', function () {
|
|
|
1043
1133
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
1044
1134
|
case 1:
|
|
1045
1135
|
case "end":
|
|
1046
|
-
return
|
|
1136
|
+
return _context14.stop();
|
|
1047
1137
|
}
|
|
1048
|
-
},
|
|
1138
|
+
}, _callee14);
|
|
1049
1139
|
})));
|
|
1050
1140
|
describe('Guest Calling Flow Tests', function () {
|
|
1051
1141
|
var dummyEvent = {
|
|
@@ -1053,10 +1143,10 @@ describe('Call Tests', function () {
|
|
|
1053
1143
|
data: undefined
|
|
1054
1144
|
};
|
|
1055
1145
|
var call;
|
|
1056
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1146
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1057
1147
|
var requestSpy, requestArgs;
|
|
1058
|
-
return _regenerator.default.wrap(function (
|
|
1059
|
-
while (1) switch (
|
|
1148
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1149
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1060
1150
|
case 0:
|
|
1061
1151
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
1062
1152
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1069,14 +1159,14 @@ describe('Call Tests', function () {
|
|
|
1069
1159
|
expect('callee' in requestArgs.body).toBe(true);
|
|
1070
1160
|
case 1:
|
|
1071
1161
|
case "end":
|
|
1072
|
-
return
|
|
1162
|
+
return _context15.stop();
|
|
1073
1163
|
}
|
|
1074
|
-
},
|
|
1164
|
+
}, _callee15);
|
|
1075
1165
|
})));
|
|
1076
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1166
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1077
1167
|
var requestSpy, requestArgs;
|
|
1078
|
-
return _regenerator.default.wrap(function (
|
|
1079
|
-
while (1) switch (
|
|
1168
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1169
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1080
1170
|
case 0:
|
|
1081
1171
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
1082
1172
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1089,9 +1179,9 @@ describe('Call Tests', function () {
|
|
|
1089
1179
|
expect('callee' in requestArgs.body).toBe(false);
|
|
1090
1180
|
case 1:
|
|
1091
1181
|
case "end":
|
|
1092
|
-
return
|
|
1182
|
+
return _context16.stop();
|
|
1093
1183
|
}
|
|
1094
|
-
},
|
|
1184
|
+
}, _callee16);
|
|
1095
1185
|
})));
|
|
1096
1186
|
});
|
|
1097
1187
|
});
|
|
@@ -1129,10 +1219,10 @@ describe('State Machine handler tests', function () {
|
|
|
1129
1219
|
|
|
1130
1220
|
// afterEach(() => call.removeAllListeners());
|
|
1131
1221
|
|
|
1132
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1222
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
1133
1223
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
1134
|
-
return _regenerator.default.wrap(function (
|
|
1135
|
-
while (1) switch (
|
|
1224
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1225
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1136
1226
|
case 0:
|
|
1137
1227
|
statusPayload = {
|
|
1138
1228
|
statusCode: 200,
|
|
@@ -1152,7 +1242,7 @@ describe('State Machine handler tests', function () {
|
|
|
1152
1242
|
/* This is to flush all the promises from the Promise queue so that
|
|
1153
1243
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
1154
1244
|
*/
|
|
1155
|
-
|
|
1245
|
+
_context17.next = 1;
|
|
1156
1246
|
return (0, _testUtil.flushPromises)(3);
|
|
1157
1247
|
case 1:
|
|
1158
1248
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -1168,14 +1258,14 @@ describe('State Machine handler tests', function () {
|
|
|
1168
1258
|
});
|
|
1169
1259
|
case 2:
|
|
1170
1260
|
case "end":
|
|
1171
|
-
return
|
|
1261
|
+
return _context17.stop();
|
|
1172
1262
|
}
|
|
1173
|
-
},
|
|
1263
|
+
}, _callee17);
|
|
1174
1264
|
})));
|
|
1175
|
-
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1265
|
+
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
1176
1266
|
var statusPayload, emitSpy, funcSpy;
|
|
1177
|
-
return _regenerator.default.wrap(function (
|
|
1178
|
-
while (1) switch (
|
|
1267
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1268
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1179
1269
|
case 0:
|
|
1180
1270
|
expect.assertions(4);
|
|
1181
1271
|
statusPayload = {
|
|
@@ -1190,10 +1280,10 @@ describe('State Machine handler tests', function () {
|
|
|
1190
1280
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
1191
1281
|
call['handleCallEstablished']({});
|
|
1192
1282
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1193
|
-
|
|
1283
|
+
_context18.next = 1;
|
|
1194
1284
|
return _promise.default.resolve();
|
|
1195
1285
|
case 1:
|
|
1196
|
-
|
|
1286
|
+
_context18.next = 2;
|
|
1197
1287
|
return _promise.default.resolve();
|
|
1198
1288
|
case 2:
|
|
1199
1289
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -1203,14 +1293,14 @@ describe('State Machine handler tests', function () {
|
|
|
1203
1293
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
1204
1294
|
case 3:
|
|
1205
1295
|
case "end":
|
|
1206
|
-
return
|
|
1296
|
+
return _context18.stop();
|
|
1207
1297
|
}
|
|
1208
|
-
},
|
|
1298
|
+
}, _callee18);
|
|
1209
1299
|
})));
|
|
1210
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1300
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1211
1301
|
var statusPayload, funcSpy;
|
|
1212
|
-
return _regenerator.default.wrap(function (
|
|
1213
|
-
while (1) switch (
|
|
1302
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1303
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1214
1304
|
case 0:
|
|
1215
1305
|
expect.assertions(4);
|
|
1216
1306
|
statusPayload = {
|
|
@@ -1229,7 +1319,7 @@ describe('State Machine handler tests', function () {
|
|
|
1229
1319
|
/* This is to flush all the promises from the Promise queue so that
|
|
1230
1320
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
1231
1321
|
*/
|
|
1232
|
-
|
|
1322
|
+
_context19.next = 1;
|
|
1233
1323
|
return (0, _testUtil.flushPromises)(2);
|
|
1234
1324
|
case 1:
|
|
1235
1325
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -1238,14 +1328,14 @@ describe('State Machine handler tests', function () {
|
|
|
1238
1328
|
expect(funcSpy).toBeCalledTimes(1);
|
|
1239
1329
|
case 2:
|
|
1240
1330
|
case "end":
|
|
1241
|
-
return
|
|
1331
|
+
return _context19.stop();
|
|
1242
1332
|
}
|
|
1243
|
-
},
|
|
1333
|
+
}, _callee19);
|
|
1244
1334
|
})));
|
|
1245
|
-
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1335
|
+
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1246
1336
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
1247
|
-
return _regenerator.default.wrap(function (
|
|
1248
|
-
while (1) switch (
|
|
1337
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1338
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1249
1339
|
case 0:
|
|
1250
1340
|
errorPayload = {
|
|
1251
1341
|
statusCode: 500,
|
|
@@ -1263,28 +1353,28 @@ describe('State Machine handler tests', function () {
|
|
|
1263
1353
|
call['handleCallEstablished']({});
|
|
1264
1354
|
}
|
|
1265
1355
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1266
|
-
|
|
1356
|
+
_context20.next = 1;
|
|
1267
1357
|
return (0, _testUtil.flushPromises)(2);
|
|
1268
1358
|
case 1:
|
|
1269
1359
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
1270
1360
|
|
|
1271
1361
|
// Now advance by 1 second for the retry-after interval
|
|
1272
1362
|
jest.advanceTimersByTime(1000);
|
|
1273
|
-
|
|
1363
|
+
_context20.next = 2;
|
|
1274
1364
|
return (0, _testUtil.flushPromises)(2);
|
|
1275
1365
|
case 2:
|
|
1276
1366
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
1277
1367
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
1278
1368
|
case 3:
|
|
1279
1369
|
case "end":
|
|
1280
|
-
return
|
|
1370
|
+
return _context20.stop();
|
|
1281
1371
|
}
|
|
1282
|
-
},
|
|
1372
|
+
}, _callee20);
|
|
1283
1373
|
})));
|
|
1284
|
-
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1374
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1285
1375
|
var firstTimer, secondTimer;
|
|
1286
|
-
return _regenerator.default.wrap(function (
|
|
1287
|
-
while (1) switch (
|
|
1376
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1377
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1288
1378
|
case 0:
|
|
1289
1379
|
jest.spyOn(global, 'setInterval');
|
|
1290
1380
|
jest.spyOn(global, 'clearInterval');
|
|
@@ -1312,14 +1402,14 @@ describe('State Machine handler tests', function () {
|
|
|
1312
1402
|
expect(secondTimer).toBeDefined();
|
|
1313
1403
|
case 1:
|
|
1314
1404
|
case "end":
|
|
1315
|
-
return
|
|
1405
|
+
return _context21.stop();
|
|
1316
1406
|
}
|
|
1317
|
-
},
|
|
1407
|
+
}, _callee21);
|
|
1318
1408
|
})));
|
|
1319
|
-
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1409
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1320
1410
|
var errorPayload, warnSpy, postStatusSpy;
|
|
1321
|
-
return _regenerator.default.wrap(function (
|
|
1322
|
-
while (1) switch (
|
|
1411
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1412
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1323
1413
|
case 0:
|
|
1324
1414
|
errorPayload = {
|
|
1325
1415
|
statusCode: 500,
|
|
@@ -1338,25 +1428,25 @@ describe('State Machine handler tests', function () {
|
|
|
1338
1428
|
|
|
1339
1429
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
1340
1430
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1341
|
-
|
|
1431
|
+
_context22.next = 1;
|
|
1342
1432
|
return (0, _testUtil.flushPromises)(2);
|
|
1343
1433
|
case 1:
|
|
1344
1434
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
1345
1435
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
1346
1436
|
jest.advanceTimersByTime(1000);
|
|
1347
|
-
|
|
1437
|
+
_context22.next = 2;
|
|
1348
1438
|
return (0, _testUtil.flushPromises)(2);
|
|
1349
1439
|
case 2:
|
|
1350
1440
|
jest.advanceTimersByTime(1000);
|
|
1351
|
-
|
|
1441
|
+
_context22.next = 3;
|
|
1352
1442
|
return (0, _testUtil.flushPromises)(2);
|
|
1353
1443
|
case 3:
|
|
1354
1444
|
jest.advanceTimersByTime(1000);
|
|
1355
|
-
|
|
1445
|
+
_context22.next = 4;
|
|
1356
1446
|
return (0, _testUtil.flushPromises)(2);
|
|
1357
1447
|
case 4:
|
|
1358
1448
|
jest.advanceTimersByTime(1000);
|
|
1359
|
-
|
|
1449
|
+
_context22.next = 5;
|
|
1360
1450
|
return (0, _testUtil.flushPromises)(2);
|
|
1361
1451
|
case 5:
|
|
1362
1452
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1368,14 +1458,14 @@ describe('State Machine handler tests', function () {
|
|
|
1368
1458
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1369
1459
|
case 6:
|
|
1370
1460
|
case "end":
|
|
1371
|
-
return
|
|
1461
|
+
return _context22.stop();
|
|
1372
1462
|
}
|
|
1373
|
-
},
|
|
1463
|
+
}, _callee22);
|
|
1374
1464
|
})));
|
|
1375
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1465
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1376
1466
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1377
|
-
return _regenerator.default.wrap(function (
|
|
1378
|
-
while (1) switch (
|
|
1467
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1468
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1379
1469
|
case 0:
|
|
1380
1470
|
statusPayload = {
|
|
1381
1471
|
statusCode: 200,
|
|
@@ -1431,14 +1521,14 @@ describe('State Machine handler tests', function () {
|
|
|
1431
1521
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1432
1522
|
case 1:
|
|
1433
1523
|
case "end":
|
|
1434
|
-
return
|
|
1524
|
+
return _context23.stop();
|
|
1435
1525
|
}
|
|
1436
|
-
},
|
|
1526
|
+
}, _callee23);
|
|
1437
1527
|
})));
|
|
1438
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1528
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1439
1529
|
var statusPayload, dummyEvent;
|
|
1440
|
-
return _regenerator.default.wrap(function (
|
|
1441
|
-
while (1) switch (
|
|
1530
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1531
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1442
1532
|
case 0:
|
|
1443
1533
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1444
1534
|
statusPayload = {
|
|
@@ -1456,7 +1546,7 @@ describe('State Machine handler tests', function () {
|
|
|
1456
1546
|
webex.request.mockReturnValue(statusPayload);
|
|
1457
1547
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1458
1548
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1459
|
-
|
|
1549
|
+
_context24.next = 1;
|
|
1460
1550
|
return call['handleOutgoingCallConnect']({
|
|
1461
1551
|
type: 'E_SEND_CALL_CONNECT'
|
|
1462
1552
|
});
|
|
@@ -1470,14 +1560,14 @@ describe('State Machine handler tests', function () {
|
|
|
1470
1560
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1471
1561
|
case 2:
|
|
1472
1562
|
case "end":
|
|
1473
|
-
return
|
|
1563
|
+
return _context24.stop();
|
|
1474
1564
|
}
|
|
1475
|
-
},
|
|
1565
|
+
}, _callee24);
|
|
1476
1566
|
})));
|
|
1477
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1567
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1478
1568
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1479
|
-
return _regenerator.default.wrap(function (
|
|
1480
|
-
while (1) switch (
|
|
1569
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1570
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1481
1571
|
case 0:
|
|
1482
1572
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1483
1573
|
statusPayload = {
|
|
@@ -1571,14 +1661,14 @@ describe('State Machine handler tests', function () {
|
|
|
1571
1661
|
expect(call.earlyMedia).not.toBe(true);
|
|
1572
1662
|
case 1:
|
|
1573
1663
|
case "end":
|
|
1574
|
-
return
|
|
1664
|
+
return _context25.stop();
|
|
1575
1665
|
}
|
|
1576
|
-
},
|
|
1666
|
+
}, _callee25);
|
|
1577
1667
|
})));
|
|
1578
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1668
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1579
1669
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1580
|
-
return _regenerator.default.wrap(function (
|
|
1581
|
-
while (1) switch (
|
|
1670
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1671
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1582
1672
|
case 0:
|
|
1583
1673
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1584
1674
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1605,7 +1695,7 @@ describe('State Machine handler tests', function () {
|
|
|
1605
1695
|
webex.request.mockRejectedValueOnce({
|
|
1606
1696
|
statusCode: 403
|
|
1607
1697
|
}).mockResolvedValue(statusPayload);
|
|
1608
|
-
|
|
1698
|
+
_context26.next = 1;
|
|
1609
1699
|
return call['handleOutgoingCallConnect']({
|
|
1610
1700
|
type: 'E_SEND_CALL_CONNECT'
|
|
1611
1701
|
});
|
|
@@ -1616,14 +1706,14 @@ describe('State Machine handler tests', function () {
|
|
|
1616
1706
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1617
1707
|
case 2:
|
|
1618
1708
|
case "end":
|
|
1619
|
-
return
|
|
1709
|
+
return _context26.stop();
|
|
1620
1710
|
}
|
|
1621
|
-
},
|
|
1711
|
+
}, _callee26);
|
|
1622
1712
|
})));
|
|
1623
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1713
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1624
1714
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1625
|
-
return _regenerator.default.wrap(function (
|
|
1626
|
-
while (1) switch (
|
|
1715
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1716
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1627
1717
|
case 0:
|
|
1628
1718
|
statusPayload = {
|
|
1629
1719
|
statusCode: 200,
|
|
@@ -1699,14 +1789,14 @@ describe('State Machine handler tests', function () {
|
|
|
1699
1789
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1700
1790
|
case 1:
|
|
1701
1791
|
case "end":
|
|
1702
|
-
return
|
|
1792
|
+
return _context27.stop();
|
|
1703
1793
|
}
|
|
1704
|
-
},
|
|
1794
|
+
}, _callee27);
|
|
1705
1795
|
})));
|
|
1706
|
-
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
|
|
1796
|
+
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 _callee28() {
|
|
1707
1797
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1708
|
-
return _regenerator.default.wrap(function (
|
|
1709
|
-
while (1) switch (
|
|
1798
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1799
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1710
1800
|
case 0:
|
|
1711
1801
|
statusPayload = {
|
|
1712
1802
|
statusCode: 200,
|
|
@@ -1774,14 +1864,14 @@ describe('State Machine handler tests', function () {
|
|
|
1774
1864
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1775
1865
|
case 1:
|
|
1776
1866
|
case "end":
|
|
1777
|
-
return
|
|
1867
|
+
return _context28.stop();
|
|
1778
1868
|
}
|
|
1779
|
-
},
|
|
1869
|
+
}, _callee28);
|
|
1780
1870
|
})));
|
|
1781
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1871
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1782
1872
|
var statusPayload, dummyEvent;
|
|
1783
|
-
return _regenerator.default.wrap(function (
|
|
1784
|
-
while (1) switch (
|
|
1873
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1874
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1785
1875
|
case 0:
|
|
1786
1876
|
statusPayload = {
|
|
1787
1877
|
statusCode: 200,
|
|
@@ -1820,14 +1910,14 @@ describe('State Machine handler tests', function () {
|
|
|
1820
1910
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1821
1911
|
case 1:
|
|
1822
1912
|
case "end":
|
|
1823
|
-
return
|
|
1913
|
+
return _context29.stop();
|
|
1824
1914
|
}
|
|
1825
|
-
},
|
|
1915
|
+
}, _callee29);
|
|
1826
1916
|
})));
|
|
1827
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1917
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1828
1918
|
var statusPayload, dummyEvent, errorSpy;
|
|
1829
|
-
return _regenerator.default.wrap(function (
|
|
1830
|
-
while (1) switch (
|
|
1919
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1920
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1831
1921
|
case 0:
|
|
1832
1922
|
statusPayload = {
|
|
1833
1923
|
statusCode: 403,
|
|
@@ -1844,13 +1934,13 @@ describe('State Machine handler tests', function () {
|
|
|
1844
1934
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1845
1935
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1846
1936
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1847
|
-
|
|
1937
|
+
_context30.next = 1;
|
|
1848
1938
|
return (0, _testUtil.flushPromises)(3);
|
|
1849
1939
|
case 1:
|
|
1850
|
-
|
|
1940
|
+
_context30.next = 2;
|
|
1851
1941
|
return _promise.default.resolve();
|
|
1852
1942
|
case 2:
|
|
1853
|
-
|
|
1943
|
+
_context30.next = 3;
|
|
1854
1944
|
return _promise.default.resolve();
|
|
1855
1945
|
case 3:
|
|
1856
1946
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
@@ -1861,14 +1951,14 @@ describe('State Machine handler tests', function () {
|
|
|
1861
1951
|
});
|
|
1862
1952
|
case 4:
|
|
1863
1953
|
case "end":
|
|
1864
|
-
return
|
|
1954
|
+
return _context30.stop();
|
|
1865
1955
|
}
|
|
1866
|
-
},
|
|
1956
|
+
}, _callee30);
|
|
1867
1957
|
})));
|
|
1868
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1958
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1869
1959
|
var statusPayload, dummyEvent, warnSpy;
|
|
1870
|
-
return _regenerator.default.wrap(function (
|
|
1871
|
-
while (1) switch (
|
|
1960
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1961
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1872
1962
|
case 0:
|
|
1873
1963
|
statusPayload = {
|
|
1874
1964
|
statusCode: 403,
|
|
@@ -1887,16 +1977,16 @@ describe('State Machine handler tests', function () {
|
|
|
1887
1977
|
webex.request.mockRejectedValue(statusPayload);
|
|
1888
1978
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1889
1979
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1890
|
-
|
|
1980
|
+
_context31.next = 1;
|
|
1891
1981
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1892
1982
|
case 1:
|
|
1893
|
-
|
|
1983
|
+
_context31.next = 2;
|
|
1894
1984
|
return (0, _testUtil.flushPromises)(2);
|
|
1895
1985
|
case 2:
|
|
1896
|
-
|
|
1986
|
+
_context31.next = 3;
|
|
1897
1987
|
return _promise.default.resolve();
|
|
1898
1988
|
case 3:
|
|
1899
|
-
|
|
1989
|
+
_context31.next = 4;
|
|
1900
1990
|
return _promise.default.resolve();
|
|
1901
1991
|
case 4:
|
|
1902
1992
|
expect(call.isConnected()).toBe(false);
|
|
@@ -1912,14 +2002,14 @@ describe('State Machine handler tests', function () {
|
|
|
1912
2002
|
});
|
|
1913
2003
|
case 5:
|
|
1914
2004
|
case "end":
|
|
1915
|
-
return
|
|
2005
|
+
return _context31.stop();
|
|
1916
2006
|
}
|
|
1917
|
-
},
|
|
2007
|
+
}, _callee31);
|
|
1918
2008
|
})));
|
|
1919
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2009
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1920
2010
|
var statusPayload, dummyEvent;
|
|
1921
|
-
return _regenerator.default.wrap(function (
|
|
1922
|
-
while (1) switch (
|
|
2011
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
2012
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1923
2013
|
case 0:
|
|
1924
2014
|
statusPayload = {
|
|
1925
2015
|
statusCode: 403,
|
|
@@ -1942,14 +2032,14 @@ describe('State Machine handler tests', function () {
|
|
|
1942
2032
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1943
2033
|
case 1:
|
|
1944
2034
|
case "end":
|
|
1945
|
-
return
|
|
2035
|
+
return _context32.stop();
|
|
1946
2036
|
}
|
|
1947
|
-
},
|
|
2037
|
+
}, _callee32);
|
|
1948
2038
|
})));
|
|
1949
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2039
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1950
2040
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1951
|
-
return _regenerator.default.wrap(function (
|
|
1952
|
-
while (1) switch (
|
|
2041
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
2042
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1953
2043
|
case 0:
|
|
1954
2044
|
statusPayload = {
|
|
1955
2045
|
statusCode: 503,
|
|
@@ -1971,7 +2061,7 @@ describe('State Machine handler tests', function () {
|
|
|
1971
2061
|
}
|
|
1972
2062
|
};
|
|
1973
2063
|
call['connected'] = true;
|
|
1974
|
-
|
|
2064
|
+
_context33.next = 1;
|
|
1975
2065
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1976
2066
|
case 1:
|
|
1977
2067
|
jest.advanceTimersByTime(1005);
|
|
@@ -1983,14 +2073,14 @@ describe('State Machine handler tests', function () {
|
|
|
1983
2073
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1984
2074
|
case 2:
|
|
1985
2075
|
case "end":
|
|
1986
|
-
return
|
|
2076
|
+
return _context33.stop();
|
|
1987
2077
|
}
|
|
1988
|
-
},
|
|
2078
|
+
}, _callee33);
|
|
1989
2079
|
})));
|
|
1990
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2080
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1991
2081
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1992
|
-
return _regenerator.default.wrap(function (
|
|
1993
|
-
while (1) switch (
|
|
2082
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
2083
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1994
2084
|
case 0:
|
|
1995
2085
|
statusPayload = {
|
|
1996
2086
|
statusCode: 503,
|
|
@@ -2012,7 +2102,7 @@ describe('State Machine handler tests', function () {
|
|
|
2012
2102
|
}
|
|
2013
2103
|
};
|
|
2014
2104
|
call['connected'] = false;
|
|
2015
|
-
|
|
2105
|
+
_context34.next = 1;
|
|
2016
2106
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
2017
2107
|
case 1:
|
|
2018
2108
|
jest.advanceTimersByTime(1005);
|
|
@@ -2023,14 +2113,14 @@ describe('State Machine handler tests', function () {
|
|
|
2023
2113
|
expect(stateMachineSpy).not.toBeCalled();
|
|
2024
2114
|
case 2:
|
|
2025
2115
|
case "end":
|
|
2026
|
-
return
|
|
2116
|
+
return _context34.stop();
|
|
2027
2117
|
}
|
|
2028
|
-
},
|
|
2118
|
+
}, _callee34);
|
|
2029
2119
|
})));
|
|
2030
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2120
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
2031
2121
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2032
|
-
return _regenerator.default.wrap(function (
|
|
2033
|
-
while (1) switch (
|
|
2122
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
2123
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2034
2124
|
case 0:
|
|
2035
2125
|
statusPayload = {
|
|
2036
2126
|
statusCode: 503,
|
|
@@ -2052,7 +2142,7 @@ describe('State Machine handler tests', function () {
|
|
|
2052
2142
|
};
|
|
2053
2143
|
call['connected'] = true;
|
|
2054
2144
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
2055
|
-
|
|
2145
|
+
_context35.next = 1;
|
|
2056
2146
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2057
2147
|
case 1:
|
|
2058
2148
|
jest.advanceTimersByTime(1005);
|
|
@@ -2064,14 +2154,14 @@ describe('State Machine handler tests', function () {
|
|
|
2064
2154
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
2065
2155
|
case 2:
|
|
2066
2156
|
case "end":
|
|
2067
|
-
return
|
|
2157
|
+
return _context35.stop();
|
|
2068
2158
|
}
|
|
2069
|
-
},
|
|
2159
|
+
}, _callee35);
|
|
2070
2160
|
})));
|
|
2071
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2161
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
2072
2162
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2073
|
-
return _regenerator.default.wrap(function (
|
|
2074
|
-
while (1) switch (
|
|
2163
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
2164
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2075
2165
|
case 0:
|
|
2076
2166
|
statusPayload = {
|
|
2077
2167
|
statusCode: 503,
|
|
@@ -2092,7 +2182,7 @@ describe('State Machine handler tests', function () {
|
|
|
2092
2182
|
}
|
|
2093
2183
|
};
|
|
2094
2184
|
call['connected'] = false;
|
|
2095
|
-
|
|
2185
|
+
_context36.next = 1;
|
|
2096
2186
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2097
2187
|
case 1:
|
|
2098
2188
|
jest.advanceTimersByTime(1005);
|
|
@@ -2104,14 +2194,14 @@ describe('State Machine handler tests', function () {
|
|
|
2104
2194
|
expect(stateMachineSpy).not.toBeCalled();
|
|
2105
2195
|
case 2:
|
|
2106
2196
|
case "end":
|
|
2107
|
-
return
|
|
2197
|
+
return _context36.stop();
|
|
2108
2198
|
}
|
|
2109
|
-
},
|
|
2199
|
+
}, _callee36);
|
|
2110
2200
|
})));
|
|
2111
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2201
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
2112
2202
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
2113
|
-
return _regenerator.default.wrap(function (
|
|
2114
|
-
while (1) switch (
|
|
2203
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2204
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2115
2205
|
case 0:
|
|
2116
2206
|
statusPayload = {
|
|
2117
2207
|
statusCode: 200,
|
|
@@ -2136,14 +2226,14 @@ describe('State Machine handler tests', function () {
|
|
|
2136
2226
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
2137
2227
|
case 1:
|
|
2138
2228
|
case "end":
|
|
2139
|
-
return
|
|
2229
|
+
return _context37.stop();
|
|
2140
2230
|
}
|
|
2141
|
-
},
|
|
2231
|
+
}, _callee37);
|
|
2142
2232
|
})));
|
|
2143
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2233
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
2144
2234
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2145
|
-
return _regenerator.default.wrap(function (
|
|
2146
|
-
while (1) switch (
|
|
2235
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2236
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2147
2237
|
case 0:
|
|
2148
2238
|
statusPayload = {
|
|
2149
2239
|
statusCode: 503,
|
|
@@ -2165,7 +2255,7 @@ describe('State Machine handler tests', function () {
|
|
|
2165
2255
|
};
|
|
2166
2256
|
call['connected'] = true;
|
|
2167
2257
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
2168
|
-
|
|
2258
|
+
_context38.next = 1;
|
|
2169
2259
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2170
2260
|
case 1:
|
|
2171
2261
|
jest.advanceTimersByTime(1005);
|
|
@@ -2177,14 +2267,14 @@ describe('State Machine handler tests', function () {
|
|
|
2177
2267
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
2178
2268
|
case 2:
|
|
2179
2269
|
case "end":
|
|
2180
|
-
return
|
|
2270
|
+
return _context38.stop();
|
|
2181
2271
|
}
|
|
2182
|
-
},
|
|
2272
|
+
}, _callee38);
|
|
2183
2273
|
})));
|
|
2184
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2274
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2185
2275
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
2186
|
-
return _regenerator.default.wrap(function (
|
|
2187
|
-
while (1) switch (
|
|
2276
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2277
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2188
2278
|
case 0:
|
|
2189
2279
|
statusPayload = {
|
|
2190
2280
|
statusCode: 403,
|
|
@@ -2207,14 +2297,14 @@ describe('State Machine handler tests', function () {
|
|
|
2207
2297
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
2208
2298
|
case 1:
|
|
2209
2299
|
case "end":
|
|
2210
|
-
return
|
|
2300
|
+
return _context39.stop();
|
|
2211
2301
|
}
|
|
2212
|
-
},
|
|
2302
|
+
}, _callee39);
|
|
2213
2303
|
})));
|
|
2214
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2304
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2215
2305
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
2216
|
-
return _regenerator.default.wrap(function (
|
|
2217
|
-
while (1) switch (
|
|
2306
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2307
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2218
2308
|
case 0:
|
|
2219
2309
|
statusPayload = {
|
|
2220
2310
|
statusCode: 200,
|
|
@@ -2232,7 +2322,7 @@ describe('State Machine handler tests', function () {
|
|
|
2232
2322
|
}
|
|
2233
2323
|
};
|
|
2234
2324
|
call['connected'] = false;
|
|
2235
|
-
|
|
2325
|
+
_context40.next = 1;
|
|
2236
2326
|
return call['handleRoapError']({}, errorEvent);
|
|
2237
2327
|
case 1:
|
|
2238
2328
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -2248,14 +2338,14 @@ describe('State Machine handler tests', function () {
|
|
|
2248
2338
|
});
|
|
2249
2339
|
case 2:
|
|
2250
2340
|
case "end":
|
|
2251
|
-
return
|
|
2341
|
+
return _context40.stop();
|
|
2252
2342
|
}
|
|
2253
|
-
},
|
|
2343
|
+
}, _callee40);
|
|
2254
2344
|
})));
|
|
2255
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2345
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2256
2346
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
2257
|
-
return _regenerator.default.wrap(function (
|
|
2258
|
-
while (1) switch (
|
|
2347
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2348
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2259
2349
|
case 0:
|
|
2260
2350
|
statusPayload = {
|
|
2261
2351
|
statusCode: 403,
|
|
@@ -2293,16 +2383,16 @@ describe('State Machine handler tests', function () {
|
|
|
2293
2383
|
messageType: 'ANSWER'
|
|
2294
2384
|
}
|
|
2295
2385
|
};
|
|
2296
|
-
|
|
2386
|
+
_context41.next = 1;
|
|
2297
2387
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
2298
2388
|
case 1:
|
|
2299
|
-
|
|
2389
|
+
_context41.next = 2;
|
|
2300
2390
|
return (0, _testUtil.flushPromises)(2);
|
|
2301
2391
|
case 2:
|
|
2302
|
-
|
|
2392
|
+
_context41.next = 3;
|
|
2303
2393
|
return _promise.default.resolve();
|
|
2304
2394
|
case 3:
|
|
2305
|
-
|
|
2395
|
+
_context41.next = 4;
|
|
2306
2396
|
return _promise.default.resolve();
|
|
2307
2397
|
case 4:
|
|
2308
2398
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
@@ -2320,14 +2410,14 @@ describe('State Machine handler tests', function () {
|
|
|
2320
2410
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
2321
2411
|
case 5:
|
|
2322
2412
|
case "end":
|
|
2323
|
-
return
|
|
2413
|
+
return _context41.stop();
|
|
2324
2414
|
}
|
|
2325
|
-
},
|
|
2415
|
+
}, _callee41);
|
|
2326
2416
|
})));
|
|
2327
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2417
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2328
2418
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2329
|
-
return _regenerator.default.wrap(function (
|
|
2330
|
-
while (1) switch (
|
|
2419
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2420
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2331
2421
|
case 0:
|
|
2332
2422
|
statusPayload = {
|
|
2333
2423
|
statusCode: 200,
|
|
@@ -2360,7 +2450,7 @@ describe('State Machine handler tests', function () {
|
|
|
2360
2450
|
seq: 1,
|
|
2361
2451
|
messageType: 'ANSWER'
|
|
2362
2452
|
};
|
|
2363
|
-
|
|
2453
|
+
_context42.next = 1;
|
|
2364
2454
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2365
2455
|
case 1:
|
|
2366
2456
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2382,7 +2472,7 @@ describe('State Machine handler tests', function () {
|
|
|
2382
2472
|
seq: 2,
|
|
2383
2473
|
messageType: 'OFFER_REQUEST'
|
|
2384
2474
|
};
|
|
2385
|
-
|
|
2475
|
+
_context42.next = 2;
|
|
2386
2476
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2387
2477
|
case 2:
|
|
2388
2478
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2432,7 +2522,7 @@ describe('State Machine handler tests', function () {
|
|
|
2432
2522
|
};
|
|
2433
2523
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2434
2524
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2435
|
-
|
|
2525
|
+
_context42.next = 3;
|
|
2436
2526
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2437
2527
|
case 3:
|
|
2438
2528
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2441,7 +2531,7 @@ describe('State Machine handler tests', function () {
|
|
|
2441
2531
|
seq: 3,
|
|
2442
2532
|
messageType: 'ANSWER'
|
|
2443
2533
|
};
|
|
2444
|
-
|
|
2534
|
+
_context42.next = 4;
|
|
2445
2535
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2446
2536
|
case 4:
|
|
2447
2537
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2460,7 +2550,7 @@ describe('State Machine handler tests', function () {
|
|
|
2460
2550
|
messageType: 'OK'
|
|
2461
2551
|
}
|
|
2462
2552
|
};
|
|
2463
|
-
|
|
2553
|
+
_context42.next = 5;
|
|
2464
2554
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2465
2555
|
case 5:
|
|
2466
2556
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2475,14 +2565,14 @@ describe('State Machine handler tests', function () {
|
|
|
2475
2565
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2476
2566
|
case 6:
|
|
2477
2567
|
case "end":
|
|
2478
|
-
return
|
|
2568
|
+
return _context42.stop();
|
|
2479
2569
|
}
|
|
2480
|
-
},
|
|
2570
|
+
}, _callee42);
|
|
2481
2571
|
})));
|
|
2482
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2572
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2483
2573
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2484
|
-
return _regenerator.default.wrap(function (
|
|
2485
|
-
while (1) switch (
|
|
2574
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2575
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2486
2576
|
case 0:
|
|
2487
2577
|
mockStatusBody = {
|
|
2488
2578
|
device: {
|
|
@@ -2522,7 +2612,7 @@ describe('State Machine handler tests', function () {
|
|
|
2522
2612
|
seq: 1,
|
|
2523
2613
|
messageType: 'ANSWER'
|
|
2524
2614
|
};
|
|
2525
|
-
|
|
2615
|
+
_context43.next = 1;
|
|
2526
2616
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2527
2617
|
case 1:
|
|
2528
2618
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2544,7 +2634,7 @@ describe('State Machine handler tests', function () {
|
|
|
2544
2634
|
seq: 2,
|
|
2545
2635
|
messageType: 'OFFER_REQUEST'
|
|
2546
2636
|
};
|
|
2547
|
-
|
|
2637
|
+
_context43.next = 2;
|
|
2548
2638
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2549
2639
|
case 2:
|
|
2550
2640
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2594,7 +2684,7 @@ describe('State Machine handler tests', function () {
|
|
|
2594
2684
|
};
|
|
2595
2685
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2596
2686
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2597
|
-
|
|
2687
|
+
_context43.next = 3;
|
|
2598
2688
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2599
2689
|
case 3:
|
|
2600
2690
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2603,7 +2693,7 @@ describe('State Machine handler tests', function () {
|
|
|
2603
2693
|
seq: 3,
|
|
2604
2694
|
messageType: 'ANSWER'
|
|
2605
2695
|
};
|
|
2606
|
-
|
|
2696
|
+
_context43.next = 4;
|
|
2607
2697
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2608
2698
|
case 4:
|
|
2609
2699
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2620,7 +2710,7 @@ describe('State Machine handler tests', function () {
|
|
|
2620
2710
|
}
|
|
2621
2711
|
};
|
|
2622
2712
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2623
|
-
|
|
2713
|
+
_context43.next = 5;
|
|
2624
2714
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2625
2715
|
case 5:
|
|
2626
2716
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2636,14 +2726,14 @@ describe('State Machine handler tests', function () {
|
|
|
2636
2726
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2637
2727
|
case 6:
|
|
2638
2728
|
case "end":
|
|
2639
|
-
return
|
|
2729
|
+
return _context43.stop();
|
|
2640
2730
|
}
|
|
2641
|
-
},
|
|
2731
|
+
}, _callee43);
|
|
2642
2732
|
})));
|
|
2643
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2733
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2644
2734
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2645
|
-
return _regenerator.default.wrap(function (
|
|
2646
|
-
while (1) switch (
|
|
2735
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2736
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2647
2737
|
case 0:
|
|
2648
2738
|
statusPayload = {
|
|
2649
2739
|
statusCode: 200,
|
|
@@ -2710,14 +2800,14 @@ describe('State Machine handler tests', function () {
|
|
|
2710
2800
|
});
|
|
2711
2801
|
case 1:
|
|
2712
2802
|
case "end":
|
|
2713
|
-
return
|
|
2803
|
+
return _context44.stop();
|
|
2714
2804
|
}
|
|
2715
|
-
},
|
|
2805
|
+
}, _callee44);
|
|
2716
2806
|
})));
|
|
2717
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2807
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2718
2808
|
var emitSpy, deleteSpy;
|
|
2719
|
-
return _regenerator.default.wrap(function (
|
|
2720
|
-
while (1) switch (
|
|
2809
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2810
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2721
2811
|
case 0:
|
|
2722
2812
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2723
2813
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2726,7 +2816,7 @@ describe('State Machine handler tests', function () {
|
|
|
2726
2816
|
call.sendCallStateMachineEvt({
|
|
2727
2817
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2728
2818
|
});
|
|
2729
|
-
|
|
2819
|
+
_context45.next = 1;
|
|
2730
2820
|
return (0, _testUtil.flushPromises)(1);
|
|
2731
2821
|
case 1:
|
|
2732
2822
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2734,9 +2824,9 @@ describe('State Machine handler tests', function () {
|
|
|
2734
2824
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2735
2825
|
case 2:
|
|
2736
2826
|
case "end":
|
|
2737
|
-
return
|
|
2827
|
+
return _context45.stop();
|
|
2738
2828
|
}
|
|
2739
|
-
},
|
|
2829
|
+
}, _callee45);
|
|
2740
2830
|
})));
|
|
2741
2831
|
describe('Call event timers tests', function () {
|
|
2742
2832
|
var callManager;
|
|
@@ -2747,10 +2837,10 @@ describe('State Machine handler tests', function () {
|
|
|
2747
2837
|
afterEach(function () {
|
|
2748
2838
|
jest.clearAllTimers();
|
|
2749
2839
|
});
|
|
2750
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2840
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2751
2841
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2752
|
-
return _regenerator.default.wrap(function (
|
|
2753
|
-
while (1) switch (
|
|
2842
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2843
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2754
2844
|
case 0:
|
|
2755
2845
|
statusPayload = {
|
|
2756
2846
|
statusCode: 200,
|
|
@@ -2767,7 +2857,7 @@ describe('State Machine handler tests', function () {
|
|
|
2767
2857
|
webex.request.mockReturnValue(statusPayload);
|
|
2768
2858
|
|
|
2769
2859
|
// handleOutgoingCallSetup is asynchronous
|
|
2770
|
-
|
|
2860
|
+
_context46.next = 1;
|
|
2771
2861
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2772
2862
|
case 1:
|
|
2773
2863
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2810,14 +2900,14 @@ describe('State Machine handler tests', function () {
|
|
|
2810
2900
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2811
2901
|
case 2:
|
|
2812
2902
|
case "end":
|
|
2813
|
-
return
|
|
2903
|
+
return _context46.stop();
|
|
2814
2904
|
}
|
|
2815
|
-
},
|
|
2905
|
+
}, _callee46);
|
|
2816
2906
|
})));
|
|
2817
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2907
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2818
2908
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2819
|
-
return _regenerator.default.wrap(function (
|
|
2820
|
-
while (1) switch (
|
|
2909
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2910
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2821
2911
|
case 0:
|
|
2822
2912
|
statusPayload = {
|
|
2823
2913
|
statusCode: 200,
|
|
@@ -2836,7 +2926,7 @@ describe('State Machine handler tests', function () {
|
|
|
2836
2926
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2837
2927
|
|
|
2838
2928
|
// handleOutgoingCallSetup is asynchronous
|
|
2839
|
-
|
|
2929
|
+
_context47.next = 1;
|
|
2840
2930
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2841
2931
|
case 1:
|
|
2842
2932
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2848,9 +2938,9 @@ describe('State Machine handler tests', function () {
|
|
|
2848
2938
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2849
2939
|
case 2:
|
|
2850
2940
|
case "end":
|
|
2851
|
-
return
|
|
2941
|
+
return _context47.stop();
|
|
2852
2942
|
}
|
|
2853
|
-
},
|
|
2943
|
+
}, _callee47);
|
|
2854
2944
|
})));
|
|
2855
2945
|
});
|
|
2856
2946
|
});
|
|
@@ -2915,10 +3005,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2915
3005
|
beforeEach(function () {
|
|
2916
3006
|
call.removeAllListeners();
|
|
2917
3007
|
});
|
|
2918
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3008
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2919
3009
|
var responsePayload, warnSpy, roapEvent;
|
|
2920
|
-
return _regenerator.default.wrap(function (
|
|
2921
|
-
while (1) switch (
|
|
3010
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
3011
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2922
3012
|
case 0:
|
|
2923
3013
|
expect.assertions(7);
|
|
2924
3014
|
responsePayload = {
|
|
@@ -2931,25 +3021,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2931
3021
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2932
3022
|
call['held'] = false;
|
|
2933
3023
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2934
|
-
var
|
|
2935
|
-
return _regenerator.default.wrap(function (
|
|
2936
|
-
while (1) switch (
|
|
3024
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(correlationId) {
|
|
3025
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
3026
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2937
3027
|
case 0:
|
|
2938
3028
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2939
3029
|
case 1:
|
|
2940
3030
|
case "end":
|
|
2941
|
-
return
|
|
3031
|
+
return _context48.stop();
|
|
2942
3032
|
}
|
|
2943
|
-
},
|
|
3033
|
+
}, _callee48);
|
|
2944
3034
|
}));
|
|
2945
|
-
return function (
|
|
2946
|
-
return
|
|
3035
|
+
return function (_x5) {
|
|
3036
|
+
return _ref58.apply(this, arguments);
|
|
2947
3037
|
};
|
|
2948
3038
|
}());
|
|
2949
|
-
|
|
3039
|
+
_context49.next = 1;
|
|
2950
3040
|
return call.doHoldResume();
|
|
2951
3041
|
case 1:
|
|
2952
|
-
|
|
3042
|
+
_context49.next = 2;
|
|
2953
3043
|
return (0, _testUtil.flushPromises)(2);
|
|
2954
3044
|
case 2:
|
|
2955
3045
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2965,11 +3055,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2965
3055
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2966
3056
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2967
3057
|
roapEvent.data.type = 'ANSWER';
|
|
2968
|
-
|
|
3058
|
+
_context49.next = 3;
|
|
2969
3059
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2970
3060
|
case 3:
|
|
2971
3061
|
roapEvent.data.type = 'OK';
|
|
2972
|
-
|
|
3062
|
+
_context49.next = 4;
|
|
2973
3063
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2974
3064
|
case 4:
|
|
2975
3065
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2984,14 +3074,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2984
3074
|
});
|
|
2985
3075
|
case 5:
|
|
2986
3076
|
case "end":
|
|
2987
|
-
return
|
|
3077
|
+
return _context49.stop();
|
|
2988
3078
|
}
|
|
2989
|
-
},
|
|
3079
|
+
}, _callee49);
|
|
2990
3080
|
})));
|
|
2991
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3081
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2992
3082
|
var responsePayload, warnSpy, roapEvent;
|
|
2993
|
-
return _regenerator.default.wrap(function (
|
|
2994
|
-
while (1) switch (
|
|
3083
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
3084
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2995
3085
|
case 0:
|
|
2996
3086
|
expect.assertions(8);
|
|
2997
3087
|
responsePayload = {
|
|
@@ -3004,26 +3094,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3004
3094
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3005
3095
|
call['held'] = false;
|
|
3006
3096
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
3007
|
-
var
|
|
3008
|
-
return _regenerator.default.wrap(function (
|
|
3009
|
-
while (1) switch (
|
|
3097
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(correlationId) {
|
|
3098
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
3099
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
3010
3100
|
case 0:
|
|
3011
3101
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3012
3102
|
case 1:
|
|
3013
3103
|
case "end":
|
|
3014
|
-
return
|
|
3104
|
+
return _context50.stop();
|
|
3015
3105
|
}
|
|
3016
|
-
},
|
|
3106
|
+
}, _callee50);
|
|
3017
3107
|
}));
|
|
3018
|
-
return function (
|
|
3019
|
-
return
|
|
3108
|
+
return function (_x6) {
|
|
3109
|
+
return _ref60.apply(this, arguments);
|
|
3020
3110
|
};
|
|
3021
3111
|
}());
|
|
3022
3112
|
call.doHoldResume();
|
|
3023
|
-
|
|
3113
|
+
_context51.next = 1;
|
|
3024
3114
|
return _promise.default.resolve();
|
|
3025
3115
|
case 1:
|
|
3026
|
-
|
|
3116
|
+
_context51.next = 2;
|
|
3027
3117
|
return _promise.default.resolve();
|
|
3028
3118
|
case 2:
|
|
3029
3119
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3039,11 +3129,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3039
3129
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3040
3130
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3041
3131
|
roapEvent.data.type = 'ANSWER';
|
|
3042
|
-
|
|
3132
|
+
_context51.next = 3;
|
|
3043
3133
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3044
3134
|
case 3:
|
|
3045
3135
|
roapEvent.data.type = 'OK';
|
|
3046
|
-
|
|
3136
|
+
_context51.next = 4;
|
|
3047
3137
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3048
3138
|
case 4:
|
|
3049
3139
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3058,14 +3148,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3058
3148
|
});
|
|
3059
3149
|
case 5:
|
|
3060
3150
|
case "end":
|
|
3061
|
-
return
|
|
3151
|
+
return _context51.stop();
|
|
3062
3152
|
}
|
|
3063
|
-
},
|
|
3153
|
+
}, _callee51);
|
|
3064
3154
|
})));
|
|
3065
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3155
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
3066
3156
|
var responsePayload;
|
|
3067
|
-
return _regenerator.default.wrap(function (
|
|
3068
|
-
while (1) switch (
|
|
3157
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
3158
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
3069
3159
|
case 0:
|
|
3070
3160
|
expect.assertions(4);
|
|
3071
3161
|
responsePayload = {
|
|
@@ -3075,26 +3165,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3075
3165
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3076
3166
|
call['held'] = false;
|
|
3077
3167
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
3078
|
-
var
|
|
3079
|
-
return _regenerator.default.wrap(function (
|
|
3080
|
-
while (1) switch (
|
|
3168
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
|
|
3169
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
3170
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
3081
3171
|
case 0:
|
|
3082
3172
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3083
3173
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3084
3174
|
case 1:
|
|
3085
3175
|
case "end":
|
|
3086
|
-
return
|
|
3176
|
+
return _context52.stop();
|
|
3087
3177
|
}
|
|
3088
|
-
},
|
|
3178
|
+
}, _callee52);
|
|
3089
3179
|
}));
|
|
3090
|
-
return function (
|
|
3091
|
-
return
|
|
3180
|
+
return function (_x7) {
|
|
3181
|
+
return _ref62.apply(this, arguments);
|
|
3092
3182
|
};
|
|
3093
3183
|
}());
|
|
3094
|
-
|
|
3184
|
+
_context53.next = 1;
|
|
3095
3185
|
return call.doHoldResume();
|
|
3096
3186
|
case 1:
|
|
3097
|
-
|
|
3187
|
+
_context53.next = 2;
|
|
3098
3188
|
return (0, _testUtil.flushPromises)(2);
|
|
3099
3189
|
case 2:
|
|
3100
3190
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3104,14 +3194,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3104
3194
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3105
3195
|
case 3:
|
|
3106
3196
|
case "end":
|
|
3107
|
-
return
|
|
3197
|
+
return _context53.stop();
|
|
3108
3198
|
}
|
|
3109
|
-
},
|
|
3199
|
+
}, _callee53);
|
|
3110
3200
|
})));
|
|
3111
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3201
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
3112
3202
|
var responsePayload, rejectPayload, roapEvent;
|
|
3113
|
-
return _regenerator.default.wrap(function (
|
|
3114
|
-
while (1) switch (
|
|
3203
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
3204
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
3115
3205
|
case 0:
|
|
3116
3206
|
expect.assertions(5);
|
|
3117
3207
|
responsePayload = {
|
|
@@ -3125,24 +3215,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3125
3215
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3126
3216
|
call['held'] = false;
|
|
3127
3217
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
3128
|
-
var
|
|
3129
|
-
return _regenerator.default.wrap(function (
|
|
3130
|
-
while (1) switch (
|
|
3218
|
+
var _ref64 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
|
|
3219
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
3220
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
3131
3221
|
case 0:
|
|
3132
3222
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3133
3223
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3134
3224
|
case 1:
|
|
3135
3225
|
case "end":
|
|
3136
|
-
return
|
|
3226
|
+
return _context54.stop();
|
|
3137
3227
|
}
|
|
3138
|
-
},
|
|
3228
|
+
}, _callee54);
|
|
3139
3229
|
}));
|
|
3140
|
-
return function (
|
|
3141
|
-
return
|
|
3230
|
+
return function (_x8) {
|
|
3231
|
+
return _ref64.apply(this, arguments);
|
|
3142
3232
|
};
|
|
3143
3233
|
}());
|
|
3144
3234
|
call.doHoldResume();
|
|
3145
|
-
|
|
3235
|
+
_context55.next = 1;
|
|
3146
3236
|
return (0, _testUtil.flushPromises)(2);
|
|
3147
3237
|
case 1:
|
|
3148
3238
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3152,7 +3242,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3152
3242
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3153
3243
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3154
3244
|
roapEvent.data.type = 'ANSWER';
|
|
3155
|
-
|
|
3245
|
+
_context55.next = 2;
|
|
3156
3246
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3157
3247
|
case 2:
|
|
3158
3248
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3160,14 +3250,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3160
3250
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3161
3251
|
case 3:
|
|
3162
3252
|
case "end":
|
|
3163
|
-
return
|
|
3253
|
+
return _context55.stop();
|
|
3164
3254
|
}
|
|
3165
|
-
},
|
|
3255
|
+
}, _callee55);
|
|
3166
3256
|
})));
|
|
3167
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3257
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
3168
3258
|
var responsePayload, warnSpy, roapEvent;
|
|
3169
|
-
return _regenerator.default.wrap(function (
|
|
3170
|
-
while (1) switch (
|
|
3259
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3260
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
3171
3261
|
case 0:
|
|
3172
3262
|
responsePayload = {
|
|
3173
3263
|
statusCode: 200,
|
|
@@ -3178,10 +3268,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3178
3268
|
jest.spyOn(global, 'clearTimeout');
|
|
3179
3269
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3180
3270
|
call['held'] = false;
|
|
3181
|
-
|
|
3271
|
+
_context56.next = 1;
|
|
3182
3272
|
return call.doHoldResume();
|
|
3183
3273
|
case 1:
|
|
3184
|
-
|
|
3274
|
+
_context56.next = 2;
|
|
3185
3275
|
return (0, _testUtil.flushPromises)(2);
|
|
3186
3276
|
case 2:
|
|
3187
3277
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3196,19 +3286,19 @@ describe('Supplementary Services tests', function () {
|
|
|
3196
3286
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3197
3287
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3198
3288
|
roapEvent.data.type = 'ANSWER';
|
|
3199
|
-
|
|
3289
|
+
_context56.next = 3;
|
|
3200
3290
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3201
3291
|
case 3:
|
|
3202
3292
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
3203
3293
|
statusCode: 403
|
|
3204
3294
|
});
|
|
3205
3295
|
roapEvent.data.type = 'OK';
|
|
3206
|
-
|
|
3296
|
+
_context56.next = 4;
|
|
3207
3297
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3208
3298
|
case 4:
|
|
3209
3299
|
/* this is for coverage */
|
|
3210
3300
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
3211
|
-
|
|
3301
|
+
_context56.next = 5;
|
|
3212
3302
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3213
3303
|
case 5:
|
|
3214
3304
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3220,14 +3310,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3220
3310
|
});
|
|
3221
3311
|
case 6:
|
|
3222
3312
|
case "end":
|
|
3223
|
-
return
|
|
3313
|
+
return _context56.stop();
|
|
3224
3314
|
}
|
|
3225
|
-
},
|
|
3315
|
+
}, _callee56);
|
|
3226
3316
|
})));
|
|
3227
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3317
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
3228
3318
|
var responsePayload, warnSpy, roapEvent;
|
|
3229
|
-
return _regenerator.default.wrap(function (
|
|
3230
|
-
while (1) switch (
|
|
3319
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3320
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
3231
3321
|
case 0:
|
|
3232
3322
|
responsePayload = {
|
|
3233
3323
|
statusCode: 200,
|
|
@@ -3238,10 +3328,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3238
3328
|
jest.spyOn(global, 'clearTimeout');
|
|
3239
3329
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3240
3330
|
call['held'] = true;
|
|
3241
|
-
|
|
3331
|
+
_context57.next = 1;
|
|
3242
3332
|
return call.doHoldResume();
|
|
3243
3333
|
case 1:
|
|
3244
|
-
|
|
3334
|
+
_context57.next = 2;
|
|
3245
3335
|
return (0, _testUtil.flushPromises)(2);
|
|
3246
3336
|
case 2:
|
|
3247
3337
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3256,14 +3346,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3256
3346
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3257
3347
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3258
3348
|
roapEvent.data.type = 'ANSWER';
|
|
3259
|
-
|
|
3349
|
+
_context57.next = 3;
|
|
3260
3350
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3261
3351
|
case 3:
|
|
3262
3352
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
3263
3353
|
statusCode: 403
|
|
3264
3354
|
});
|
|
3265
3355
|
roapEvent.data.type = 'OK';
|
|
3266
|
-
|
|
3356
|
+
_context57.next = 4;
|
|
3267
3357
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3268
3358
|
case 4:
|
|
3269
3359
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3275,14 +3365,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3275
3365
|
});
|
|
3276
3366
|
case 5:
|
|
3277
3367
|
case "end":
|
|
3278
|
-
return
|
|
3368
|
+
return _context57.stop();
|
|
3279
3369
|
}
|
|
3280
|
-
},
|
|
3370
|
+
}, _callee57);
|
|
3281
3371
|
})));
|
|
3282
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3372
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
3283
3373
|
var responsePayload, roapEvent;
|
|
3284
|
-
return _regenerator.default.wrap(function (
|
|
3285
|
-
while (1) switch (
|
|
3374
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3375
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3286
3376
|
case 0:
|
|
3287
3377
|
expect.assertions(5);
|
|
3288
3378
|
responsePayload = {
|
|
@@ -3292,25 +3382,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3292
3382
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3293
3383
|
call['held'] = false;
|
|
3294
3384
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
3295
|
-
var
|
|
3296
|
-
return _regenerator.default.wrap(function (
|
|
3297
|
-
while (1) switch (
|
|
3385
|
+
var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(errObj) {
|
|
3386
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3387
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
3298
3388
|
case 0:
|
|
3299
3389
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3300
3390
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
3301
3391
|
case 1:
|
|
3302
3392
|
case "end":
|
|
3303
|
-
return
|
|
3393
|
+
return _context58.stop();
|
|
3304
3394
|
}
|
|
3305
|
-
},
|
|
3395
|
+
}, _callee58);
|
|
3306
3396
|
}));
|
|
3307
|
-
return function (
|
|
3308
|
-
return
|
|
3397
|
+
return function (_x9) {
|
|
3398
|
+
return _ref68.apply(this, arguments);
|
|
3309
3399
|
};
|
|
3310
3400
|
}());
|
|
3311
3401
|
jest.runAllTimers();
|
|
3312
3402
|
call.doHoldResume();
|
|
3313
|
-
|
|
3403
|
+
_context59.next = 1;
|
|
3314
3404
|
return (0, _testUtil.flushPromises)(2);
|
|
3315
3405
|
case 1:
|
|
3316
3406
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -3323,11 +3413,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3323
3413
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3324
3414
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3325
3415
|
roapEvent.data.type = 'ANSWER';
|
|
3326
|
-
|
|
3416
|
+
_context59.next = 2;
|
|
3327
3417
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3328
3418
|
case 2:
|
|
3329
3419
|
roapEvent.data.type = 'OK';
|
|
3330
|
-
|
|
3420
|
+
_context59.next = 3;
|
|
3331
3421
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3332
3422
|
case 3:
|
|
3333
3423
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3339,14 +3429,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3339
3429
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3340
3430
|
case 4:
|
|
3341
3431
|
case "end":
|
|
3342
|
-
return
|
|
3432
|
+
return _context59.stop();
|
|
3343
3433
|
}
|
|
3344
|
-
},
|
|
3434
|
+
}, _callee59);
|
|
3345
3435
|
})));
|
|
3346
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3436
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
3347
3437
|
var responsePayload, warnSpy, roapEvent;
|
|
3348
|
-
return _regenerator.default.wrap(function (
|
|
3349
|
-
while (1) switch (
|
|
3438
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3439
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3350
3440
|
case 0:
|
|
3351
3441
|
expect.assertions(7);
|
|
3352
3442
|
responsePayload = {
|
|
@@ -3359,25 +3449,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3359
3449
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3360
3450
|
call['held'] = true;
|
|
3361
3451
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3362
|
-
var
|
|
3363
|
-
return _regenerator.default.wrap(function (
|
|
3364
|
-
while (1) switch (
|
|
3452
|
+
var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
|
|
3453
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3454
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3365
3455
|
case 0:
|
|
3366
3456
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3367
3457
|
case 1:
|
|
3368
3458
|
case "end":
|
|
3369
|
-
return
|
|
3459
|
+
return _context60.stop();
|
|
3370
3460
|
}
|
|
3371
|
-
},
|
|
3461
|
+
}, _callee60);
|
|
3372
3462
|
}));
|
|
3373
|
-
return function (
|
|
3374
|
-
return
|
|
3463
|
+
return function (_x0) {
|
|
3464
|
+
return _ref70.apply(this, arguments);
|
|
3375
3465
|
};
|
|
3376
3466
|
}());
|
|
3377
|
-
|
|
3467
|
+
_context61.next = 1;
|
|
3378
3468
|
return call.doHoldResume();
|
|
3379
3469
|
case 1:
|
|
3380
|
-
|
|
3470
|
+
_context61.next = 2;
|
|
3381
3471
|
return (0, _testUtil.flushPromises)(2);
|
|
3382
3472
|
case 2:
|
|
3383
3473
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3393,11 +3483,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3393
3483
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3394
3484
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3395
3485
|
roapEvent.data.type = 'ANSWER';
|
|
3396
|
-
|
|
3486
|
+
_context61.next = 3;
|
|
3397
3487
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3398
3488
|
case 3:
|
|
3399
3489
|
roapEvent.data.type = 'OK';
|
|
3400
|
-
|
|
3490
|
+
_context61.next = 4;
|
|
3401
3491
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3402
3492
|
case 4:
|
|
3403
3493
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3412,14 +3502,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3412
3502
|
});
|
|
3413
3503
|
case 5:
|
|
3414
3504
|
case "end":
|
|
3415
|
-
return
|
|
3505
|
+
return _context61.stop();
|
|
3416
3506
|
}
|
|
3417
|
-
},
|
|
3507
|
+
}, _callee61);
|
|
3418
3508
|
})));
|
|
3419
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3509
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
3420
3510
|
var responsePayload, warnSpy, roapEvent;
|
|
3421
|
-
return _regenerator.default.wrap(function (
|
|
3422
|
-
while (1) switch (
|
|
3511
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3512
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3423
3513
|
case 0:
|
|
3424
3514
|
expect.assertions(7);
|
|
3425
3515
|
responsePayload = {
|
|
@@ -3432,26 +3522,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3432
3522
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3433
3523
|
call['held'] = true;
|
|
3434
3524
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3435
|
-
var
|
|
3436
|
-
return _regenerator.default.wrap(function (
|
|
3437
|
-
while (1) switch (
|
|
3525
|
+
var _ref72 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(correlationId) {
|
|
3526
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3527
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3438
3528
|
case 0:
|
|
3439
3529
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3440
3530
|
case 1:
|
|
3441
3531
|
case "end":
|
|
3442
|
-
return
|
|
3532
|
+
return _context62.stop();
|
|
3443
3533
|
}
|
|
3444
|
-
},
|
|
3534
|
+
}, _callee62);
|
|
3445
3535
|
}));
|
|
3446
|
-
return function (
|
|
3447
|
-
return
|
|
3536
|
+
return function (_x1) {
|
|
3537
|
+
return _ref72.apply(this, arguments);
|
|
3448
3538
|
};
|
|
3449
3539
|
}());
|
|
3450
3540
|
call.doHoldResume();
|
|
3451
|
-
|
|
3541
|
+
_context63.next = 1;
|
|
3452
3542
|
return _promise.default.resolve();
|
|
3453
3543
|
case 1:
|
|
3454
|
-
|
|
3544
|
+
_context63.next = 2;
|
|
3455
3545
|
return _promise.default.resolve();
|
|
3456
3546
|
case 2:
|
|
3457
3547
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3467,11 +3557,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3467
3557
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3468
3558
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3469
3559
|
roapEvent.data.type = 'ANSWER';
|
|
3470
|
-
|
|
3560
|
+
_context63.next = 3;
|
|
3471
3561
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3472
3562
|
case 3:
|
|
3473
3563
|
roapEvent.data.type = 'OK';
|
|
3474
|
-
|
|
3564
|
+
_context63.next = 4;
|
|
3475
3565
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3476
3566
|
case 4:
|
|
3477
3567
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3486,14 +3576,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3486
3576
|
});
|
|
3487
3577
|
case 5:
|
|
3488
3578
|
case "end":
|
|
3489
|
-
return
|
|
3579
|
+
return _context63.stop();
|
|
3490
3580
|
}
|
|
3491
|
-
},
|
|
3581
|
+
}, _callee63);
|
|
3492
3582
|
})));
|
|
3493
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3583
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3494
3584
|
var responsePayload;
|
|
3495
|
-
return _regenerator.default.wrap(function (
|
|
3496
|
-
while (1) switch (
|
|
3585
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3586
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3497
3587
|
case 0:
|
|
3498
3588
|
expect.assertions(4);
|
|
3499
3589
|
responsePayload = {
|
|
@@ -3503,26 +3593,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3503
3593
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3504
3594
|
call['held'] = true;
|
|
3505
3595
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3506
|
-
var
|
|
3507
|
-
return _regenerator.default.wrap(function (
|
|
3508
|
-
while (1) switch (
|
|
3596
|
+
var _ref74 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(errObj) {
|
|
3597
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3598
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3509
3599
|
case 0:
|
|
3510
3600
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3511
3601
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3512
3602
|
case 1:
|
|
3513
3603
|
case "end":
|
|
3514
|
-
return
|
|
3604
|
+
return _context64.stop();
|
|
3515
3605
|
}
|
|
3516
|
-
},
|
|
3606
|
+
}, _callee64);
|
|
3517
3607
|
}));
|
|
3518
|
-
return function (
|
|
3519
|
-
return
|
|
3608
|
+
return function (_x10) {
|
|
3609
|
+
return _ref74.apply(this, arguments);
|
|
3520
3610
|
};
|
|
3521
3611
|
}());
|
|
3522
|
-
|
|
3612
|
+
_context65.next = 1;
|
|
3523
3613
|
return call.doHoldResume();
|
|
3524
3614
|
case 1:
|
|
3525
|
-
|
|
3615
|
+
_context65.next = 2;
|
|
3526
3616
|
return (0, _testUtil.flushPromises)(2);
|
|
3527
3617
|
case 2:
|
|
3528
3618
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3533,14 +3623,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3533
3623
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3534
3624
|
case 3:
|
|
3535
3625
|
case "end":
|
|
3536
|
-
return
|
|
3626
|
+
return _context65.stop();
|
|
3537
3627
|
}
|
|
3538
|
-
},
|
|
3628
|
+
}, _callee65);
|
|
3539
3629
|
})));
|
|
3540
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3630
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3541
3631
|
var responsePayload, rejectPayload, roapEvent;
|
|
3542
|
-
return _regenerator.default.wrap(function (
|
|
3543
|
-
while (1) switch (
|
|
3632
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3633
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3544
3634
|
case 0:
|
|
3545
3635
|
expect.assertions(5);
|
|
3546
3636
|
responsePayload = {
|
|
@@ -3554,24 +3644,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3554
3644
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3555
3645
|
call['held'] = true;
|
|
3556
3646
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3557
|
-
var
|
|
3558
|
-
return _regenerator.default.wrap(function (
|
|
3559
|
-
while (1) switch (
|
|
3647
|
+
var _ref76 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(errObj) {
|
|
3648
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3649
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3560
3650
|
case 0:
|
|
3561
3651
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3562
3652
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3563
3653
|
case 1:
|
|
3564
3654
|
case "end":
|
|
3565
|
-
return
|
|
3655
|
+
return _context66.stop();
|
|
3566
3656
|
}
|
|
3567
|
-
},
|
|
3657
|
+
}, _callee66);
|
|
3568
3658
|
}));
|
|
3569
|
-
return function (
|
|
3570
|
-
return
|
|
3659
|
+
return function (_x11) {
|
|
3660
|
+
return _ref76.apply(this, arguments);
|
|
3571
3661
|
};
|
|
3572
3662
|
}());
|
|
3573
3663
|
call.doHoldResume();
|
|
3574
|
-
|
|
3664
|
+
_context67.next = 1;
|
|
3575
3665
|
return (0, _testUtil.flushPromises)(2);
|
|
3576
3666
|
case 1:
|
|
3577
3667
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3582,7 +3672,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3582
3672
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3583
3673
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3584
3674
|
roapEvent.data.type = 'ANSWER';
|
|
3585
|
-
|
|
3675
|
+
_context67.next = 2;
|
|
3586
3676
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3587
3677
|
case 2:
|
|
3588
3678
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3590,14 +3680,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3590
3680
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3591
3681
|
case 3:
|
|
3592
3682
|
case "end":
|
|
3593
|
-
return
|
|
3683
|
+
return _context67.stop();
|
|
3594
3684
|
}
|
|
3595
|
-
},
|
|
3685
|
+
}, _callee67);
|
|
3596
3686
|
})));
|
|
3597
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3687
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
|
|
3598
3688
|
var responsePayload, roapEvent;
|
|
3599
|
-
return _regenerator.default.wrap(function (
|
|
3600
|
-
while (1) switch (
|
|
3689
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3690
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3601
3691
|
case 0:
|
|
3602
3692
|
expect.assertions(5);
|
|
3603
3693
|
responsePayload = {
|
|
@@ -3607,24 +3697,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3607
3697
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3608
3698
|
call['held'] = true;
|
|
3609
3699
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3610
|
-
var
|
|
3611
|
-
return _regenerator.default.wrap(function (
|
|
3612
|
-
while (1) switch (
|
|
3700
|
+
var _ref78 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(errObj) {
|
|
3701
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3702
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3613
3703
|
case 0:
|
|
3614
3704
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3615
3705
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3616
3706
|
case 1:
|
|
3617
3707
|
case "end":
|
|
3618
|
-
return
|
|
3708
|
+
return _context68.stop();
|
|
3619
3709
|
}
|
|
3620
|
-
},
|
|
3710
|
+
}, _callee68);
|
|
3621
3711
|
}));
|
|
3622
|
-
return function (
|
|
3623
|
-
return
|
|
3712
|
+
return function (_x12) {
|
|
3713
|
+
return _ref78.apply(this, arguments);
|
|
3624
3714
|
};
|
|
3625
3715
|
}());
|
|
3626
3716
|
call.doHoldResume();
|
|
3627
|
-
|
|
3717
|
+
_context69.next = 1;
|
|
3628
3718
|
return (0, _testUtil.flushPromises)(2);
|
|
3629
3719
|
case 1:
|
|
3630
3720
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3637,11 +3727,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3637
3727
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3638
3728
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3639
3729
|
roapEvent.data.type = 'ANSWER';
|
|
3640
|
-
|
|
3730
|
+
_context69.next = 2;
|
|
3641
3731
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3642
3732
|
case 2:
|
|
3643
3733
|
roapEvent.data.type = 'OK';
|
|
3644
|
-
|
|
3734
|
+
_context69.next = 3;
|
|
3645
3735
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3646
3736
|
case 3:
|
|
3647
3737
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3651,9 +3741,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3651
3741
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3652
3742
|
case 4:
|
|
3653
3743
|
case "end":
|
|
3654
|
-
return
|
|
3744
|
+
return _context69.stop();
|
|
3655
3745
|
}
|
|
3656
|
-
},
|
|
3746
|
+
}, _callee69);
|
|
3657
3747
|
})));
|
|
3658
3748
|
});
|
|
3659
3749
|
describe('Call transfer tests', function () {
|
|
@@ -3686,10 +3776,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3686
3776
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3687
3777
|
secondCall['held'] = false;
|
|
3688
3778
|
});
|
|
3689
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3779
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3690
3780
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3691
|
-
return _regenerator.default.wrap(function (
|
|
3692
|
-
while (1) switch (
|
|
3781
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3782
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3693
3783
|
case 0:
|
|
3694
3784
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3695
3785
|
responsePayload = {
|
|
@@ -3701,41 +3791,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3701
3791
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3702
3792
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3703
3793
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3704
|
-
var
|
|
3705
|
-
return _regenerator.default.wrap(function (
|
|
3706
|
-
while (1) switch (
|
|
3794
|
+
var _ref80 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70(correlationId) {
|
|
3795
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3796
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3707
3797
|
case 0:
|
|
3708
3798
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3709
3799
|
case 1:
|
|
3710
3800
|
case "end":
|
|
3711
|
-
return
|
|
3801
|
+
return _context70.stop();
|
|
3712
3802
|
}
|
|
3713
|
-
},
|
|
3803
|
+
}, _callee70);
|
|
3714
3804
|
}));
|
|
3715
|
-
return function (
|
|
3716
|
-
return
|
|
3805
|
+
return function (_x13) {
|
|
3806
|
+
return _ref80.apply(this, arguments);
|
|
3717
3807
|
};
|
|
3718
3808
|
}());
|
|
3719
3809
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3720
|
-
var
|
|
3721
|
-
return _regenerator.default.wrap(function (
|
|
3722
|
-
while (1) switch (
|
|
3810
|
+
var _ref81 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71(correlationId) {
|
|
3811
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3812
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3723
3813
|
case 0:
|
|
3724
3814
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3725
3815
|
case 1:
|
|
3726
3816
|
case "end":
|
|
3727
|
-
return
|
|
3817
|
+
return _context71.stop();
|
|
3728
3818
|
}
|
|
3729
|
-
},
|
|
3819
|
+
}, _callee71);
|
|
3730
3820
|
}));
|
|
3731
|
-
return function (
|
|
3732
|
-
return
|
|
3821
|
+
return function (_x14) {
|
|
3822
|
+
return _ref81.apply(this, arguments);
|
|
3733
3823
|
};
|
|
3734
3824
|
}());
|
|
3735
|
-
|
|
3825
|
+
_context72.next = 1;
|
|
3736
3826
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3737
3827
|
case 1:
|
|
3738
|
-
|
|
3828
|
+
_context72.next = 2;
|
|
3739
3829
|
return (0, _testUtil.flushPromises)(2);
|
|
3740
3830
|
case 2:
|
|
3741
3831
|
expect(requestSpy).toBeCalled();
|
|
@@ -3758,14 +3848,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3758
3848
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3759
3849
|
case 3:
|
|
3760
3850
|
case "end":
|
|
3761
|
-
return
|
|
3851
|
+
return _context72.stop();
|
|
3762
3852
|
}
|
|
3763
|
-
},
|
|
3853
|
+
}, _callee72);
|
|
3764
3854
|
})));
|
|
3765
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3855
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3766
3856
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3767
|
-
return _regenerator.default.wrap(function (
|
|
3768
|
-
while (1) switch (
|
|
3857
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3858
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3769
3859
|
case 0:
|
|
3770
3860
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3771
3861
|
responsePayload = {
|
|
@@ -3777,25 +3867,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3777
3867
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3778
3868
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3779
3869
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3780
|
-
var
|
|
3781
|
-
return _regenerator.default.wrap(function (
|
|
3782
|
-
while (1) switch (
|
|
3870
|
+
var _ref83 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73(correlationId) {
|
|
3871
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3872
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3783
3873
|
case 0:
|
|
3784
3874
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3785
3875
|
case 1:
|
|
3786
3876
|
case "end":
|
|
3787
|
-
return
|
|
3877
|
+
return _context73.stop();
|
|
3788
3878
|
}
|
|
3789
|
-
},
|
|
3879
|
+
}, _callee73);
|
|
3790
3880
|
}));
|
|
3791
|
-
return function (
|
|
3792
|
-
return
|
|
3881
|
+
return function (_x15) {
|
|
3882
|
+
return _ref83.apply(this, arguments);
|
|
3793
3883
|
};
|
|
3794
3884
|
}());
|
|
3795
|
-
|
|
3885
|
+
_context74.next = 1;
|
|
3796
3886
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3797
3887
|
case 1:
|
|
3798
|
-
|
|
3888
|
+
_context74.next = 2;
|
|
3799
3889
|
return (0, _testUtil.flushPromises)(2);
|
|
3800
3890
|
case 2:
|
|
3801
3891
|
expect(requestSpy).toBeCalled();
|
|
@@ -3814,14 +3904,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3814
3904
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3815
3905
|
case 3:
|
|
3816
3906
|
case "end":
|
|
3817
|
-
return
|
|
3907
|
+
return _context74.stop();
|
|
3818
3908
|
}
|
|
3819
|
-
},
|
|
3909
|
+
}, _callee74);
|
|
3820
3910
|
})));
|
|
3821
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3911
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
|
|
3822
3912
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3823
|
-
return _regenerator.default.wrap(function (
|
|
3824
|
-
while (1) switch (
|
|
3913
|
+
return _regenerator.default.wrap(function (_context75) {
|
|
3914
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
3825
3915
|
case 0:
|
|
3826
3916
|
responsePayload = {
|
|
3827
3917
|
statusCode: 403,
|
|
@@ -3832,10 +3922,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3832
3922
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3833
3923
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3834
3924
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3835
|
-
|
|
3925
|
+
_context75.next = 1;
|
|
3836
3926
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3837
3927
|
case 1:
|
|
3838
|
-
|
|
3928
|
+
_context75.next = 2;
|
|
3839
3929
|
return (0, _testUtil.flushPromises)(1);
|
|
3840
3930
|
case 2:
|
|
3841
3931
|
expect(requestSpy).toBeCalled();
|
|
@@ -3856,14 +3946,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3856
3946
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3857
3947
|
case 3:
|
|
3858
3948
|
case "end":
|
|
3859
|
-
return
|
|
3949
|
+
return _context75.stop();
|
|
3860
3950
|
}
|
|
3861
|
-
},
|
|
3951
|
+
}, _callee75);
|
|
3862
3952
|
})));
|
|
3863
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3953
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee76() {
|
|
3864
3954
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3865
|
-
return _regenerator.default.wrap(function (
|
|
3866
|
-
while (1) switch (
|
|
3955
|
+
return _regenerator.default.wrap(function (_context76) {
|
|
3956
|
+
while (1) switch (_context76.prev = _context76.next) {
|
|
3867
3957
|
case 0:
|
|
3868
3958
|
responsePayload = {
|
|
3869
3959
|
statusCode: 403,
|
|
@@ -3873,10 +3963,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3873
3963
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3874
3964
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3875
3965
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3876
|
-
|
|
3966
|
+
_context76.next = 1;
|
|
3877
3967
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3878
3968
|
case 1:
|
|
3879
|
-
|
|
3969
|
+
_context76.next = 2;
|
|
3880
3970
|
return (0, _testUtil.flushPromises)(2);
|
|
3881
3971
|
case 2:
|
|
3882
3972
|
expect(requestSpy).toBeCalled();
|
|
@@ -3897,18 +3987,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3897
3987
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3898
3988
|
case 3:
|
|
3899
3989
|
case "end":
|
|
3900
|
-
return
|
|
3990
|
+
return _context76.stop();
|
|
3901
3991
|
}
|
|
3902
|
-
},
|
|
3992
|
+
}, _callee76);
|
|
3903
3993
|
})));
|
|
3904
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3994
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee77() {
|
|
3905
3995
|
var requestSpy, warnSpy;
|
|
3906
|
-
return _regenerator.default.wrap(function (
|
|
3907
|
-
while (1) switch (
|
|
3996
|
+
return _regenerator.default.wrap(function (_context77) {
|
|
3997
|
+
while (1) switch (_context77.prev = _context77.next) {
|
|
3908
3998
|
case 0:
|
|
3909
3999
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3910
4000
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3911
|
-
|
|
4001
|
+
_context77.next = 1;
|
|
3912
4002
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3913
4003
|
case 1:
|
|
3914
4004
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3920,18 +4010,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3920
4010
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3921
4011
|
case 2:
|
|
3922
4012
|
case "end":
|
|
3923
|
-
return
|
|
4013
|
+
return _context77.stop();
|
|
3924
4014
|
}
|
|
3925
|
-
},
|
|
4015
|
+
}, _callee77);
|
|
3926
4016
|
})));
|
|
3927
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
4017
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee78() {
|
|
3928
4018
|
var requestSpy, warnSpy;
|
|
3929
|
-
return _regenerator.default.wrap(function (
|
|
3930
|
-
while (1) switch (
|
|
4019
|
+
return _regenerator.default.wrap(function (_context78) {
|
|
4020
|
+
while (1) switch (_context78.prev = _context78.next) {
|
|
3931
4021
|
case 0:
|
|
3932
4022
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3933
4023
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3934
|
-
|
|
4024
|
+
_context78.next = 1;
|
|
3935
4025
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3936
4026
|
case 1:
|
|
3937
4027
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3943,9 +4033,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3943
4033
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3944
4034
|
case 2:
|
|
3945
4035
|
case "end":
|
|
3946
|
-
return
|
|
4036
|
+
return _context78.stop();
|
|
3947
4037
|
}
|
|
3948
|
-
},
|
|
4038
|
+
}, _callee78);
|
|
3949
4039
|
})));
|
|
3950
4040
|
});
|
|
3951
4041
|
});
|