@webex/calling 3.12.0-next.95 → 3.12.0-next.97
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/CallingClient/calling/call.js +1 -1
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +545 -513
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/module/CallingClient/calling/call.js +3 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -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,35 +300,64 @@ describe('Call Tests', function () {
|
|
|
297
300
|
}
|
|
298
301
|
}, _callee3);
|
|
299
302
|
})));
|
|
300
|
-
it('
|
|
301
|
-
var call;
|
|
303
|
+
it('delete sends the server-assigned callId unchanged', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
304
|
+
var serverCallId, call;
|
|
302
305
|
return _regenerator.default.wrap(function (_context4) {
|
|
303
306
|
while (1) switch (_context4.prev = _context4.next) {
|
|
304
307
|
case 0:
|
|
308
|
+
serverCallId = '8a67806f-fc4d-446b-a131-31e71ea5b020';
|
|
309
|
+
webex.request.mockReturnValue({
|
|
310
|
+
statusCode: 200,
|
|
311
|
+
body: {
|
|
312
|
+
device: {
|
|
313
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
314
|
+
correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
|
|
315
|
+
},
|
|
316
|
+
callId: serverCallId
|
|
317
|
+
}
|
|
318
|
+
});
|
|
305
319
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
306
|
-
call.
|
|
320
|
+
call.setCallId(serverCallId);
|
|
321
|
+
call.end();
|
|
307
322
|
_context4.next = 1;
|
|
308
323
|
return (0, _Utils.waitForMsecs)(50);
|
|
309
324
|
case 1:
|
|
310
|
-
expect(
|
|
311
|
-
expect(call.getCallerInfo().num).toStrictEqual('5010');
|
|
312
|
-
expect(call.getCallerInfo().avatarSrc).toBeFalsy();
|
|
325
|
+
expect(webex.request.mock.calls[0][0].body.callId).toBe(serverCallId);
|
|
313
326
|
case 2:
|
|
314
327
|
case "end":
|
|
315
328
|
return _context4.stop();
|
|
316
329
|
}
|
|
317
330
|
}, _callee4);
|
|
318
331
|
})));
|
|
319
|
-
it('check whether
|
|
320
|
-
var call
|
|
332
|
+
it('check whether callerId midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
333
|
+
var call;
|
|
321
334
|
return _regenerator.default.wrap(function (_context5) {
|
|
322
335
|
while (1) switch (_context5.prev = _context5.next) {
|
|
336
|
+
case 0:
|
|
337
|
+
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
338
|
+
call.handleMidCallEvent(dummyMidCallEvent);
|
|
339
|
+
_context5.next = 1;
|
|
340
|
+
return (0, _Utils.waitForMsecs)(50);
|
|
341
|
+
case 1:
|
|
342
|
+
expect(call.getCallerInfo().name).toStrictEqual('Bob Marley');
|
|
343
|
+
expect(call.getCallerInfo().num).toStrictEqual('5010');
|
|
344
|
+
expect(call.getCallerInfo().avatarSrc).toBeFalsy();
|
|
345
|
+
case 2:
|
|
346
|
+
case "end":
|
|
347
|
+
return _context5.stop();
|
|
348
|
+
}
|
|
349
|
+
}, _callee5);
|
|
350
|
+
})));
|
|
351
|
+
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
352
|
+
var call, logSpy, corelationId;
|
|
353
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
354
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
323
355
|
case 0:
|
|
324
356
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
325
357
|
dummyMidCallEvent.eventType = 'callState';
|
|
326
358
|
logSpy = jest.spyOn(_Logger.default, 'log');
|
|
327
359
|
call.handleMidCallEvent(dummyMidCallEvent);
|
|
328
|
-
|
|
360
|
+
_context6.next = 1;
|
|
329
361
|
return (0, _Utils.waitForMsecs)(50);
|
|
330
362
|
case 1:
|
|
331
363
|
corelationId = call.getCorrelationId();
|
|
@@ -335,39 +367,39 @@ describe('Call Tests', function () {
|
|
|
335
367
|
});
|
|
336
368
|
case 2:
|
|
337
369
|
case "end":
|
|
338
|
-
return
|
|
370
|
+
return _context6.stop();
|
|
339
371
|
}
|
|
340
|
-
},
|
|
372
|
+
}, _callee6);
|
|
341
373
|
})));
|
|
342
|
-
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
374
|
+
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
343
375
|
var call, callRtpStats, _t;
|
|
344
|
-
return _regenerator.default.wrap(function (
|
|
345
|
-
while (1) switch (
|
|
376
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
377
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
346
378
|
case 0:
|
|
347
379
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
348
|
-
|
|
349
|
-
|
|
380
|
+
_context7.prev = 1;
|
|
381
|
+
_context7.next = 2;
|
|
350
382
|
return call.getCallRtpStats();
|
|
351
383
|
case 2:
|
|
352
|
-
callRtpStats =
|
|
353
|
-
|
|
384
|
+
callRtpStats = _context7.sent;
|
|
385
|
+
_context7.next = 4;
|
|
354
386
|
break;
|
|
355
387
|
case 3:
|
|
356
|
-
|
|
357
|
-
_t =
|
|
388
|
+
_context7.prev = 3;
|
|
389
|
+
_t = _context7["catch"](1);
|
|
358
390
|
console.error(_t);
|
|
359
391
|
case 4:
|
|
360
392
|
expect(callRtpStats).toStrictEqual(disconnectStats);
|
|
361
393
|
case 5:
|
|
362
394
|
case "end":
|
|
363
|
-
return
|
|
395
|
+
return _context7.stop();
|
|
364
396
|
}
|
|
365
|
-
},
|
|
397
|
+
}, _callee7, null, [[1, 3]]);
|
|
366
398
|
})));
|
|
367
|
-
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
399
|
+
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
368
400
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, logSpy;
|
|
369
|
-
return _regenerator.default.wrap(function (
|
|
370
|
-
while (1) switch (
|
|
401
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
402
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
371
403
|
case 0:
|
|
372
404
|
mockStream = {
|
|
373
405
|
outputStream: {
|
|
@@ -400,14 +432,14 @@ describe('Call Tests', function () {
|
|
|
400
432
|
});
|
|
401
433
|
case 1:
|
|
402
434
|
case "end":
|
|
403
|
-
return
|
|
435
|
+
return _context8.stop();
|
|
404
436
|
}
|
|
405
|
-
},
|
|
437
|
+
}, _callee8);
|
|
406
438
|
})));
|
|
407
|
-
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
439
|
+
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
408
440
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, infoSpy;
|
|
409
|
-
return _regenerator.default.wrap(function (
|
|
410
|
-
while (1) switch (
|
|
441
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
442
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
411
443
|
case 0:
|
|
412
444
|
mockStream = {
|
|
413
445
|
outputStream: {
|
|
@@ -441,9 +473,9 @@ describe('Call Tests', function () {
|
|
|
441
473
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
442
474
|
case 1:
|
|
443
475
|
case "end":
|
|
444
|
-
return
|
|
476
|
+
return _context9.stop();
|
|
445
477
|
}
|
|
446
|
-
},
|
|
478
|
+
}, _callee9);
|
|
447
479
|
})));
|
|
448
480
|
it('registers and unregisters media connection listeners with stable handlers', function () {
|
|
449
481
|
var mockStream = {
|
|
@@ -489,9 +521,9 @@ describe('Call Tests', function () {
|
|
|
489
521
|
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
490
522
|
var getHandlerForEvent = function getHandlerForEvent(eventName) {
|
|
491
523
|
var _mock$calls$find;
|
|
492
|
-
return (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (
|
|
493
|
-
var
|
|
494
|
-
name =
|
|
524
|
+
return (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (_ref0) {
|
|
525
|
+
var _ref1 = (0, _slicedToArray2.default)(_ref0, 1),
|
|
526
|
+
name = _ref1[0];
|
|
495
527
|
return name === eventName;
|
|
496
528
|
})) === null || _mock$calls$find === void 0 ? void 0 : _mock$calls$find[1];
|
|
497
529
|
};
|
|
@@ -538,18 +570,18 @@ describe('Call Tests', function () {
|
|
|
538
570
|
call.dial(localAudioStream);
|
|
539
571
|
var metricSpy = jest.spyOn(call['metricManager'], 'submitMediaMetric');
|
|
540
572
|
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
541
|
-
var roapFailureHandler = (_mock$calls$find2 = call['mediaConnection'].on.mock.calls.find(function (
|
|
542
|
-
var
|
|
543
|
-
name =
|
|
573
|
+
var roapFailureHandler = (_mock$calls$find2 = call['mediaConnection'].on.mock.calls.find(function (_ref10) {
|
|
574
|
+
var _ref11 = (0, _slicedToArray2.default)(_ref10, 1),
|
|
575
|
+
name = _ref11[0];
|
|
544
576
|
return name === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE;
|
|
545
577
|
})) === null || _mock$calls$find2 === void 0 ? void 0 : _mock$calls$find2[1];
|
|
546
578
|
var roapFailure = new Error('Failed to process remote SDP');
|
|
547
579
|
roapFailureHandler(roapFailure);
|
|
548
580
|
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 =
|
|
581
|
+
var roapFailureMetricCall = metricSpy.mock.calls.find(function (_ref12) {
|
|
582
|
+
var _ref13 = (0, _slicedToArray2.default)(_ref12, 2),
|
|
583
|
+
name = _ref13[0],
|
|
584
|
+
metricAction = _ref13[1];
|
|
553
585
|
return name === _types4.METRIC_EVENT.MEDIA_ERROR && metricAction === _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE;
|
|
554
586
|
});
|
|
555
587
|
expect(roapFailureMetricCall).toBeDefined();
|
|
@@ -559,11 +591,11 @@ describe('Call Tests', function () {
|
|
|
559
591
|
method: 'mediaRoapEventsListener'
|
|
560
592
|
});
|
|
561
593
|
});
|
|
562
|
-
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
594
|
+
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
563
595
|
var _mock$calls$find3;
|
|
564
596
|
var mockStream, localAudioStream, call, handleOutgoingCallConnectSpy, delayedOffer, sendCallStateMachineEvtSpy, sendMediaStateMachineEvtSpy, roapListener;
|
|
565
|
-
return _regenerator.default.wrap(function (
|
|
566
|
-
while (1) switch (
|
|
597
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
598
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
567
599
|
case 0:
|
|
568
600
|
mockStream = {
|
|
569
601
|
outputStream: {
|
|
@@ -590,7 +622,7 @@ describe('Call Tests', function () {
|
|
|
590
622
|
}
|
|
591
623
|
});
|
|
592
624
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
593
|
-
|
|
625
|
+
_context0.next = 1;
|
|
594
626
|
return call.answer(localAudioStream);
|
|
595
627
|
case 1:
|
|
596
628
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
@@ -609,19 +641,19 @@ describe('Call Tests', function () {
|
|
|
609
641
|
type: 'E_RECV_ROAP_OFFER',
|
|
610
642
|
data: delayedOffer
|
|
611
643
|
});
|
|
612
|
-
|
|
644
|
+
_context0.next = 2;
|
|
613
645
|
return (0, _testUtil.flushPromises)(2);
|
|
614
646
|
case 2:
|
|
615
647
|
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenCalledWith(delayedOffer);
|
|
616
648
|
sendCallStateMachineEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
617
649
|
sendMediaStateMachineEvtSpy = jest.spyOn(call, 'sendMediaStateMachineEvt');
|
|
618
|
-
roapListener = (_mock$calls$find3 = call['mediaConnection'].on.mock.calls.find(function (
|
|
619
|
-
var
|
|
620
|
-
eventName =
|
|
650
|
+
roapListener = (_mock$calls$find3 = call['mediaConnection'].on.mock.calls.find(function (_ref15) {
|
|
651
|
+
var _ref16 = (0, _slicedToArray2.default)(_ref15, 1),
|
|
652
|
+
eventName = _ref16[0];
|
|
621
653
|
return eventName === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND;
|
|
622
654
|
})) === null || _mock$calls$find3 === void 0 ? void 0 : _mock$calls$find3[1];
|
|
623
655
|
expect(roapListener).toBeDefined();
|
|
624
|
-
|
|
656
|
+
_context0.next = 3;
|
|
625
657
|
return roapListener({
|
|
626
658
|
roapMessage: {
|
|
627
659
|
messageType: 'ANSWER',
|
|
@@ -631,7 +663,7 @@ describe('Call Tests', function () {
|
|
|
631
663
|
}
|
|
632
664
|
});
|
|
633
665
|
case 3:
|
|
634
|
-
|
|
666
|
+
_context0.next = 4;
|
|
635
667
|
return (0, _testUtil.flushPromises)(2);
|
|
636
668
|
case 4:
|
|
637
669
|
// On ANSWER from media layer, connect is retried first, then ROAP answer is posted.
|
|
@@ -649,9 +681,9 @@ describe('Call Tests', function () {
|
|
|
649
681
|
expect(call['connectPending']).toBe(false);
|
|
650
682
|
case 5:
|
|
651
683
|
case "end":
|
|
652
|
-
return
|
|
684
|
+
return _context0.stop();
|
|
653
685
|
}
|
|
654
|
-
},
|
|
686
|
+
}, _callee0);
|
|
655
687
|
})));
|
|
656
688
|
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
689
|
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 +721,15 @@ describe('Call Tests', function () {
|
|
|
689
721
|
reduceTimeoutForIceLite: true
|
|
690
722
|
},
|
|
691
723
|
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
|
|
724
|
+
}])('ICE candidates timeout selection', function (_ref17) {
|
|
725
|
+
var name = _ref17.name,
|
|
726
|
+
sdp = _ref17.sdp,
|
|
727
|
+
iceGatheringConfig = _ref17.iceGatheringConfig,
|
|
728
|
+
expectedTimeout = _ref17.expectedTimeout;
|
|
729
|
+
it("uses ".concat(name), /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
698
730
|
var mockStream, localAudioStream, call;
|
|
699
|
-
return _regenerator.default.wrap(function (
|
|
700
|
-
while (1) switch (
|
|
731
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
732
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
701
733
|
case 0:
|
|
702
734
|
mockStream = {
|
|
703
735
|
outputStream: {
|
|
@@ -727,7 +759,7 @@ describe('Call Tests', function () {
|
|
|
727
759
|
sdp: sdp
|
|
728
760
|
}
|
|
729
761
|
});
|
|
730
|
-
|
|
762
|
+
_context1.next = 1;
|
|
731
763
|
return call.answer(localAudioStream);
|
|
732
764
|
case 1:
|
|
733
765
|
expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(_objectSpread(_objectSpread({}, roapMediaConnectionConfig), {}, {
|
|
@@ -735,15 +767,15 @@ describe('Call Tests', function () {
|
|
|
735
767
|
}), roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
|
|
736
768
|
case 2:
|
|
737
769
|
case "end":
|
|
738
|
-
return
|
|
770
|
+
return _context1.stop();
|
|
739
771
|
}
|
|
740
|
-
},
|
|
772
|
+
}, _callee1);
|
|
741
773
|
})));
|
|
742
774
|
});
|
|
743
|
-
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
775
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
744
776
|
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
745
|
-
return _regenerator.default.wrap(function (
|
|
746
|
-
while (1) switch (
|
|
777
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
778
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
747
779
|
case 0:
|
|
748
780
|
mockStream = {
|
|
749
781
|
outputStream: {
|
|
@@ -799,7 +831,7 @@ describe('Call Tests', function () {
|
|
|
799
831
|
});
|
|
800
832
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
801
833
|
call.end();
|
|
802
|
-
|
|
834
|
+
_context10.next = 1;
|
|
803
835
|
return (0, _Utils.waitForMsecs)(50);
|
|
804
836
|
case 1:
|
|
805
837
|
/* Checks for switching off the listeners on call disconnect */
|
|
@@ -810,9 +842,9 @@ describe('Call Tests', function () {
|
|
|
810
842
|
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
811
843
|
case 2:
|
|
812
844
|
case "end":
|
|
813
|
-
return
|
|
845
|
+
return _context10.stop();
|
|
814
846
|
}
|
|
815
|
-
},
|
|
847
|
+
}, _callee10);
|
|
816
848
|
})));
|
|
817
849
|
it('does not register effect listeners when the added effect cannot be resolved', function () {
|
|
818
850
|
var mockStream = {
|
|
@@ -832,10 +864,10 @@ describe('Call Tests', function () {
|
|
|
832
864
|
}).not.toThrow();
|
|
833
865
|
expect(onEffectSpy).not.toHaveBeenCalled();
|
|
834
866
|
});
|
|
835
|
-
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
867
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
836
868
|
var mockStream, localAudioStream, warnSpy, call;
|
|
837
|
-
return _regenerator.default.wrap(function (
|
|
838
|
-
while (1) switch (
|
|
869
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
870
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
839
871
|
case 0:
|
|
840
872
|
mockStream = {
|
|
841
873
|
outputStream: {
|
|
@@ -859,7 +891,7 @@ describe('Call Tests', function () {
|
|
|
859
891
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
860
892
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
861
893
|
call.answer(localAudioStream);
|
|
862
|
-
|
|
894
|
+
_context11.next = 1;
|
|
863
895
|
return (0, _Utils.waitForMsecs)(50);
|
|
864
896
|
case 1:
|
|
865
897
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -874,14 +906,14 @@ describe('Call Tests', function () {
|
|
|
874
906
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
875
907
|
case 2:
|
|
876
908
|
case "end":
|
|
877
|
-
return
|
|
909
|
+
return _context11.stop();
|
|
878
910
|
}
|
|
879
|
-
},
|
|
911
|
+
}, _callee11);
|
|
880
912
|
})));
|
|
881
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
913
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
882
914
|
var mockStream, localAudioStream, warnSpy, call;
|
|
883
|
-
return _regenerator.default.wrap(function (
|
|
884
|
-
while (1) switch (
|
|
915
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
916
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
885
917
|
case 0:
|
|
886
918
|
mockStream = {
|
|
887
919
|
outputStream: {
|
|
@@ -893,7 +925,7 @@ describe('Call Tests', function () {
|
|
|
893
925
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
894
926
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
895
927
|
call.dial(localAudioStream);
|
|
896
|
-
|
|
928
|
+
_context12.next = 1;
|
|
897
929
|
return (0, _Utils.waitForMsecs)(50);
|
|
898
930
|
case 1:
|
|
899
931
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -906,9 +938,9 @@ describe('Call Tests', function () {
|
|
|
906
938
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
907
939
|
case 2:
|
|
908
940
|
case "end":
|
|
909
|
-
return
|
|
941
|
+
return _context12.stop();
|
|
910
942
|
}
|
|
911
|
-
},
|
|
943
|
+
}, _callee12);
|
|
912
944
|
})));
|
|
913
945
|
it('update media after call creation with valid stream', function () {
|
|
914
946
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -982,10 +1014,10 @@ describe('Call Tests', function () {
|
|
|
982
1014
|
method: 'dial'
|
|
983
1015
|
});
|
|
984
1016
|
});
|
|
985
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1017
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
986
1018
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
987
|
-
return _regenerator.default.wrap(function (
|
|
988
|
-
while (1) switch (
|
|
1019
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1020
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
989
1021
|
case 0:
|
|
990
1022
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
991
1023
|
webex.request.mockReturnValue({
|
|
@@ -1061,9 +1093,9 @@ describe('Call Tests', function () {
|
|
|
1061
1093
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
1062
1094
|
case 1:
|
|
1063
1095
|
case "end":
|
|
1064
|
-
return
|
|
1096
|
+
return _context13.stop();
|
|
1065
1097
|
}
|
|
1066
|
-
},
|
|
1098
|
+
}, _callee13);
|
|
1067
1099
|
})));
|
|
1068
1100
|
describe('Guest Calling Flow Tests', function () {
|
|
1069
1101
|
var dummyEvent = {
|
|
@@ -1071,10 +1103,10 @@ describe('Call Tests', function () {
|
|
|
1071
1103
|
data: undefined
|
|
1072
1104
|
};
|
|
1073
1105
|
var call;
|
|
1074
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1106
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
1075
1107
|
var requestSpy, requestArgs;
|
|
1076
|
-
return _regenerator.default.wrap(function (
|
|
1077
|
-
while (1) switch (
|
|
1108
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1109
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1078
1110
|
case 0:
|
|
1079
1111
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
1080
1112
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1087,14 +1119,14 @@ describe('Call Tests', function () {
|
|
|
1087
1119
|
expect('callee' in requestArgs.body).toBe(true);
|
|
1088
1120
|
case 1:
|
|
1089
1121
|
case "end":
|
|
1090
|
-
return
|
|
1122
|
+
return _context14.stop();
|
|
1091
1123
|
}
|
|
1092
|
-
},
|
|
1124
|
+
}, _callee14);
|
|
1093
1125
|
})));
|
|
1094
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1126
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1095
1127
|
var requestSpy, requestArgs;
|
|
1096
|
-
return _regenerator.default.wrap(function (
|
|
1097
|
-
while (1) switch (
|
|
1128
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1129
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1098
1130
|
case 0:
|
|
1099
1131
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
1100
1132
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1107,9 +1139,9 @@ describe('Call Tests', function () {
|
|
|
1107
1139
|
expect('callee' in requestArgs.body).toBe(false);
|
|
1108
1140
|
case 1:
|
|
1109
1141
|
case "end":
|
|
1110
|
-
return
|
|
1142
|
+
return _context15.stop();
|
|
1111
1143
|
}
|
|
1112
|
-
},
|
|
1144
|
+
}, _callee15);
|
|
1113
1145
|
})));
|
|
1114
1146
|
});
|
|
1115
1147
|
});
|
|
@@ -1147,10 +1179,10 @@ describe('State Machine handler tests', function () {
|
|
|
1147
1179
|
|
|
1148
1180
|
// afterEach(() => call.removeAllListeners());
|
|
1149
1181
|
|
|
1150
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1182
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1151
1183
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
1152
|
-
return _regenerator.default.wrap(function (
|
|
1153
|
-
while (1) switch (
|
|
1184
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1185
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1154
1186
|
case 0:
|
|
1155
1187
|
statusPayload = {
|
|
1156
1188
|
statusCode: 200,
|
|
@@ -1170,7 +1202,7 @@ describe('State Machine handler tests', function () {
|
|
|
1170
1202
|
/* This is to flush all the promises from the Promise queue so that
|
|
1171
1203
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
1172
1204
|
*/
|
|
1173
|
-
|
|
1205
|
+
_context16.next = 1;
|
|
1174
1206
|
return (0, _testUtil.flushPromises)(3);
|
|
1175
1207
|
case 1:
|
|
1176
1208
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -1186,14 +1218,14 @@ describe('State Machine handler tests', function () {
|
|
|
1186
1218
|
});
|
|
1187
1219
|
case 2:
|
|
1188
1220
|
case "end":
|
|
1189
|
-
return
|
|
1221
|
+
return _context16.stop();
|
|
1190
1222
|
}
|
|
1191
|
-
},
|
|
1223
|
+
}, _callee16);
|
|
1192
1224
|
})));
|
|
1193
|
-
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1225
|
+
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
1194
1226
|
var statusPayload, emitSpy, funcSpy;
|
|
1195
|
-
return _regenerator.default.wrap(function (
|
|
1196
|
-
while (1) switch (
|
|
1227
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1228
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1197
1229
|
case 0:
|
|
1198
1230
|
expect.assertions(4);
|
|
1199
1231
|
statusPayload = {
|
|
@@ -1208,10 +1240,10 @@ describe('State Machine handler tests', function () {
|
|
|
1208
1240
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
1209
1241
|
call['handleCallEstablished']({});
|
|
1210
1242
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1211
|
-
|
|
1243
|
+
_context17.next = 1;
|
|
1212
1244
|
return _promise.default.resolve();
|
|
1213
1245
|
case 1:
|
|
1214
|
-
|
|
1246
|
+
_context17.next = 2;
|
|
1215
1247
|
return _promise.default.resolve();
|
|
1216
1248
|
case 2:
|
|
1217
1249
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -1221,14 +1253,14 @@ describe('State Machine handler tests', function () {
|
|
|
1221
1253
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
1222
1254
|
case 3:
|
|
1223
1255
|
case "end":
|
|
1224
|
-
return
|
|
1256
|
+
return _context17.stop();
|
|
1225
1257
|
}
|
|
1226
|
-
},
|
|
1258
|
+
}, _callee17);
|
|
1227
1259
|
})));
|
|
1228
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1260
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
1229
1261
|
var statusPayload, funcSpy;
|
|
1230
|
-
return _regenerator.default.wrap(function (
|
|
1231
|
-
while (1) switch (
|
|
1262
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1263
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1232
1264
|
case 0:
|
|
1233
1265
|
expect.assertions(4);
|
|
1234
1266
|
statusPayload = {
|
|
@@ -1247,7 +1279,7 @@ describe('State Machine handler tests', function () {
|
|
|
1247
1279
|
/* This is to flush all the promises from the Promise queue so that
|
|
1248
1280
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
1249
1281
|
*/
|
|
1250
|
-
|
|
1282
|
+
_context18.next = 1;
|
|
1251
1283
|
return (0, _testUtil.flushPromises)(2);
|
|
1252
1284
|
case 1:
|
|
1253
1285
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -1256,14 +1288,14 @@ describe('State Machine handler tests', function () {
|
|
|
1256
1288
|
expect(funcSpy).toBeCalledTimes(1);
|
|
1257
1289
|
case 2:
|
|
1258
1290
|
case "end":
|
|
1259
|
-
return
|
|
1291
|
+
return _context18.stop();
|
|
1260
1292
|
}
|
|
1261
|
-
},
|
|
1293
|
+
}, _callee18);
|
|
1262
1294
|
})));
|
|
1263
|
-
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1295
|
+
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1264
1296
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
1265
|
-
return _regenerator.default.wrap(function (
|
|
1266
|
-
while (1) switch (
|
|
1297
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1298
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1267
1299
|
case 0:
|
|
1268
1300
|
errorPayload = {
|
|
1269
1301
|
statusCode: 500,
|
|
@@ -1281,28 +1313,28 @@ describe('State Machine handler tests', function () {
|
|
|
1281
1313
|
call['handleCallEstablished']({});
|
|
1282
1314
|
}
|
|
1283
1315
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1284
|
-
|
|
1316
|
+
_context19.next = 1;
|
|
1285
1317
|
return (0, _testUtil.flushPromises)(2);
|
|
1286
1318
|
case 1:
|
|
1287
1319
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
1288
1320
|
|
|
1289
1321
|
// Now advance by 1 second for the retry-after interval
|
|
1290
1322
|
jest.advanceTimersByTime(1000);
|
|
1291
|
-
|
|
1323
|
+
_context19.next = 2;
|
|
1292
1324
|
return (0, _testUtil.flushPromises)(2);
|
|
1293
1325
|
case 2:
|
|
1294
1326
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
1295
1327
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
1296
1328
|
case 3:
|
|
1297
1329
|
case "end":
|
|
1298
|
-
return
|
|
1330
|
+
return _context19.stop();
|
|
1299
1331
|
}
|
|
1300
|
-
},
|
|
1332
|
+
}, _callee19);
|
|
1301
1333
|
})));
|
|
1302
|
-
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1334
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1303
1335
|
var firstTimer, secondTimer;
|
|
1304
|
-
return _regenerator.default.wrap(function (
|
|
1305
|
-
while (1) switch (
|
|
1336
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1337
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1306
1338
|
case 0:
|
|
1307
1339
|
jest.spyOn(global, 'setInterval');
|
|
1308
1340
|
jest.spyOn(global, 'clearInterval');
|
|
@@ -1330,14 +1362,14 @@ describe('State Machine handler tests', function () {
|
|
|
1330
1362
|
expect(secondTimer).toBeDefined();
|
|
1331
1363
|
case 1:
|
|
1332
1364
|
case "end":
|
|
1333
|
-
return
|
|
1365
|
+
return _context20.stop();
|
|
1334
1366
|
}
|
|
1335
|
-
},
|
|
1367
|
+
}, _callee20);
|
|
1336
1368
|
})));
|
|
1337
|
-
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1369
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1338
1370
|
var errorPayload, warnSpy, postStatusSpy;
|
|
1339
|
-
return _regenerator.default.wrap(function (
|
|
1340
|
-
while (1) switch (
|
|
1371
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1372
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1341
1373
|
case 0:
|
|
1342
1374
|
errorPayload = {
|
|
1343
1375
|
statusCode: 500,
|
|
@@ -1356,25 +1388,25 @@ describe('State Machine handler tests', function () {
|
|
|
1356
1388
|
|
|
1357
1389
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
1358
1390
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1359
|
-
|
|
1391
|
+
_context21.next = 1;
|
|
1360
1392
|
return (0, _testUtil.flushPromises)(2);
|
|
1361
1393
|
case 1:
|
|
1362
1394
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
1363
1395
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
1364
1396
|
jest.advanceTimersByTime(1000);
|
|
1365
|
-
|
|
1397
|
+
_context21.next = 2;
|
|
1366
1398
|
return (0, _testUtil.flushPromises)(2);
|
|
1367
1399
|
case 2:
|
|
1368
1400
|
jest.advanceTimersByTime(1000);
|
|
1369
|
-
|
|
1401
|
+
_context21.next = 3;
|
|
1370
1402
|
return (0, _testUtil.flushPromises)(2);
|
|
1371
1403
|
case 3:
|
|
1372
1404
|
jest.advanceTimersByTime(1000);
|
|
1373
|
-
|
|
1405
|
+
_context21.next = 4;
|
|
1374
1406
|
return (0, _testUtil.flushPromises)(2);
|
|
1375
1407
|
case 4:
|
|
1376
1408
|
jest.advanceTimersByTime(1000);
|
|
1377
|
-
|
|
1409
|
+
_context21.next = 5;
|
|
1378
1410
|
return (0, _testUtil.flushPromises)(2);
|
|
1379
1411
|
case 5:
|
|
1380
1412
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1386,14 +1418,14 @@ describe('State Machine handler tests', function () {
|
|
|
1386
1418
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1387
1419
|
case 6:
|
|
1388
1420
|
case "end":
|
|
1389
|
-
return
|
|
1421
|
+
return _context21.stop();
|
|
1390
1422
|
}
|
|
1391
|
-
},
|
|
1423
|
+
}, _callee21);
|
|
1392
1424
|
})));
|
|
1393
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1425
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1394
1426
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1395
|
-
return _regenerator.default.wrap(function (
|
|
1396
|
-
while (1) switch (
|
|
1427
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1428
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1397
1429
|
case 0:
|
|
1398
1430
|
statusPayload = {
|
|
1399
1431
|
statusCode: 200,
|
|
@@ -1449,14 +1481,14 @@ describe('State Machine handler tests', function () {
|
|
|
1449
1481
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1450
1482
|
case 1:
|
|
1451
1483
|
case "end":
|
|
1452
|
-
return
|
|
1484
|
+
return _context22.stop();
|
|
1453
1485
|
}
|
|
1454
|
-
},
|
|
1486
|
+
}, _callee22);
|
|
1455
1487
|
})));
|
|
1456
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1488
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1457
1489
|
var statusPayload, dummyEvent;
|
|
1458
|
-
return _regenerator.default.wrap(function (
|
|
1459
|
-
while (1) switch (
|
|
1490
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1491
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1460
1492
|
case 0:
|
|
1461
1493
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1462
1494
|
statusPayload = {
|
|
@@ -1474,7 +1506,7 @@ describe('State Machine handler tests', function () {
|
|
|
1474
1506
|
webex.request.mockReturnValue(statusPayload);
|
|
1475
1507
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1476
1508
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1477
|
-
|
|
1509
|
+
_context23.next = 1;
|
|
1478
1510
|
return call['handleOutgoingCallConnect']({
|
|
1479
1511
|
type: 'E_SEND_CALL_CONNECT'
|
|
1480
1512
|
});
|
|
@@ -1488,14 +1520,14 @@ describe('State Machine handler tests', function () {
|
|
|
1488
1520
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1489
1521
|
case 2:
|
|
1490
1522
|
case "end":
|
|
1491
|
-
return
|
|
1523
|
+
return _context23.stop();
|
|
1492
1524
|
}
|
|
1493
|
-
},
|
|
1525
|
+
}, _callee23);
|
|
1494
1526
|
})));
|
|
1495
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1527
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1496
1528
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1497
|
-
return _regenerator.default.wrap(function (
|
|
1498
|
-
while (1) switch (
|
|
1529
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1530
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1499
1531
|
case 0:
|
|
1500
1532
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1501
1533
|
statusPayload = {
|
|
@@ -1589,14 +1621,14 @@ describe('State Machine handler tests', function () {
|
|
|
1589
1621
|
expect(call.earlyMedia).not.toBe(true);
|
|
1590
1622
|
case 1:
|
|
1591
1623
|
case "end":
|
|
1592
|
-
return
|
|
1624
|
+
return _context24.stop();
|
|
1593
1625
|
}
|
|
1594
|
-
},
|
|
1626
|
+
}, _callee24);
|
|
1595
1627
|
})));
|
|
1596
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1628
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1597
1629
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1598
|
-
return _regenerator.default.wrap(function (
|
|
1599
|
-
while (1) switch (
|
|
1630
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1631
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1600
1632
|
case 0:
|
|
1601
1633
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1602
1634
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1623,7 +1655,7 @@ describe('State Machine handler tests', function () {
|
|
|
1623
1655
|
webex.request.mockRejectedValueOnce({
|
|
1624
1656
|
statusCode: 403
|
|
1625
1657
|
}).mockResolvedValue(statusPayload);
|
|
1626
|
-
|
|
1658
|
+
_context25.next = 1;
|
|
1627
1659
|
return call['handleOutgoingCallConnect']({
|
|
1628
1660
|
type: 'E_SEND_CALL_CONNECT'
|
|
1629
1661
|
});
|
|
@@ -1634,14 +1666,14 @@ describe('State Machine handler tests', function () {
|
|
|
1634
1666
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1635
1667
|
case 2:
|
|
1636
1668
|
case "end":
|
|
1637
|
-
return
|
|
1669
|
+
return _context25.stop();
|
|
1638
1670
|
}
|
|
1639
|
-
},
|
|
1671
|
+
}, _callee25);
|
|
1640
1672
|
})));
|
|
1641
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1673
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1642
1674
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1643
|
-
return _regenerator.default.wrap(function (
|
|
1644
|
-
while (1) switch (
|
|
1675
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1676
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1645
1677
|
case 0:
|
|
1646
1678
|
statusPayload = {
|
|
1647
1679
|
statusCode: 200,
|
|
@@ -1717,14 +1749,14 @@ describe('State Machine handler tests', function () {
|
|
|
1717
1749
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1718
1750
|
case 1:
|
|
1719
1751
|
case "end":
|
|
1720
|
-
return
|
|
1752
|
+
return _context26.stop();
|
|
1721
1753
|
}
|
|
1722
|
-
},
|
|
1754
|
+
}, _callee26);
|
|
1723
1755
|
})));
|
|
1724
|
-
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
|
|
1756
|
+
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 _callee27() {
|
|
1725
1757
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1726
|
-
return _regenerator.default.wrap(function (
|
|
1727
|
-
while (1) switch (
|
|
1758
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1759
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1728
1760
|
case 0:
|
|
1729
1761
|
statusPayload = {
|
|
1730
1762
|
statusCode: 200,
|
|
@@ -1792,14 +1824,14 @@ describe('State Machine handler tests', function () {
|
|
|
1792
1824
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1793
1825
|
case 1:
|
|
1794
1826
|
case "end":
|
|
1795
|
-
return
|
|
1827
|
+
return _context27.stop();
|
|
1796
1828
|
}
|
|
1797
|
-
},
|
|
1829
|
+
}, _callee27);
|
|
1798
1830
|
})));
|
|
1799
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1831
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1800
1832
|
var statusPayload, dummyEvent;
|
|
1801
|
-
return _regenerator.default.wrap(function (
|
|
1802
|
-
while (1) switch (
|
|
1833
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1834
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1803
1835
|
case 0:
|
|
1804
1836
|
statusPayload = {
|
|
1805
1837
|
statusCode: 200,
|
|
@@ -1838,14 +1870,14 @@ describe('State Machine handler tests', function () {
|
|
|
1838
1870
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1839
1871
|
case 1:
|
|
1840
1872
|
case "end":
|
|
1841
|
-
return
|
|
1873
|
+
return _context28.stop();
|
|
1842
1874
|
}
|
|
1843
|
-
},
|
|
1875
|
+
}, _callee28);
|
|
1844
1876
|
})));
|
|
1845
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1877
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1846
1878
|
var statusPayload, dummyEvent, errorSpy;
|
|
1847
|
-
return _regenerator.default.wrap(function (
|
|
1848
|
-
while (1) switch (
|
|
1879
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1880
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1849
1881
|
case 0:
|
|
1850
1882
|
statusPayload = {
|
|
1851
1883
|
statusCode: 403,
|
|
@@ -1862,13 +1894,13 @@ describe('State Machine handler tests', function () {
|
|
|
1862
1894
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1863
1895
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1864
1896
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1865
|
-
|
|
1897
|
+
_context29.next = 1;
|
|
1866
1898
|
return (0, _testUtil.flushPromises)(3);
|
|
1867
1899
|
case 1:
|
|
1868
|
-
|
|
1900
|
+
_context29.next = 2;
|
|
1869
1901
|
return _promise.default.resolve();
|
|
1870
1902
|
case 2:
|
|
1871
|
-
|
|
1903
|
+
_context29.next = 3;
|
|
1872
1904
|
return _promise.default.resolve();
|
|
1873
1905
|
case 3:
|
|
1874
1906
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
@@ -1879,14 +1911,14 @@ describe('State Machine handler tests', function () {
|
|
|
1879
1911
|
});
|
|
1880
1912
|
case 4:
|
|
1881
1913
|
case "end":
|
|
1882
|
-
return
|
|
1914
|
+
return _context29.stop();
|
|
1883
1915
|
}
|
|
1884
|
-
},
|
|
1916
|
+
}, _callee29);
|
|
1885
1917
|
})));
|
|
1886
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1918
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1887
1919
|
var statusPayload, dummyEvent, warnSpy;
|
|
1888
|
-
return _regenerator.default.wrap(function (
|
|
1889
|
-
while (1) switch (
|
|
1920
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1921
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1890
1922
|
case 0:
|
|
1891
1923
|
statusPayload = {
|
|
1892
1924
|
statusCode: 403,
|
|
@@ -1905,16 +1937,16 @@ describe('State Machine handler tests', function () {
|
|
|
1905
1937
|
webex.request.mockRejectedValue(statusPayload);
|
|
1906
1938
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1907
1939
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1908
|
-
|
|
1940
|
+
_context30.next = 1;
|
|
1909
1941
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1910
1942
|
case 1:
|
|
1911
|
-
|
|
1943
|
+
_context30.next = 2;
|
|
1912
1944
|
return (0, _testUtil.flushPromises)(2);
|
|
1913
1945
|
case 2:
|
|
1914
|
-
|
|
1946
|
+
_context30.next = 3;
|
|
1915
1947
|
return _promise.default.resolve();
|
|
1916
1948
|
case 3:
|
|
1917
|
-
|
|
1949
|
+
_context30.next = 4;
|
|
1918
1950
|
return _promise.default.resolve();
|
|
1919
1951
|
case 4:
|
|
1920
1952
|
expect(call.isConnected()).toBe(false);
|
|
@@ -1930,14 +1962,14 @@ describe('State Machine handler tests', function () {
|
|
|
1930
1962
|
});
|
|
1931
1963
|
case 5:
|
|
1932
1964
|
case "end":
|
|
1933
|
-
return
|
|
1965
|
+
return _context30.stop();
|
|
1934
1966
|
}
|
|
1935
|
-
},
|
|
1967
|
+
}, _callee30);
|
|
1936
1968
|
})));
|
|
1937
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1969
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1938
1970
|
var statusPayload, dummyEvent;
|
|
1939
|
-
return _regenerator.default.wrap(function (
|
|
1940
|
-
while (1) switch (
|
|
1971
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1972
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1941
1973
|
case 0:
|
|
1942
1974
|
statusPayload = {
|
|
1943
1975
|
statusCode: 403,
|
|
@@ -1960,14 +1992,14 @@ describe('State Machine handler tests', function () {
|
|
|
1960
1992
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1961
1993
|
case 1:
|
|
1962
1994
|
case "end":
|
|
1963
|
-
return
|
|
1995
|
+
return _context31.stop();
|
|
1964
1996
|
}
|
|
1965
|
-
},
|
|
1997
|
+
}, _callee31);
|
|
1966
1998
|
})));
|
|
1967
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1999
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1968
2000
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1969
|
-
return _regenerator.default.wrap(function (
|
|
1970
|
-
while (1) switch (
|
|
2001
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
2002
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1971
2003
|
case 0:
|
|
1972
2004
|
statusPayload = {
|
|
1973
2005
|
statusCode: 503,
|
|
@@ -1989,7 +2021,7 @@ describe('State Machine handler tests', function () {
|
|
|
1989
2021
|
}
|
|
1990
2022
|
};
|
|
1991
2023
|
call['connected'] = true;
|
|
1992
|
-
|
|
2024
|
+
_context32.next = 1;
|
|
1993
2025
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1994
2026
|
case 1:
|
|
1995
2027
|
jest.advanceTimersByTime(1005);
|
|
@@ -2001,14 +2033,14 @@ describe('State Machine handler tests', function () {
|
|
|
2001
2033
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
2002
2034
|
case 2:
|
|
2003
2035
|
case "end":
|
|
2004
|
-
return
|
|
2036
|
+
return _context32.stop();
|
|
2005
2037
|
}
|
|
2006
|
-
},
|
|
2038
|
+
}, _callee32);
|
|
2007
2039
|
})));
|
|
2008
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2040
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
2009
2041
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2010
|
-
return _regenerator.default.wrap(function (
|
|
2011
|
-
while (1) switch (
|
|
2042
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
2043
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2012
2044
|
case 0:
|
|
2013
2045
|
statusPayload = {
|
|
2014
2046
|
statusCode: 503,
|
|
@@ -2030,7 +2062,7 @@ describe('State Machine handler tests', function () {
|
|
|
2030
2062
|
}
|
|
2031
2063
|
};
|
|
2032
2064
|
call['connected'] = false;
|
|
2033
|
-
|
|
2065
|
+
_context33.next = 1;
|
|
2034
2066
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
2035
2067
|
case 1:
|
|
2036
2068
|
jest.advanceTimersByTime(1005);
|
|
@@ -2041,14 +2073,14 @@ describe('State Machine handler tests', function () {
|
|
|
2041
2073
|
expect(stateMachineSpy).not.toBeCalled();
|
|
2042
2074
|
case 2:
|
|
2043
2075
|
case "end":
|
|
2044
|
-
return
|
|
2076
|
+
return _context33.stop();
|
|
2045
2077
|
}
|
|
2046
|
-
},
|
|
2078
|
+
}, _callee33);
|
|
2047
2079
|
})));
|
|
2048
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2080
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
2049
2081
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2050
|
-
return _regenerator.default.wrap(function (
|
|
2051
|
-
while (1) switch (
|
|
2082
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
2083
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2052
2084
|
case 0:
|
|
2053
2085
|
statusPayload = {
|
|
2054
2086
|
statusCode: 503,
|
|
@@ -2070,7 +2102,7 @@ describe('State Machine handler tests', function () {
|
|
|
2070
2102
|
};
|
|
2071
2103
|
call['connected'] = true;
|
|
2072
2104
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
2073
|
-
|
|
2105
|
+
_context34.next = 1;
|
|
2074
2106
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2075
2107
|
case 1:
|
|
2076
2108
|
jest.advanceTimersByTime(1005);
|
|
@@ -2082,14 +2114,14 @@ describe('State Machine handler tests', function () {
|
|
|
2082
2114
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
2083
2115
|
case 2:
|
|
2084
2116
|
case "end":
|
|
2085
|
-
return
|
|
2117
|
+
return _context34.stop();
|
|
2086
2118
|
}
|
|
2087
|
-
},
|
|
2119
|
+
}, _callee34);
|
|
2088
2120
|
})));
|
|
2089
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2121
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
2090
2122
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2091
|
-
return _regenerator.default.wrap(function (
|
|
2092
|
-
while (1) switch (
|
|
2123
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
2124
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2093
2125
|
case 0:
|
|
2094
2126
|
statusPayload = {
|
|
2095
2127
|
statusCode: 503,
|
|
@@ -2110,7 +2142,7 @@ describe('State Machine handler tests', function () {
|
|
|
2110
2142
|
}
|
|
2111
2143
|
};
|
|
2112
2144
|
call['connected'] = false;
|
|
2113
|
-
|
|
2145
|
+
_context35.next = 1;
|
|
2114
2146
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2115
2147
|
case 1:
|
|
2116
2148
|
jest.advanceTimersByTime(1005);
|
|
@@ -2122,14 +2154,14 @@ describe('State Machine handler tests', function () {
|
|
|
2122
2154
|
expect(stateMachineSpy).not.toBeCalled();
|
|
2123
2155
|
case 2:
|
|
2124
2156
|
case "end":
|
|
2125
|
-
return
|
|
2157
|
+
return _context35.stop();
|
|
2126
2158
|
}
|
|
2127
|
-
},
|
|
2159
|
+
}, _callee35);
|
|
2128
2160
|
})));
|
|
2129
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2161
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
2130
2162
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
2131
|
-
return _regenerator.default.wrap(function (
|
|
2132
|
-
while (1) switch (
|
|
2163
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
2164
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2133
2165
|
case 0:
|
|
2134
2166
|
statusPayload = {
|
|
2135
2167
|
statusCode: 200,
|
|
@@ -2154,14 +2186,14 @@ describe('State Machine handler tests', function () {
|
|
|
2154
2186
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
2155
2187
|
case 1:
|
|
2156
2188
|
case "end":
|
|
2157
|
-
return
|
|
2189
|
+
return _context36.stop();
|
|
2158
2190
|
}
|
|
2159
|
-
},
|
|
2191
|
+
}, _callee36);
|
|
2160
2192
|
})));
|
|
2161
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2193
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
2162
2194
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
2163
|
-
return _regenerator.default.wrap(function (
|
|
2164
|
-
while (1) switch (
|
|
2195
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2196
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2165
2197
|
case 0:
|
|
2166
2198
|
statusPayload = {
|
|
2167
2199
|
statusCode: 503,
|
|
@@ -2183,7 +2215,7 @@ describe('State Machine handler tests', function () {
|
|
|
2183
2215
|
};
|
|
2184
2216
|
call['connected'] = true;
|
|
2185
2217
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
2186
|
-
|
|
2218
|
+
_context37.next = 1;
|
|
2187
2219
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2188
2220
|
case 1:
|
|
2189
2221
|
jest.advanceTimersByTime(1005);
|
|
@@ -2195,14 +2227,14 @@ describe('State Machine handler tests', function () {
|
|
|
2195
2227
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
2196
2228
|
case 2:
|
|
2197
2229
|
case "end":
|
|
2198
|
-
return
|
|
2230
|
+
return _context37.stop();
|
|
2199
2231
|
}
|
|
2200
|
-
},
|
|
2232
|
+
}, _callee37);
|
|
2201
2233
|
})));
|
|
2202
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2234
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
2203
2235
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
2204
|
-
return _regenerator.default.wrap(function (
|
|
2205
|
-
while (1) switch (
|
|
2236
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2237
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2206
2238
|
case 0:
|
|
2207
2239
|
statusPayload = {
|
|
2208
2240
|
statusCode: 403,
|
|
@@ -2225,14 +2257,14 @@ describe('State Machine handler tests', function () {
|
|
|
2225
2257
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
2226
2258
|
case 1:
|
|
2227
2259
|
case "end":
|
|
2228
|
-
return
|
|
2260
|
+
return _context38.stop();
|
|
2229
2261
|
}
|
|
2230
|
-
},
|
|
2262
|
+
}, _callee38);
|
|
2231
2263
|
})));
|
|
2232
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2264
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2233
2265
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
2234
|
-
return _regenerator.default.wrap(function (
|
|
2235
|
-
while (1) switch (
|
|
2266
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2267
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2236
2268
|
case 0:
|
|
2237
2269
|
statusPayload = {
|
|
2238
2270
|
statusCode: 200,
|
|
@@ -2250,7 +2282,7 @@ describe('State Machine handler tests', function () {
|
|
|
2250
2282
|
}
|
|
2251
2283
|
};
|
|
2252
2284
|
call['connected'] = false;
|
|
2253
|
-
|
|
2285
|
+
_context39.next = 1;
|
|
2254
2286
|
return call['handleRoapError']({}, errorEvent);
|
|
2255
2287
|
case 1:
|
|
2256
2288
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -2266,14 +2298,14 @@ describe('State Machine handler tests', function () {
|
|
|
2266
2298
|
});
|
|
2267
2299
|
case 2:
|
|
2268
2300
|
case "end":
|
|
2269
|
-
return
|
|
2301
|
+
return _context39.stop();
|
|
2270
2302
|
}
|
|
2271
|
-
},
|
|
2303
|
+
}, _callee39);
|
|
2272
2304
|
})));
|
|
2273
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2305
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2274
2306
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
2275
|
-
return _regenerator.default.wrap(function (
|
|
2276
|
-
while (1) switch (
|
|
2307
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2308
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2277
2309
|
case 0:
|
|
2278
2310
|
statusPayload = {
|
|
2279
2311
|
statusCode: 403,
|
|
@@ -2311,16 +2343,16 @@ describe('State Machine handler tests', function () {
|
|
|
2311
2343
|
messageType: 'ANSWER'
|
|
2312
2344
|
}
|
|
2313
2345
|
};
|
|
2314
|
-
|
|
2346
|
+
_context40.next = 1;
|
|
2315
2347
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
2316
2348
|
case 1:
|
|
2317
|
-
|
|
2349
|
+
_context40.next = 2;
|
|
2318
2350
|
return (0, _testUtil.flushPromises)(2);
|
|
2319
2351
|
case 2:
|
|
2320
|
-
|
|
2352
|
+
_context40.next = 3;
|
|
2321
2353
|
return _promise.default.resolve();
|
|
2322
2354
|
case 3:
|
|
2323
|
-
|
|
2355
|
+
_context40.next = 4;
|
|
2324
2356
|
return _promise.default.resolve();
|
|
2325
2357
|
case 4:
|
|
2326
2358
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
@@ -2338,14 +2370,14 @@ describe('State Machine handler tests', function () {
|
|
|
2338
2370
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
2339
2371
|
case 5:
|
|
2340
2372
|
case "end":
|
|
2341
|
-
return
|
|
2373
|
+
return _context40.stop();
|
|
2342
2374
|
}
|
|
2343
|
-
},
|
|
2375
|
+
}, _callee40);
|
|
2344
2376
|
})));
|
|
2345
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2377
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2346
2378
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2347
|
-
return _regenerator.default.wrap(function (
|
|
2348
|
-
while (1) switch (
|
|
2379
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2380
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2349
2381
|
case 0:
|
|
2350
2382
|
statusPayload = {
|
|
2351
2383
|
statusCode: 200,
|
|
@@ -2378,7 +2410,7 @@ describe('State Machine handler tests', function () {
|
|
|
2378
2410
|
seq: 1,
|
|
2379
2411
|
messageType: 'ANSWER'
|
|
2380
2412
|
};
|
|
2381
|
-
|
|
2413
|
+
_context41.next = 1;
|
|
2382
2414
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2383
2415
|
case 1:
|
|
2384
2416
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2400,7 +2432,7 @@ describe('State Machine handler tests', function () {
|
|
|
2400
2432
|
seq: 2,
|
|
2401
2433
|
messageType: 'OFFER_REQUEST'
|
|
2402
2434
|
};
|
|
2403
|
-
|
|
2435
|
+
_context41.next = 2;
|
|
2404
2436
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2405
2437
|
case 2:
|
|
2406
2438
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2450,7 +2482,7 @@ describe('State Machine handler tests', function () {
|
|
|
2450
2482
|
};
|
|
2451
2483
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2452
2484
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2453
|
-
|
|
2485
|
+
_context41.next = 3;
|
|
2454
2486
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2455
2487
|
case 3:
|
|
2456
2488
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2459,7 +2491,7 @@ describe('State Machine handler tests', function () {
|
|
|
2459
2491
|
seq: 3,
|
|
2460
2492
|
messageType: 'ANSWER'
|
|
2461
2493
|
};
|
|
2462
|
-
|
|
2494
|
+
_context41.next = 4;
|
|
2463
2495
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2464
2496
|
case 4:
|
|
2465
2497
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2478,7 +2510,7 @@ describe('State Machine handler tests', function () {
|
|
|
2478
2510
|
messageType: 'OK'
|
|
2479
2511
|
}
|
|
2480
2512
|
};
|
|
2481
|
-
|
|
2513
|
+
_context41.next = 5;
|
|
2482
2514
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2483
2515
|
case 5:
|
|
2484
2516
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2493,14 +2525,14 @@ describe('State Machine handler tests', function () {
|
|
|
2493
2525
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2494
2526
|
case 6:
|
|
2495
2527
|
case "end":
|
|
2496
|
-
return
|
|
2528
|
+
return _context41.stop();
|
|
2497
2529
|
}
|
|
2498
|
-
},
|
|
2530
|
+
}, _callee41);
|
|
2499
2531
|
})));
|
|
2500
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2532
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2501
2533
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2502
|
-
return _regenerator.default.wrap(function (
|
|
2503
|
-
while (1) switch (
|
|
2534
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2535
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2504
2536
|
case 0:
|
|
2505
2537
|
mockStatusBody = {
|
|
2506
2538
|
device: {
|
|
@@ -2540,7 +2572,7 @@ describe('State Machine handler tests', function () {
|
|
|
2540
2572
|
seq: 1,
|
|
2541
2573
|
messageType: 'ANSWER'
|
|
2542
2574
|
};
|
|
2543
|
-
|
|
2575
|
+
_context42.next = 1;
|
|
2544
2576
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2545
2577
|
case 1:
|
|
2546
2578
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2562,7 +2594,7 @@ describe('State Machine handler tests', function () {
|
|
|
2562
2594
|
seq: 2,
|
|
2563
2595
|
messageType: 'OFFER_REQUEST'
|
|
2564
2596
|
};
|
|
2565
|
-
|
|
2597
|
+
_context42.next = 2;
|
|
2566
2598
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2567
2599
|
case 2:
|
|
2568
2600
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2612,7 +2644,7 @@ describe('State Machine handler tests', function () {
|
|
|
2612
2644
|
};
|
|
2613
2645
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2614
2646
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2615
|
-
|
|
2647
|
+
_context42.next = 3;
|
|
2616
2648
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2617
2649
|
case 3:
|
|
2618
2650
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2621,7 +2653,7 @@ describe('State Machine handler tests', function () {
|
|
|
2621
2653
|
seq: 3,
|
|
2622
2654
|
messageType: 'ANSWER'
|
|
2623
2655
|
};
|
|
2624
|
-
|
|
2656
|
+
_context42.next = 4;
|
|
2625
2657
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2626
2658
|
case 4:
|
|
2627
2659
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2638,7 +2670,7 @@ describe('State Machine handler tests', function () {
|
|
|
2638
2670
|
}
|
|
2639
2671
|
};
|
|
2640
2672
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2641
|
-
|
|
2673
|
+
_context42.next = 5;
|
|
2642
2674
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2643
2675
|
case 5:
|
|
2644
2676
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2654,14 +2686,14 @@ describe('State Machine handler tests', function () {
|
|
|
2654
2686
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2655
2687
|
case 6:
|
|
2656
2688
|
case "end":
|
|
2657
|
-
return
|
|
2689
|
+
return _context42.stop();
|
|
2658
2690
|
}
|
|
2659
|
-
},
|
|
2691
|
+
}, _callee42);
|
|
2660
2692
|
})));
|
|
2661
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2693
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2662
2694
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2663
|
-
return _regenerator.default.wrap(function (
|
|
2664
|
-
while (1) switch (
|
|
2695
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2696
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2665
2697
|
case 0:
|
|
2666
2698
|
statusPayload = {
|
|
2667
2699
|
statusCode: 200,
|
|
@@ -2728,14 +2760,14 @@ describe('State Machine handler tests', function () {
|
|
|
2728
2760
|
});
|
|
2729
2761
|
case 1:
|
|
2730
2762
|
case "end":
|
|
2731
|
-
return
|
|
2763
|
+
return _context43.stop();
|
|
2732
2764
|
}
|
|
2733
|
-
},
|
|
2765
|
+
}, _callee43);
|
|
2734
2766
|
})));
|
|
2735
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2767
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2736
2768
|
var emitSpy, deleteSpy;
|
|
2737
|
-
return _regenerator.default.wrap(function (
|
|
2738
|
-
while (1) switch (
|
|
2769
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2770
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2739
2771
|
case 0:
|
|
2740
2772
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2741
2773
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2744,7 +2776,7 @@ describe('State Machine handler tests', function () {
|
|
|
2744
2776
|
call.sendCallStateMachineEvt({
|
|
2745
2777
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2746
2778
|
});
|
|
2747
|
-
|
|
2779
|
+
_context44.next = 1;
|
|
2748
2780
|
return (0, _testUtil.flushPromises)(1);
|
|
2749
2781
|
case 1:
|
|
2750
2782
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2752,9 +2784,9 @@ describe('State Machine handler tests', function () {
|
|
|
2752
2784
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2753
2785
|
case 2:
|
|
2754
2786
|
case "end":
|
|
2755
|
-
return
|
|
2787
|
+
return _context44.stop();
|
|
2756
2788
|
}
|
|
2757
|
-
},
|
|
2789
|
+
}, _callee44);
|
|
2758
2790
|
})));
|
|
2759
2791
|
describe('Call event timers tests', function () {
|
|
2760
2792
|
var callManager;
|
|
@@ -2765,10 +2797,10 @@ describe('State Machine handler tests', function () {
|
|
|
2765
2797
|
afterEach(function () {
|
|
2766
2798
|
jest.clearAllTimers();
|
|
2767
2799
|
});
|
|
2768
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2800
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2769
2801
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2770
|
-
return _regenerator.default.wrap(function (
|
|
2771
|
-
while (1) switch (
|
|
2802
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2803
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2772
2804
|
case 0:
|
|
2773
2805
|
statusPayload = {
|
|
2774
2806
|
statusCode: 200,
|
|
@@ -2785,7 +2817,7 @@ describe('State Machine handler tests', function () {
|
|
|
2785
2817
|
webex.request.mockReturnValue(statusPayload);
|
|
2786
2818
|
|
|
2787
2819
|
// handleOutgoingCallSetup is asynchronous
|
|
2788
|
-
|
|
2820
|
+
_context45.next = 1;
|
|
2789
2821
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2790
2822
|
case 1:
|
|
2791
2823
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2828,14 +2860,14 @@ describe('State Machine handler tests', function () {
|
|
|
2828
2860
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2829
2861
|
case 2:
|
|
2830
2862
|
case "end":
|
|
2831
|
-
return
|
|
2863
|
+
return _context45.stop();
|
|
2832
2864
|
}
|
|
2833
|
-
},
|
|
2865
|
+
}, _callee45);
|
|
2834
2866
|
})));
|
|
2835
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2867
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2836
2868
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2837
|
-
return _regenerator.default.wrap(function (
|
|
2838
|
-
while (1) switch (
|
|
2869
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2870
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2839
2871
|
case 0:
|
|
2840
2872
|
statusPayload = {
|
|
2841
2873
|
statusCode: 200,
|
|
@@ -2854,7 +2886,7 @@ describe('State Machine handler tests', function () {
|
|
|
2854
2886
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2855
2887
|
|
|
2856
2888
|
// handleOutgoingCallSetup is asynchronous
|
|
2857
|
-
|
|
2889
|
+
_context46.next = 1;
|
|
2858
2890
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2859
2891
|
case 1:
|
|
2860
2892
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2866,9 +2898,9 @@ describe('State Machine handler tests', function () {
|
|
|
2866
2898
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2867
2899
|
case 2:
|
|
2868
2900
|
case "end":
|
|
2869
|
-
return
|
|
2901
|
+
return _context46.stop();
|
|
2870
2902
|
}
|
|
2871
|
-
},
|
|
2903
|
+
}, _callee46);
|
|
2872
2904
|
})));
|
|
2873
2905
|
});
|
|
2874
2906
|
});
|
|
@@ -2933,10 +2965,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2933
2965
|
beforeEach(function () {
|
|
2934
2966
|
call.removeAllListeners();
|
|
2935
2967
|
});
|
|
2936
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2968
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2937
2969
|
var responsePayload, warnSpy, roapEvent;
|
|
2938
|
-
return _regenerator.default.wrap(function (
|
|
2939
|
-
while (1) switch (
|
|
2970
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2971
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2940
2972
|
case 0:
|
|
2941
2973
|
expect.assertions(7);
|
|
2942
2974
|
responsePayload = {
|
|
@@ -2949,25 +2981,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2949
2981
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2950
2982
|
call['held'] = false;
|
|
2951
2983
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2952
|
-
var
|
|
2953
|
-
return _regenerator.default.wrap(function (
|
|
2954
|
-
while (1) switch (
|
|
2984
|
+
var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(correlationId) {
|
|
2985
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2986
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2955
2987
|
case 0:
|
|
2956
2988
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2957
2989
|
case 1:
|
|
2958
2990
|
case "end":
|
|
2959
|
-
return
|
|
2991
|
+
return _context47.stop();
|
|
2960
2992
|
}
|
|
2961
|
-
},
|
|
2993
|
+
}, _callee47);
|
|
2962
2994
|
}));
|
|
2963
2995
|
return function (_x) {
|
|
2964
|
-
return
|
|
2996
|
+
return _ref57.apply(this, arguments);
|
|
2965
2997
|
};
|
|
2966
2998
|
}());
|
|
2967
|
-
|
|
2999
|
+
_context48.next = 1;
|
|
2968
3000
|
return call.doHoldResume();
|
|
2969
3001
|
case 1:
|
|
2970
|
-
|
|
3002
|
+
_context48.next = 2;
|
|
2971
3003
|
return (0, _testUtil.flushPromises)(2);
|
|
2972
3004
|
case 2:
|
|
2973
3005
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2983,11 +3015,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2983
3015
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2984
3016
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2985
3017
|
roapEvent.data.type = 'ANSWER';
|
|
2986
|
-
|
|
3018
|
+
_context48.next = 3;
|
|
2987
3019
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2988
3020
|
case 3:
|
|
2989
3021
|
roapEvent.data.type = 'OK';
|
|
2990
|
-
|
|
3022
|
+
_context48.next = 4;
|
|
2991
3023
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2992
3024
|
case 4:
|
|
2993
3025
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3002,14 +3034,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3002
3034
|
});
|
|
3003
3035
|
case 5:
|
|
3004
3036
|
case "end":
|
|
3005
|
-
return
|
|
3037
|
+
return _context48.stop();
|
|
3006
3038
|
}
|
|
3007
|
-
},
|
|
3039
|
+
}, _callee48);
|
|
3008
3040
|
})));
|
|
3009
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3041
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
3010
3042
|
var responsePayload, warnSpy, roapEvent;
|
|
3011
|
-
return _regenerator.default.wrap(function (
|
|
3012
|
-
while (1) switch (
|
|
3043
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
3044
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
3013
3045
|
case 0:
|
|
3014
3046
|
expect.assertions(8);
|
|
3015
3047
|
responsePayload = {
|
|
@@ -3022,26 +3054,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3022
3054
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3023
3055
|
call['held'] = false;
|
|
3024
3056
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
3025
|
-
var
|
|
3026
|
-
return _regenerator.default.wrap(function (
|
|
3027
|
-
while (1) switch (
|
|
3057
|
+
var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(correlationId) {
|
|
3058
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
3059
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
3028
3060
|
case 0:
|
|
3029
3061
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3030
3062
|
case 1:
|
|
3031
3063
|
case "end":
|
|
3032
|
-
return
|
|
3064
|
+
return _context49.stop();
|
|
3033
3065
|
}
|
|
3034
|
-
},
|
|
3066
|
+
}, _callee49);
|
|
3035
3067
|
}));
|
|
3036
3068
|
return function (_x2) {
|
|
3037
|
-
return
|
|
3069
|
+
return _ref59.apply(this, arguments);
|
|
3038
3070
|
};
|
|
3039
3071
|
}());
|
|
3040
3072
|
call.doHoldResume();
|
|
3041
|
-
|
|
3073
|
+
_context50.next = 1;
|
|
3042
3074
|
return _promise.default.resolve();
|
|
3043
3075
|
case 1:
|
|
3044
|
-
|
|
3076
|
+
_context50.next = 2;
|
|
3045
3077
|
return _promise.default.resolve();
|
|
3046
3078
|
case 2:
|
|
3047
3079
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3057,11 +3089,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3057
3089
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3058
3090
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3059
3091
|
roapEvent.data.type = 'ANSWER';
|
|
3060
|
-
|
|
3092
|
+
_context50.next = 3;
|
|
3061
3093
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3062
3094
|
case 3:
|
|
3063
3095
|
roapEvent.data.type = 'OK';
|
|
3064
|
-
|
|
3096
|
+
_context50.next = 4;
|
|
3065
3097
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3066
3098
|
case 4:
|
|
3067
3099
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3076,14 +3108,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3076
3108
|
});
|
|
3077
3109
|
case 5:
|
|
3078
3110
|
case "end":
|
|
3079
|
-
return
|
|
3111
|
+
return _context50.stop();
|
|
3080
3112
|
}
|
|
3081
|
-
},
|
|
3113
|
+
}, _callee50);
|
|
3082
3114
|
})));
|
|
3083
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3115
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
3084
3116
|
var responsePayload;
|
|
3085
|
-
return _regenerator.default.wrap(function (
|
|
3086
|
-
while (1) switch (
|
|
3117
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
3118
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
3087
3119
|
case 0:
|
|
3088
3120
|
expect.assertions(4);
|
|
3089
3121
|
responsePayload = {
|
|
@@ -3093,26 +3125,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3093
3125
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3094
3126
|
call['held'] = false;
|
|
3095
3127
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
3096
|
-
var
|
|
3097
|
-
return _regenerator.default.wrap(function (
|
|
3098
|
-
while (1) switch (
|
|
3128
|
+
var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
|
|
3129
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
3130
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
3099
3131
|
case 0:
|
|
3100
3132
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3101
3133
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3102
3134
|
case 1:
|
|
3103
3135
|
case "end":
|
|
3104
|
-
return
|
|
3136
|
+
return _context51.stop();
|
|
3105
3137
|
}
|
|
3106
|
-
},
|
|
3138
|
+
}, _callee51);
|
|
3107
3139
|
}));
|
|
3108
3140
|
return function (_x3) {
|
|
3109
|
-
return
|
|
3141
|
+
return _ref61.apply(this, arguments);
|
|
3110
3142
|
};
|
|
3111
3143
|
}());
|
|
3112
|
-
|
|
3144
|
+
_context52.next = 1;
|
|
3113
3145
|
return call.doHoldResume();
|
|
3114
3146
|
case 1:
|
|
3115
|
-
|
|
3147
|
+
_context52.next = 2;
|
|
3116
3148
|
return (0, _testUtil.flushPromises)(2);
|
|
3117
3149
|
case 2:
|
|
3118
3150
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3122,14 +3154,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3122
3154
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3123
3155
|
case 3:
|
|
3124
3156
|
case "end":
|
|
3125
|
-
return
|
|
3157
|
+
return _context52.stop();
|
|
3126
3158
|
}
|
|
3127
|
-
},
|
|
3159
|
+
}, _callee52);
|
|
3128
3160
|
})));
|
|
3129
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3161
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
3130
3162
|
var responsePayload, rejectPayload, roapEvent;
|
|
3131
|
-
return _regenerator.default.wrap(function (
|
|
3132
|
-
while (1) switch (
|
|
3163
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
3164
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
3133
3165
|
case 0:
|
|
3134
3166
|
expect.assertions(5);
|
|
3135
3167
|
responsePayload = {
|
|
@@ -3143,24 +3175,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3143
3175
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3144
3176
|
call['held'] = false;
|
|
3145
3177
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
3146
|
-
var
|
|
3147
|
-
return _regenerator.default.wrap(function (
|
|
3148
|
-
while (1) switch (
|
|
3178
|
+
var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(errObj) {
|
|
3179
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
3180
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
3149
3181
|
case 0:
|
|
3150
3182
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3151
3183
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3152
3184
|
case 1:
|
|
3153
3185
|
case "end":
|
|
3154
|
-
return
|
|
3186
|
+
return _context53.stop();
|
|
3155
3187
|
}
|
|
3156
|
-
},
|
|
3188
|
+
}, _callee53);
|
|
3157
3189
|
}));
|
|
3158
3190
|
return function (_x4) {
|
|
3159
|
-
return
|
|
3191
|
+
return _ref63.apply(this, arguments);
|
|
3160
3192
|
};
|
|
3161
3193
|
}());
|
|
3162
3194
|
call.doHoldResume();
|
|
3163
|
-
|
|
3195
|
+
_context54.next = 1;
|
|
3164
3196
|
return (0, _testUtil.flushPromises)(2);
|
|
3165
3197
|
case 1:
|
|
3166
3198
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3170,7 +3202,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3170
3202
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3171
3203
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3172
3204
|
roapEvent.data.type = 'ANSWER';
|
|
3173
|
-
|
|
3205
|
+
_context54.next = 2;
|
|
3174
3206
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3175
3207
|
case 2:
|
|
3176
3208
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3178,14 +3210,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3178
3210
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3179
3211
|
case 3:
|
|
3180
3212
|
case "end":
|
|
3181
|
-
return
|
|
3213
|
+
return _context54.stop();
|
|
3182
3214
|
}
|
|
3183
|
-
},
|
|
3215
|
+
}, _callee54);
|
|
3184
3216
|
})));
|
|
3185
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3217
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
3186
3218
|
var responsePayload, warnSpy, roapEvent;
|
|
3187
|
-
return _regenerator.default.wrap(function (
|
|
3188
|
-
while (1) switch (
|
|
3219
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
3220
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
3189
3221
|
case 0:
|
|
3190
3222
|
responsePayload = {
|
|
3191
3223
|
statusCode: 200,
|
|
@@ -3196,10 +3228,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3196
3228
|
jest.spyOn(global, 'clearTimeout');
|
|
3197
3229
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3198
3230
|
call['held'] = false;
|
|
3199
|
-
|
|
3231
|
+
_context55.next = 1;
|
|
3200
3232
|
return call.doHoldResume();
|
|
3201
3233
|
case 1:
|
|
3202
|
-
|
|
3234
|
+
_context55.next = 2;
|
|
3203
3235
|
return (0, _testUtil.flushPromises)(2);
|
|
3204
3236
|
case 2:
|
|
3205
3237
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3214,19 +3246,19 @@ describe('Supplementary Services tests', function () {
|
|
|
3214
3246
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3215
3247
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3216
3248
|
roapEvent.data.type = 'ANSWER';
|
|
3217
|
-
|
|
3249
|
+
_context55.next = 3;
|
|
3218
3250
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3219
3251
|
case 3:
|
|
3220
3252
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
3221
3253
|
statusCode: 403
|
|
3222
3254
|
});
|
|
3223
3255
|
roapEvent.data.type = 'OK';
|
|
3224
|
-
|
|
3256
|
+
_context55.next = 4;
|
|
3225
3257
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3226
3258
|
case 4:
|
|
3227
3259
|
/* this is for coverage */
|
|
3228
3260
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
3229
|
-
|
|
3261
|
+
_context55.next = 5;
|
|
3230
3262
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3231
3263
|
case 5:
|
|
3232
3264
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -3238,14 +3270,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3238
3270
|
});
|
|
3239
3271
|
case 6:
|
|
3240
3272
|
case "end":
|
|
3241
|
-
return
|
|
3273
|
+
return _context55.stop();
|
|
3242
3274
|
}
|
|
3243
|
-
},
|
|
3275
|
+
}, _callee55);
|
|
3244
3276
|
})));
|
|
3245
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3277
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
3246
3278
|
var responsePayload, warnSpy, roapEvent;
|
|
3247
|
-
return _regenerator.default.wrap(function (
|
|
3248
|
-
while (1) switch (
|
|
3279
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3280
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
3249
3281
|
case 0:
|
|
3250
3282
|
responsePayload = {
|
|
3251
3283
|
statusCode: 200,
|
|
@@ -3256,10 +3288,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3256
3288
|
jest.spyOn(global, 'clearTimeout');
|
|
3257
3289
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3258
3290
|
call['held'] = true;
|
|
3259
|
-
|
|
3291
|
+
_context56.next = 1;
|
|
3260
3292
|
return call.doHoldResume();
|
|
3261
3293
|
case 1:
|
|
3262
|
-
|
|
3294
|
+
_context56.next = 2;
|
|
3263
3295
|
return (0, _testUtil.flushPromises)(2);
|
|
3264
3296
|
case 2:
|
|
3265
3297
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3274,14 +3306,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3274
3306
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3275
3307
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3276
3308
|
roapEvent.data.type = 'ANSWER';
|
|
3277
|
-
|
|
3309
|
+
_context56.next = 3;
|
|
3278
3310
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3279
3311
|
case 3:
|
|
3280
3312
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
3281
3313
|
statusCode: 403
|
|
3282
3314
|
});
|
|
3283
3315
|
roapEvent.data.type = 'OK';
|
|
3284
|
-
|
|
3316
|
+
_context56.next = 4;
|
|
3285
3317
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3286
3318
|
case 4:
|
|
3287
3319
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3293,14 +3325,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3293
3325
|
});
|
|
3294
3326
|
case 5:
|
|
3295
3327
|
case "end":
|
|
3296
|
-
return
|
|
3328
|
+
return _context56.stop();
|
|
3297
3329
|
}
|
|
3298
|
-
},
|
|
3330
|
+
}, _callee56);
|
|
3299
3331
|
})));
|
|
3300
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3332
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
3301
3333
|
var responsePayload, roapEvent;
|
|
3302
|
-
return _regenerator.default.wrap(function (
|
|
3303
|
-
while (1) switch (
|
|
3334
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3335
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
3304
3336
|
case 0:
|
|
3305
3337
|
expect.assertions(5);
|
|
3306
3338
|
responsePayload = {
|
|
@@ -3310,25 +3342,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3310
3342
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3311
3343
|
call['held'] = false;
|
|
3312
3344
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
3313
|
-
var
|
|
3314
|
-
return _regenerator.default.wrap(function (
|
|
3315
|
-
while (1) switch (
|
|
3345
|
+
var _ref67 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(errObj) {
|
|
3346
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3347
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
3316
3348
|
case 0:
|
|
3317
3349
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3318
3350
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
3319
3351
|
case 1:
|
|
3320
3352
|
case "end":
|
|
3321
|
-
return
|
|
3353
|
+
return _context57.stop();
|
|
3322
3354
|
}
|
|
3323
|
-
},
|
|
3355
|
+
}, _callee57);
|
|
3324
3356
|
}));
|
|
3325
3357
|
return function (_x5) {
|
|
3326
|
-
return
|
|
3358
|
+
return _ref67.apply(this, arguments);
|
|
3327
3359
|
};
|
|
3328
3360
|
}());
|
|
3329
3361
|
jest.runAllTimers();
|
|
3330
3362
|
call.doHoldResume();
|
|
3331
|
-
|
|
3363
|
+
_context58.next = 1;
|
|
3332
3364
|
return (0, _testUtil.flushPromises)(2);
|
|
3333
3365
|
case 1:
|
|
3334
3366
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -3341,11 +3373,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3341
3373
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3342
3374
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3343
3375
|
roapEvent.data.type = 'ANSWER';
|
|
3344
|
-
|
|
3376
|
+
_context58.next = 2;
|
|
3345
3377
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3346
3378
|
case 2:
|
|
3347
3379
|
roapEvent.data.type = 'OK';
|
|
3348
|
-
|
|
3380
|
+
_context58.next = 3;
|
|
3349
3381
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3350
3382
|
case 3:
|
|
3351
3383
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3357,14 +3389,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3357
3389
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3358
3390
|
case 4:
|
|
3359
3391
|
case "end":
|
|
3360
|
-
return
|
|
3392
|
+
return _context58.stop();
|
|
3361
3393
|
}
|
|
3362
|
-
},
|
|
3394
|
+
}, _callee58);
|
|
3363
3395
|
})));
|
|
3364
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3396
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
3365
3397
|
var responsePayload, warnSpy, roapEvent;
|
|
3366
|
-
return _regenerator.default.wrap(function (
|
|
3367
|
-
while (1) switch (
|
|
3398
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3399
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3368
3400
|
case 0:
|
|
3369
3401
|
expect.assertions(7);
|
|
3370
3402
|
responsePayload = {
|
|
@@ -3377,25 +3409,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3377
3409
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3378
3410
|
call['held'] = true;
|
|
3379
3411
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3380
|
-
var
|
|
3381
|
-
return _regenerator.default.wrap(function (
|
|
3382
|
-
while (1) switch (
|
|
3412
|
+
var _ref69 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
|
|
3413
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3414
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3383
3415
|
case 0:
|
|
3384
3416
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3385
3417
|
case 1:
|
|
3386
3418
|
case "end":
|
|
3387
|
-
return
|
|
3419
|
+
return _context59.stop();
|
|
3388
3420
|
}
|
|
3389
|
-
},
|
|
3421
|
+
}, _callee59);
|
|
3390
3422
|
}));
|
|
3391
3423
|
return function (_x6) {
|
|
3392
|
-
return
|
|
3424
|
+
return _ref69.apply(this, arguments);
|
|
3393
3425
|
};
|
|
3394
3426
|
}());
|
|
3395
|
-
|
|
3427
|
+
_context60.next = 1;
|
|
3396
3428
|
return call.doHoldResume();
|
|
3397
3429
|
case 1:
|
|
3398
|
-
|
|
3430
|
+
_context60.next = 2;
|
|
3399
3431
|
return (0, _testUtil.flushPromises)(2);
|
|
3400
3432
|
case 2:
|
|
3401
3433
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3411,11 +3443,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3411
3443
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3412
3444
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3413
3445
|
roapEvent.data.type = 'ANSWER';
|
|
3414
|
-
|
|
3446
|
+
_context60.next = 3;
|
|
3415
3447
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3416
3448
|
case 3:
|
|
3417
3449
|
roapEvent.data.type = 'OK';
|
|
3418
|
-
|
|
3450
|
+
_context60.next = 4;
|
|
3419
3451
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3420
3452
|
case 4:
|
|
3421
3453
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3430,14 +3462,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3430
3462
|
});
|
|
3431
3463
|
case 5:
|
|
3432
3464
|
case "end":
|
|
3433
|
-
return
|
|
3465
|
+
return _context60.stop();
|
|
3434
3466
|
}
|
|
3435
|
-
},
|
|
3467
|
+
}, _callee60);
|
|
3436
3468
|
})));
|
|
3437
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3469
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
|
|
3438
3470
|
var responsePayload, warnSpy, roapEvent;
|
|
3439
|
-
return _regenerator.default.wrap(function (
|
|
3440
|
-
while (1) switch (
|
|
3471
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3472
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3441
3473
|
case 0:
|
|
3442
3474
|
expect.assertions(7);
|
|
3443
3475
|
responsePayload = {
|
|
@@ -3450,26 +3482,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3450
3482
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3451
3483
|
call['held'] = true;
|
|
3452
3484
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3453
|
-
var
|
|
3454
|
-
return _regenerator.default.wrap(function (
|
|
3455
|
-
while (1) switch (
|
|
3485
|
+
var _ref71 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
|
|
3486
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3487
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3456
3488
|
case 0:
|
|
3457
3489
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3458
3490
|
case 1:
|
|
3459
3491
|
case "end":
|
|
3460
|
-
return
|
|
3492
|
+
return _context61.stop();
|
|
3461
3493
|
}
|
|
3462
|
-
},
|
|
3494
|
+
}, _callee61);
|
|
3463
3495
|
}));
|
|
3464
3496
|
return function (_x7) {
|
|
3465
|
-
return
|
|
3497
|
+
return _ref71.apply(this, arguments);
|
|
3466
3498
|
};
|
|
3467
3499
|
}());
|
|
3468
3500
|
call.doHoldResume();
|
|
3469
|
-
|
|
3501
|
+
_context62.next = 1;
|
|
3470
3502
|
return _promise.default.resolve();
|
|
3471
3503
|
case 1:
|
|
3472
|
-
|
|
3504
|
+
_context62.next = 2;
|
|
3473
3505
|
return _promise.default.resolve();
|
|
3474
3506
|
case 2:
|
|
3475
3507
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3485,11 +3517,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3485
3517
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3486
3518
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3487
3519
|
roapEvent.data.type = 'ANSWER';
|
|
3488
|
-
|
|
3520
|
+
_context62.next = 3;
|
|
3489
3521
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3490
3522
|
case 3:
|
|
3491
3523
|
roapEvent.data.type = 'OK';
|
|
3492
|
-
|
|
3524
|
+
_context62.next = 4;
|
|
3493
3525
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3494
3526
|
case 4:
|
|
3495
3527
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3504,14 +3536,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3504
3536
|
});
|
|
3505
3537
|
case 5:
|
|
3506
3538
|
case "end":
|
|
3507
|
-
return
|
|
3539
|
+
return _context62.stop();
|
|
3508
3540
|
}
|
|
3509
|
-
},
|
|
3541
|
+
}, _callee62);
|
|
3510
3542
|
})));
|
|
3511
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3543
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
3512
3544
|
var responsePayload;
|
|
3513
|
-
return _regenerator.default.wrap(function (
|
|
3514
|
-
while (1) switch (
|
|
3545
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3546
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3515
3547
|
case 0:
|
|
3516
3548
|
expect.assertions(4);
|
|
3517
3549
|
responsePayload = {
|
|
@@ -3521,26 +3553,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3521
3553
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3522
3554
|
call['held'] = true;
|
|
3523
3555
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3524
|
-
var
|
|
3525
|
-
return _regenerator.default.wrap(function (
|
|
3526
|
-
while (1) switch (
|
|
3556
|
+
var _ref73 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(errObj) {
|
|
3557
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3558
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3527
3559
|
case 0:
|
|
3528
3560
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3529
3561
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3530
3562
|
case 1:
|
|
3531
3563
|
case "end":
|
|
3532
|
-
return
|
|
3564
|
+
return _context63.stop();
|
|
3533
3565
|
}
|
|
3534
|
-
},
|
|
3566
|
+
}, _callee63);
|
|
3535
3567
|
}));
|
|
3536
3568
|
return function (_x8) {
|
|
3537
|
-
return
|
|
3569
|
+
return _ref73.apply(this, arguments);
|
|
3538
3570
|
};
|
|
3539
3571
|
}());
|
|
3540
|
-
|
|
3572
|
+
_context64.next = 1;
|
|
3541
3573
|
return call.doHoldResume();
|
|
3542
3574
|
case 1:
|
|
3543
|
-
|
|
3575
|
+
_context64.next = 2;
|
|
3544
3576
|
return (0, _testUtil.flushPromises)(2);
|
|
3545
3577
|
case 2:
|
|
3546
3578
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3551,14 +3583,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3551
3583
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3552
3584
|
case 3:
|
|
3553
3585
|
case "end":
|
|
3554
|
-
return
|
|
3586
|
+
return _context64.stop();
|
|
3555
3587
|
}
|
|
3556
|
-
},
|
|
3588
|
+
}, _callee64);
|
|
3557
3589
|
})));
|
|
3558
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3590
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3559
3591
|
var responsePayload, rejectPayload, roapEvent;
|
|
3560
|
-
return _regenerator.default.wrap(function (
|
|
3561
|
-
while (1) switch (
|
|
3592
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3593
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3562
3594
|
case 0:
|
|
3563
3595
|
expect.assertions(5);
|
|
3564
3596
|
responsePayload = {
|
|
@@ -3572,24 +3604,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3572
3604
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3573
3605
|
call['held'] = true;
|
|
3574
3606
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3575
|
-
var
|
|
3576
|
-
return _regenerator.default.wrap(function (
|
|
3577
|
-
while (1) switch (
|
|
3607
|
+
var _ref75 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(errObj) {
|
|
3608
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3609
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3578
3610
|
case 0:
|
|
3579
3611
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3580
3612
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3581
3613
|
case 1:
|
|
3582
3614
|
case "end":
|
|
3583
|
-
return
|
|
3615
|
+
return _context65.stop();
|
|
3584
3616
|
}
|
|
3585
|
-
},
|
|
3617
|
+
}, _callee65);
|
|
3586
3618
|
}));
|
|
3587
3619
|
return function (_x9) {
|
|
3588
|
-
return
|
|
3620
|
+
return _ref75.apply(this, arguments);
|
|
3589
3621
|
};
|
|
3590
3622
|
}());
|
|
3591
3623
|
call.doHoldResume();
|
|
3592
|
-
|
|
3624
|
+
_context66.next = 1;
|
|
3593
3625
|
return (0, _testUtil.flushPromises)(2);
|
|
3594
3626
|
case 1:
|
|
3595
3627
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3600,7 +3632,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3600
3632
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3601
3633
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3602
3634
|
roapEvent.data.type = 'ANSWER';
|
|
3603
|
-
|
|
3635
|
+
_context66.next = 2;
|
|
3604
3636
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3605
3637
|
case 2:
|
|
3606
3638
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3608,14 +3640,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3608
3640
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3609
3641
|
case 3:
|
|
3610
3642
|
case "end":
|
|
3611
|
-
return
|
|
3643
|
+
return _context66.stop();
|
|
3612
3644
|
}
|
|
3613
|
-
},
|
|
3645
|
+
}, _callee66);
|
|
3614
3646
|
})));
|
|
3615
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3647
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
|
|
3616
3648
|
var responsePayload, roapEvent;
|
|
3617
|
-
return _regenerator.default.wrap(function (
|
|
3618
|
-
while (1) switch (
|
|
3649
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3650
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3619
3651
|
case 0:
|
|
3620
3652
|
expect.assertions(5);
|
|
3621
3653
|
responsePayload = {
|
|
@@ -3625,24 +3657,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3625
3657
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3626
3658
|
call['held'] = true;
|
|
3627
3659
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3628
|
-
var
|
|
3629
|
-
return _regenerator.default.wrap(function (
|
|
3630
|
-
while (1) switch (
|
|
3660
|
+
var _ref77 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(errObj) {
|
|
3661
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3662
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3631
3663
|
case 0:
|
|
3632
3664
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3633
3665
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3634
3666
|
case 1:
|
|
3635
3667
|
case "end":
|
|
3636
|
-
return
|
|
3668
|
+
return _context67.stop();
|
|
3637
3669
|
}
|
|
3638
|
-
},
|
|
3670
|
+
}, _callee67);
|
|
3639
3671
|
}));
|
|
3640
3672
|
return function (_x0) {
|
|
3641
|
-
return
|
|
3673
|
+
return _ref77.apply(this, arguments);
|
|
3642
3674
|
};
|
|
3643
3675
|
}());
|
|
3644
3676
|
call.doHoldResume();
|
|
3645
|
-
|
|
3677
|
+
_context68.next = 1;
|
|
3646
3678
|
return (0, _testUtil.flushPromises)(2);
|
|
3647
3679
|
case 1:
|
|
3648
3680
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3655,11 +3687,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3655
3687
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3656
3688
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3657
3689
|
roapEvent.data.type = 'ANSWER';
|
|
3658
|
-
|
|
3690
|
+
_context68.next = 2;
|
|
3659
3691
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3660
3692
|
case 2:
|
|
3661
3693
|
roapEvent.data.type = 'OK';
|
|
3662
|
-
|
|
3694
|
+
_context68.next = 3;
|
|
3663
3695
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3664
3696
|
case 3:
|
|
3665
3697
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3669,9 +3701,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3669
3701
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3670
3702
|
case 4:
|
|
3671
3703
|
case "end":
|
|
3672
|
-
return
|
|
3704
|
+
return _context68.stop();
|
|
3673
3705
|
}
|
|
3674
|
-
},
|
|
3706
|
+
}, _callee68);
|
|
3675
3707
|
})));
|
|
3676
3708
|
});
|
|
3677
3709
|
describe('Call transfer tests', function () {
|
|
@@ -3704,10 +3736,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3704
3736
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3705
3737
|
secondCall['held'] = false;
|
|
3706
3738
|
});
|
|
3707
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3739
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
|
|
3708
3740
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3709
|
-
return _regenerator.default.wrap(function (
|
|
3710
|
-
while (1) switch (
|
|
3741
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3742
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3711
3743
|
case 0:
|
|
3712
3744
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3713
3745
|
responsePayload = {
|
|
@@ -3719,41 +3751,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3719
3751
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3720
3752
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3721
3753
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3722
|
-
var
|
|
3723
|
-
return _regenerator.default.wrap(function (
|
|
3724
|
-
while (1) switch (
|
|
3754
|
+
var _ref79 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
|
|
3755
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3756
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3725
3757
|
case 0:
|
|
3726
3758
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3727
3759
|
case 1:
|
|
3728
3760
|
case "end":
|
|
3729
|
-
return
|
|
3761
|
+
return _context69.stop();
|
|
3730
3762
|
}
|
|
3731
|
-
},
|
|
3763
|
+
}, _callee69);
|
|
3732
3764
|
}));
|
|
3733
3765
|
return function (_x1) {
|
|
3734
|
-
return
|
|
3766
|
+
return _ref79.apply(this, arguments);
|
|
3735
3767
|
};
|
|
3736
3768
|
}());
|
|
3737
3769
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3738
|
-
var
|
|
3739
|
-
return _regenerator.default.wrap(function (
|
|
3740
|
-
while (1) switch (
|
|
3770
|
+
var _ref80 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70(correlationId) {
|
|
3771
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3772
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3741
3773
|
case 0:
|
|
3742
3774
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3743
3775
|
case 1:
|
|
3744
3776
|
case "end":
|
|
3745
|
-
return
|
|
3777
|
+
return _context70.stop();
|
|
3746
3778
|
}
|
|
3747
|
-
},
|
|
3779
|
+
}, _callee70);
|
|
3748
3780
|
}));
|
|
3749
3781
|
return function (_x10) {
|
|
3750
|
-
return
|
|
3782
|
+
return _ref80.apply(this, arguments);
|
|
3751
3783
|
};
|
|
3752
3784
|
}());
|
|
3753
|
-
|
|
3785
|
+
_context71.next = 1;
|
|
3754
3786
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3755
3787
|
case 1:
|
|
3756
|
-
|
|
3788
|
+
_context71.next = 2;
|
|
3757
3789
|
return (0, _testUtil.flushPromises)(2);
|
|
3758
3790
|
case 2:
|
|
3759
3791
|
expect(requestSpy).toBeCalled();
|
|
@@ -3776,14 +3808,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3776
3808
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3777
3809
|
case 3:
|
|
3778
3810
|
case "end":
|
|
3779
|
-
return
|
|
3811
|
+
return _context71.stop();
|
|
3780
3812
|
}
|
|
3781
|
-
},
|
|
3813
|
+
}, _callee71);
|
|
3782
3814
|
})));
|
|
3783
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3815
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3784
3816
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3785
|
-
return _regenerator.default.wrap(function (
|
|
3786
|
-
while (1) switch (
|
|
3817
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3818
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3787
3819
|
case 0:
|
|
3788
3820
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3789
3821
|
responsePayload = {
|
|
@@ -3795,25 +3827,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3795
3827
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3796
3828
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3797
3829
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3798
|
-
var
|
|
3799
|
-
return _regenerator.default.wrap(function (
|
|
3800
|
-
while (1) switch (
|
|
3830
|
+
var _ref82 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72(correlationId) {
|
|
3831
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3832
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3801
3833
|
case 0:
|
|
3802
3834
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3803
3835
|
case 1:
|
|
3804
3836
|
case "end":
|
|
3805
|
-
return
|
|
3837
|
+
return _context72.stop();
|
|
3806
3838
|
}
|
|
3807
|
-
},
|
|
3839
|
+
}, _callee72);
|
|
3808
3840
|
}));
|
|
3809
3841
|
return function (_x11) {
|
|
3810
|
-
return
|
|
3842
|
+
return _ref82.apply(this, arguments);
|
|
3811
3843
|
};
|
|
3812
3844
|
}());
|
|
3813
|
-
|
|
3845
|
+
_context73.next = 1;
|
|
3814
3846
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3815
3847
|
case 1:
|
|
3816
|
-
|
|
3848
|
+
_context73.next = 2;
|
|
3817
3849
|
return (0, _testUtil.flushPromises)(2);
|
|
3818
3850
|
case 2:
|
|
3819
3851
|
expect(requestSpy).toBeCalled();
|
|
@@ -3832,14 +3864,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3832
3864
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3833
3865
|
case 3:
|
|
3834
3866
|
case "end":
|
|
3835
|
-
return
|
|
3867
|
+
return _context73.stop();
|
|
3836
3868
|
}
|
|
3837
|
-
},
|
|
3869
|
+
}, _callee73);
|
|
3838
3870
|
})));
|
|
3839
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3871
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3840
3872
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3841
|
-
return _regenerator.default.wrap(function (
|
|
3842
|
-
while (1) switch (
|
|
3873
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3874
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3843
3875
|
case 0:
|
|
3844
3876
|
responsePayload = {
|
|
3845
3877
|
statusCode: 403,
|
|
@@ -3850,10 +3882,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3850
3882
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3851
3883
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3852
3884
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3853
|
-
|
|
3885
|
+
_context74.next = 1;
|
|
3854
3886
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3855
3887
|
case 1:
|
|
3856
|
-
|
|
3888
|
+
_context74.next = 2;
|
|
3857
3889
|
return (0, _testUtil.flushPromises)(1);
|
|
3858
3890
|
case 2:
|
|
3859
3891
|
expect(requestSpy).toBeCalled();
|
|
@@ -3874,14 +3906,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3874
3906
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3875
3907
|
case 3:
|
|
3876
3908
|
case "end":
|
|
3877
|
-
return
|
|
3909
|
+
return _context74.stop();
|
|
3878
3910
|
}
|
|
3879
|
-
},
|
|
3911
|
+
}, _callee74);
|
|
3880
3912
|
})));
|
|
3881
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3913
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
|
|
3882
3914
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3883
|
-
return _regenerator.default.wrap(function (
|
|
3884
|
-
while (1) switch (
|
|
3915
|
+
return _regenerator.default.wrap(function (_context75) {
|
|
3916
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
3885
3917
|
case 0:
|
|
3886
3918
|
responsePayload = {
|
|
3887
3919
|
statusCode: 403,
|
|
@@ -3891,10 +3923,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3891
3923
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3892
3924
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3893
3925
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3894
|
-
|
|
3926
|
+
_context75.next = 1;
|
|
3895
3927
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3896
3928
|
case 1:
|
|
3897
|
-
|
|
3929
|
+
_context75.next = 2;
|
|
3898
3930
|
return (0, _testUtil.flushPromises)(2);
|
|
3899
3931
|
case 2:
|
|
3900
3932
|
expect(requestSpy).toBeCalled();
|
|
@@ -3915,18 +3947,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3915
3947
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3916
3948
|
case 3:
|
|
3917
3949
|
case "end":
|
|
3918
|
-
return
|
|
3950
|
+
return _context75.stop();
|
|
3919
3951
|
}
|
|
3920
|
-
},
|
|
3952
|
+
}, _callee75);
|
|
3921
3953
|
})));
|
|
3922
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3954
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee76() {
|
|
3923
3955
|
var requestSpy, warnSpy;
|
|
3924
|
-
return _regenerator.default.wrap(function (
|
|
3925
|
-
while (1) switch (
|
|
3956
|
+
return _regenerator.default.wrap(function (_context76) {
|
|
3957
|
+
while (1) switch (_context76.prev = _context76.next) {
|
|
3926
3958
|
case 0:
|
|
3927
3959
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3928
3960
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3929
|
-
|
|
3961
|
+
_context76.next = 1;
|
|
3930
3962
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3931
3963
|
case 1:
|
|
3932
3964
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3938,18 +3970,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3938
3970
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3939
3971
|
case 2:
|
|
3940
3972
|
case "end":
|
|
3941
|
-
return
|
|
3973
|
+
return _context76.stop();
|
|
3942
3974
|
}
|
|
3943
|
-
},
|
|
3975
|
+
}, _callee76);
|
|
3944
3976
|
})));
|
|
3945
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3977
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee77() {
|
|
3946
3978
|
var requestSpy, warnSpy;
|
|
3947
|
-
return _regenerator.default.wrap(function (
|
|
3948
|
-
while (1) switch (
|
|
3979
|
+
return _regenerator.default.wrap(function (_context77) {
|
|
3980
|
+
while (1) switch (_context77.prev = _context77.next) {
|
|
3949
3981
|
case 0:
|
|
3950
3982
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3951
3983
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3952
|
-
|
|
3984
|
+
_context77.next = 1;
|
|
3953
3985
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3954
3986
|
case 1:
|
|
3955
3987
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3961,9 +3993,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3961
3993
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3962
3994
|
case 2:
|
|
3963
3995
|
case "end":
|
|
3964
|
-
return
|
|
3996
|
+
return _context77.stop();
|
|
3965
3997
|
}
|
|
3966
|
-
},
|
|
3998
|
+
}, _callee77);
|
|
3967
3999
|
})));
|
|
3968
4000
|
});
|
|
3969
4001
|
});
|