@webex/calling 3.12.0-mobius-socket.20 → 3.12.0-mobius-socket.22
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/CallingClient.js +108 -64
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +55 -64
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +21 -0
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +542 -447
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +5 -2
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/common/Utils.js +2 -4
- package/dist/common/Utils.js.map +1 -1
- package/dist/module/CallingClient/CallingClient.js +43 -12
- package/dist/module/CallingClient/calling/call.js +15 -0
- package/dist/module/CallingClient/constants.js +2 -0
- package/dist/module/common/Utils.js +1 -4
- package/dist/types/CallingClient/CallingClient.d.ts +2 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +1 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +1 -0
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/package.json +11 -13
|
@@ -10,6 +10,7 @@ var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/objec
|
|
|
10
10
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
11
11
|
var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
|
|
12
12
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
13
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
13
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
14
15
|
var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
15
16
|
var _mediaHelpers = require("@webex/media-helpers");
|
|
@@ -441,10 +442,104 @@ describe('Call Tests', function () {
|
|
|
441
442
|
}
|
|
442
443
|
}, _callee8);
|
|
443
444
|
})));
|
|
444
|
-
it('
|
|
445
|
-
var
|
|
445
|
+
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
446
|
+
var _mock$calls$find;
|
|
447
|
+
var mockStream, localAudioStream, call, handleOutgoingCallConnectSpy, delayedOffer, sendCallStateMachineEvtSpy, sendMediaStateMachineEvtSpy, roapListener;
|
|
446
448
|
return _regenerator.default.wrap(function (_context9) {
|
|
447
449
|
while (1) switch (_context9.prev = _context9.next) {
|
|
450
|
+
case 0:
|
|
451
|
+
mockStream = {
|
|
452
|
+
outputStream: {
|
|
453
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
454
|
+
},
|
|
455
|
+
on: jest.fn(),
|
|
456
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
457
|
+
return mockEffect;
|
|
458
|
+
})
|
|
459
|
+
};
|
|
460
|
+
localAudioStream = mockStream;
|
|
461
|
+
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.INBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
462
|
+
webex.request.mockReturnValue({
|
|
463
|
+
statusCode: 200,
|
|
464
|
+
body: {
|
|
465
|
+
callId: 'mock-call-id'
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
call.sendCallStateMachineEvt({
|
|
469
|
+
type: 'E_RECV_CALL_SETUP',
|
|
470
|
+
data: {
|
|
471
|
+
seq: 1,
|
|
472
|
+
messageType: 'OFFER'
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
476
|
+
_context9.next = 1;
|
|
477
|
+
return call.answer(localAudioStream);
|
|
478
|
+
case 1:
|
|
479
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
480
|
+
|
|
481
|
+
// Connect is attempted by answer(), but is deferred because offer is not buffered yet.
|
|
482
|
+
handleOutgoingCallConnectSpy = jest.spyOn(call, 'handleOutgoingCallConnect');
|
|
483
|
+
expect(call['connectPending']).toBe(true);
|
|
484
|
+
expect(call['mediaConnection'].roapMessageReceived).not.toHaveBeenCalled();
|
|
485
|
+
delayedOffer = {
|
|
486
|
+
seq: 1,
|
|
487
|
+
messageType: 'OFFER',
|
|
488
|
+
sdp: 'v=0',
|
|
489
|
+
version: 1
|
|
490
|
+
};
|
|
491
|
+
call.sendMediaStateMachineEvt({
|
|
492
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
493
|
+
data: delayedOffer
|
|
494
|
+
});
|
|
495
|
+
_context9.next = 2;
|
|
496
|
+
return (0, _testUtil.flushPromises)(2);
|
|
497
|
+
case 2:
|
|
498
|
+
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenCalledWith(delayedOffer);
|
|
499
|
+
sendCallStateMachineEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
500
|
+
sendMediaStateMachineEvtSpy = jest.spyOn(call, 'sendMediaStateMachineEvt');
|
|
501
|
+
roapListener = (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (_ref0) {
|
|
502
|
+
var _ref1 = (0, _slicedToArray2.default)(_ref0, 1),
|
|
503
|
+
eventName = _ref1[0];
|
|
504
|
+
return eventName === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND;
|
|
505
|
+
})) === null || _mock$calls$find === void 0 ? void 0 : _mock$calls$find[1];
|
|
506
|
+
expect(roapListener).toBeDefined();
|
|
507
|
+
_context9.next = 3;
|
|
508
|
+
return roapListener({
|
|
509
|
+
roapMessage: {
|
|
510
|
+
messageType: 'ANSWER',
|
|
511
|
+
sdp: 'v=0',
|
|
512
|
+
seq: 1,
|
|
513
|
+
version: 2
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
case 3:
|
|
517
|
+
_context9.next = 4;
|
|
518
|
+
return (0, _testUtil.flushPromises)(2);
|
|
519
|
+
case 4:
|
|
520
|
+
// On ANSWER from media layer, connect is retried first, then ROAP answer is posted.
|
|
521
|
+
expect(sendCallStateMachineEvtSpy).toHaveBeenNthCalledWith(1, {
|
|
522
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
523
|
+
});
|
|
524
|
+
expect(sendMediaStateMachineEvtSpy).toHaveBeenNthCalledWith(1, {
|
|
525
|
+
type: 'E_SEND_ROAP_ANSWER',
|
|
526
|
+
data: expect.objectContaining({
|
|
527
|
+
messageType: 'ANSWER'
|
|
528
|
+
})
|
|
529
|
+
});
|
|
530
|
+
expect(handleOutgoingCallConnectSpy).toHaveBeenCalled();
|
|
531
|
+
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenLastCalledWith(delayedOffer);
|
|
532
|
+
expect(call['connectPending']).toBe(false);
|
|
533
|
+
case 5:
|
|
534
|
+
case "end":
|
|
535
|
+
return _context9.stop();
|
|
536
|
+
}
|
|
537
|
+
}, _callee9);
|
|
538
|
+
})));
|
|
539
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
540
|
+
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
541
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
542
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
448
543
|
case 0:
|
|
449
544
|
mockStream = {
|
|
450
545
|
outputStream: {
|
|
@@ -500,7 +595,7 @@ describe('Call Tests', function () {
|
|
|
500
595
|
});
|
|
501
596
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
502
597
|
call.end();
|
|
503
|
-
|
|
598
|
+
_context0.next = 1;
|
|
504
599
|
return (0, _Utils.waitForMsecs)(50);
|
|
505
600
|
case 1:
|
|
506
601
|
/* Checks for switching off the listeners on call disconnect */
|
|
@@ -511,14 +606,14 @@ describe('Call Tests', function () {
|
|
|
511
606
|
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
512
607
|
case 2:
|
|
513
608
|
case "end":
|
|
514
|
-
return
|
|
609
|
+
return _context0.stop();
|
|
515
610
|
}
|
|
516
|
-
},
|
|
611
|
+
}, _callee0);
|
|
517
612
|
})));
|
|
518
|
-
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
613
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
519
614
|
var mockStream, localAudioStream, warnSpy, call;
|
|
520
|
-
return _regenerator.default.wrap(function (
|
|
521
|
-
while (1) switch (
|
|
615
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
616
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
522
617
|
case 0:
|
|
523
618
|
mockStream = {
|
|
524
619
|
outputStream: {
|
|
@@ -542,7 +637,7 @@ describe('Call Tests', function () {
|
|
|
542
637
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
543
638
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
544
639
|
call.answer(localAudioStream);
|
|
545
|
-
|
|
640
|
+
_context1.next = 1;
|
|
546
641
|
return (0, _Utils.waitForMsecs)(50);
|
|
547
642
|
case 1:
|
|
548
643
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -557,14 +652,14 @@ describe('Call Tests', function () {
|
|
|
557
652
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
558
653
|
case 2:
|
|
559
654
|
case "end":
|
|
560
|
-
return
|
|
655
|
+
return _context1.stop();
|
|
561
656
|
}
|
|
562
|
-
},
|
|
657
|
+
}, _callee1);
|
|
563
658
|
})));
|
|
564
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
659
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
565
660
|
var mockStream, localAudioStream, warnSpy, call;
|
|
566
|
-
return _regenerator.default.wrap(function (
|
|
567
|
-
while (1) switch (
|
|
661
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
662
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
568
663
|
case 0:
|
|
569
664
|
mockStream = {
|
|
570
665
|
outputStream: {
|
|
@@ -576,7 +671,7 @@ describe('Call Tests', function () {
|
|
|
576
671
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
577
672
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
578
673
|
call.dial(localAudioStream);
|
|
579
|
-
|
|
674
|
+
_context10.next = 1;
|
|
580
675
|
return (0, _Utils.waitForMsecs)(50);
|
|
581
676
|
case 1:
|
|
582
677
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -589,9 +684,9 @@ describe('Call Tests', function () {
|
|
|
589
684
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
590
685
|
case 2:
|
|
591
686
|
case "end":
|
|
592
|
-
return
|
|
687
|
+
return _context10.stop();
|
|
593
688
|
}
|
|
594
|
-
},
|
|
689
|
+
}, _callee10);
|
|
595
690
|
})));
|
|
596
691
|
it('update media after call creation with valid stream', function () {
|
|
597
692
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -665,10 +760,10 @@ describe('Call Tests', function () {
|
|
|
665
760
|
method: 'dial'
|
|
666
761
|
});
|
|
667
762
|
});
|
|
668
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
763
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
669
764
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
670
|
-
return _regenerator.default.wrap(function (
|
|
671
|
-
while (1) switch (
|
|
765
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
766
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
672
767
|
case 0:
|
|
673
768
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
674
769
|
webex.request.mockReturnValue({
|
|
@@ -744,9 +839,9 @@ describe('Call Tests', function () {
|
|
|
744
839
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
745
840
|
case 1:
|
|
746
841
|
case "end":
|
|
747
|
-
return
|
|
842
|
+
return _context11.stop();
|
|
748
843
|
}
|
|
749
|
-
},
|
|
844
|
+
}, _callee11);
|
|
750
845
|
})));
|
|
751
846
|
describe('Guest Calling Flow Tests', function () {
|
|
752
847
|
var dummyEvent = {
|
|
@@ -754,10 +849,10 @@ describe('Call Tests', function () {
|
|
|
754
849
|
data: undefined
|
|
755
850
|
};
|
|
756
851
|
var call;
|
|
757
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
852
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
758
853
|
var requestSpy, requestArgs;
|
|
759
|
-
return _regenerator.default.wrap(function (
|
|
760
|
-
while (1) switch (
|
|
854
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
855
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
761
856
|
case 0:
|
|
762
857
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
763
858
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -770,14 +865,14 @@ describe('Call Tests', function () {
|
|
|
770
865
|
expect('callee' in requestArgs.body).toBe(true);
|
|
771
866
|
case 1:
|
|
772
867
|
case "end":
|
|
773
|
-
return
|
|
868
|
+
return _context12.stop();
|
|
774
869
|
}
|
|
775
|
-
},
|
|
870
|
+
}, _callee12);
|
|
776
871
|
})));
|
|
777
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
872
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
778
873
|
var requestSpy, requestArgs;
|
|
779
|
-
return _regenerator.default.wrap(function (
|
|
780
|
-
while (1) switch (
|
|
874
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
875
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
781
876
|
case 0:
|
|
782
877
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
783
878
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -790,9 +885,9 @@ describe('Call Tests', function () {
|
|
|
790
885
|
expect('callee' in requestArgs.body).toBe(false);
|
|
791
886
|
case 1:
|
|
792
887
|
case "end":
|
|
793
|
-
return
|
|
888
|
+
return _context13.stop();
|
|
794
889
|
}
|
|
795
|
-
},
|
|
890
|
+
}, _callee13);
|
|
796
891
|
})));
|
|
797
892
|
});
|
|
798
893
|
});
|
|
@@ -830,10 +925,10 @@ describe('State Machine handler tests', function () {
|
|
|
830
925
|
|
|
831
926
|
// afterEach(() => call.removeAllListeners());
|
|
832
927
|
|
|
833
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
928
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
834
929
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
835
|
-
return _regenerator.default.wrap(function (
|
|
836
|
-
while (1) switch (
|
|
930
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
931
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
837
932
|
case 0:
|
|
838
933
|
statusPayload = {
|
|
839
934
|
statusCode: 200,
|
|
@@ -853,7 +948,7 @@ describe('State Machine handler tests', function () {
|
|
|
853
948
|
/* This is to flush all the promises from the Promise queue so that
|
|
854
949
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
855
950
|
*/
|
|
856
|
-
|
|
951
|
+
_context14.next = 1;
|
|
857
952
|
return (0, _testUtil.flushPromises)(3);
|
|
858
953
|
case 1:
|
|
859
954
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -869,14 +964,14 @@ describe('State Machine handler tests', function () {
|
|
|
869
964
|
});
|
|
870
965
|
case 2:
|
|
871
966
|
case "end":
|
|
872
|
-
return
|
|
967
|
+
return _context14.stop();
|
|
873
968
|
}
|
|
874
|
-
},
|
|
969
|
+
}, _callee14);
|
|
875
970
|
})));
|
|
876
|
-
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
971
|
+
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
877
972
|
var statusPayload, emitSpy, funcSpy;
|
|
878
|
-
return _regenerator.default.wrap(function (
|
|
879
|
-
while (1) switch (
|
|
973
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
974
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
880
975
|
case 0:
|
|
881
976
|
expect.assertions(4);
|
|
882
977
|
statusPayload = {
|
|
@@ -891,10 +986,10 @@ describe('State Machine handler tests', function () {
|
|
|
891
986
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
892
987
|
call['handleCallEstablished']({});
|
|
893
988
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
894
|
-
|
|
989
|
+
_context15.next = 1;
|
|
895
990
|
return _promise.default.resolve();
|
|
896
991
|
case 1:
|
|
897
|
-
|
|
992
|
+
_context15.next = 2;
|
|
898
993
|
return _promise.default.resolve();
|
|
899
994
|
case 2:
|
|
900
995
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -904,14 +999,14 @@ describe('State Machine handler tests', function () {
|
|
|
904
999
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
905
1000
|
case 3:
|
|
906
1001
|
case "end":
|
|
907
|
-
return
|
|
1002
|
+
return _context15.stop();
|
|
908
1003
|
}
|
|
909
|
-
},
|
|
1004
|
+
}, _callee15);
|
|
910
1005
|
})));
|
|
911
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1006
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
912
1007
|
var statusPayload, funcSpy;
|
|
913
|
-
return _regenerator.default.wrap(function (
|
|
914
|
-
while (1) switch (
|
|
1008
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1009
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
915
1010
|
case 0:
|
|
916
1011
|
expect.assertions(4);
|
|
917
1012
|
statusPayload = {
|
|
@@ -930,7 +1025,7 @@ describe('State Machine handler tests', function () {
|
|
|
930
1025
|
/* This is to flush all the promises from the Promise queue so that
|
|
931
1026
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
932
1027
|
*/
|
|
933
|
-
|
|
1028
|
+
_context16.next = 1;
|
|
934
1029
|
return (0, _testUtil.flushPromises)(2);
|
|
935
1030
|
case 1:
|
|
936
1031
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -939,14 +1034,14 @@ describe('State Machine handler tests', function () {
|
|
|
939
1034
|
expect(funcSpy).toBeCalledTimes(1);
|
|
940
1035
|
case 2:
|
|
941
1036
|
case "end":
|
|
942
|
-
return
|
|
1037
|
+
return _context16.stop();
|
|
943
1038
|
}
|
|
944
|
-
},
|
|
1039
|
+
}, _callee16);
|
|
945
1040
|
})));
|
|
946
|
-
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1041
|
+
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
947
1042
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
948
|
-
return _regenerator.default.wrap(function (
|
|
949
|
-
while (1) switch (
|
|
1043
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1044
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
950
1045
|
case 0:
|
|
951
1046
|
errorPayload = {
|
|
952
1047
|
statusCode: 500,
|
|
@@ -964,28 +1059,28 @@ describe('State Machine handler tests', function () {
|
|
|
964
1059
|
call['handleCallEstablished']({});
|
|
965
1060
|
}
|
|
966
1061
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
967
|
-
|
|
1062
|
+
_context17.next = 1;
|
|
968
1063
|
return (0, _testUtil.flushPromises)(2);
|
|
969
1064
|
case 1:
|
|
970
1065
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
971
1066
|
|
|
972
1067
|
// Now advance by 1 second for the retry-after interval
|
|
973
1068
|
jest.advanceTimersByTime(1000);
|
|
974
|
-
|
|
1069
|
+
_context17.next = 2;
|
|
975
1070
|
return (0, _testUtil.flushPromises)(2);
|
|
976
1071
|
case 2:
|
|
977
1072
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
978
1073
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
979
1074
|
case 3:
|
|
980
1075
|
case "end":
|
|
981
|
-
return
|
|
1076
|
+
return _context17.stop();
|
|
982
1077
|
}
|
|
983
|
-
},
|
|
1078
|
+
}, _callee17);
|
|
984
1079
|
})));
|
|
985
|
-
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1080
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
986
1081
|
var firstTimer, secondTimer;
|
|
987
|
-
return _regenerator.default.wrap(function (
|
|
988
|
-
while (1) switch (
|
|
1082
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1083
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
989
1084
|
case 0:
|
|
990
1085
|
jest.spyOn(global, 'setInterval');
|
|
991
1086
|
jest.spyOn(global, 'clearInterval');
|
|
@@ -1013,14 +1108,14 @@ describe('State Machine handler tests', function () {
|
|
|
1013
1108
|
expect(secondTimer).toBeDefined();
|
|
1014
1109
|
case 1:
|
|
1015
1110
|
case "end":
|
|
1016
|
-
return
|
|
1111
|
+
return _context18.stop();
|
|
1017
1112
|
}
|
|
1018
|
-
},
|
|
1113
|
+
}, _callee18);
|
|
1019
1114
|
})));
|
|
1020
|
-
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1115
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1021
1116
|
var errorPayload, warnSpy, postStatusSpy;
|
|
1022
|
-
return _regenerator.default.wrap(function (
|
|
1023
|
-
while (1) switch (
|
|
1117
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1118
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1024
1119
|
case 0:
|
|
1025
1120
|
errorPayload = {
|
|
1026
1121
|
statusCode: 500,
|
|
@@ -1039,25 +1134,25 @@ describe('State Machine handler tests', function () {
|
|
|
1039
1134
|
|
|
1040
1135
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
1041
1136
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1042
|
-
|
|
1137
|
+
_context19.next = 1;
|
|
1043
1138
|
return (0, _testUtil.flushPromises)(2);
|
|
1044
1139
|
case 1:
|
|
1045
1140
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
1046
1141
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
1047
1142
|
jest.advanceTimersByTime(1000);
|
|
1048
|
-
|
|
1143
|
+
_context19.next = 2;
|
|
1049
1144
|
return (0, _testUtil.flushPromises)(2);
|
|
1050
1145
|
case 2:
|
|
1051
1146
|
jest.advanceTimersByTime(1000);
|
|
1052
|
-
|
|
1147
|
+
_context19.next = 3;
|
|
1053
1148
|
return (0, _testUtil.flushPromises)(2);
|
|
1054
1149
|
case 3:
|
|
1055
1150
|
jest.advanceTimersByTime(1000);
|
|
1056
|
-
|
|
1151
|
+
_context19.next = 4;
|
|
1057
1152
|
return (0, _testUtil.flushPromises)(2);
|
|
1058
1153
|
case 4:
|
|
1059
1154
|
jest.advanceTimersByTime(1000);
|
|
1060
|
-
|
|
1155
|
+
_context19.next = 5;
|
|
1061
1156
|
return (0, _testUtil.flushPromises)(2);
|
|
1062
1157
|
case 5:
|
|
1063
1158
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1069,14 +1164,14 @@ describe('State Machine handler tests', function () {
|
|
|
1069
1164
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1070
1165
|
case 6:
|
|
1071
1166
|
case "end":
|
|
1072
|
-
return
|
|
1167
|
+
return _context19.stop();
|
|
1073
1168
|
}
|
|
1074
|
-
},
|
|
1169
|
+
}, _callee19);
|
|
1075
1170
|
})));
|
|
1076
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1171
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1077
1172
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1078
|
-
return _regenerator.default.wrap(function (
|
|
1079
|
-
while (1) switch (
|
|
1173
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1174
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1080
1175
|
case 0:
|
|
1081
1176
|
statusPayload = {
|
|
1082
1177
|
statusCode: 200,
|
|
@@ -1132,14 +1227,14 @@ describe('State Machine handler tests', function () {
|
|
|
1132
1227
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1133
1228
|
case 1:
|
|
1134
1229
|
case "end":
|
|
1135
|
-
return
|
|
1230
|
+
return _context20.stop();
|
|
1136
1231
|
}
|
|
1137
|
-
},
|
|
1232
|
+
}, _callee20);
|
|
1138
1233
|
})));
|
|
1139
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1234
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1140
1235
|
var statusPayload, dummyEvent;
|
|
1141
|
-
return _regenerator.default.wrap(function (
|
|
1142
|
-
while (1) switch (
|
|
1236
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1237
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1143
1238
|
case 0:
|
|
1144
1239
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1145
1240
|
statusPayload = {
|
|
@@ -1157,7 +1252,7 @@ describe('State Machine handler tests', function () {
|
|
|
1157
1252
|
webex.request.mockReturnValue(statusPayload);
|
|
1158
1253
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1159
1254
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1160
|
-
|
|
1255
|
+
_context21.next = 1;
|
|
1161
1256
|
return call['handleOutgoingCallConnect']({
|
|
1162
1257
|
type: 'E_SEND_CALL_CONNECT'
|
|
1163
1258
|
});
|
|
@@ -1171,14 +1266,14 @@ describe('State Machine handler tests', function () {
|
|
|
1171
1266
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1172
1267
|
case 2:
|
|
1173
1268
|
case "end":
|
|
1174
|
-
return
|
|
1269
|
+
return _context21.stop();
|
|
1175
1270
|
}
|
|
1176
|
-
},
|
|
1271
|
+
}, _callee21);
|
|
1177
1272
|
})));
|
|
1178
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1273
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1179
1274
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1180
|
-
return _regenerator.default.wrap(function (
|
|
1181
|
-
while (1) switch (
|
|
1275
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1276
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1182
1277
|
case 0:
|
|
1183
1278
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1184
1279
|
statusPayload = {
|
|
@@ -1272,14 +1367,14 @@ describe('State Machine handler tests', function () {
|
|
|
1272
1367
|
expect(call.earlyMedia).not.toBe(true);
|
|
1273
1368
|
case 1:
|
|
1274
1369
|
case "end":
|
|
1275
|
-
return
|
|
1370
|
+
return _context22.stop();
|
|
1276
1371
|
}
|
|
1277
|
-
},
|
|
1372
|
+
}, _callee22);
|
|
1278
1373
|
})));
|
|
1279
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1374
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1280
1375
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1281
|
-
return _regenerator.default.wrap(function (
|
|
1282
|
-
while (1) switch (
|
|
1376
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1377
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1283
1378
|
case 0:
|
|
1284
1379
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1285
1380
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1306,7 +1401,7 @@ describe('State Machine handler tests', function () {
|
|
|
1306
1401
|
webex.request.mockRejectedValueOnce({
|
|
1307
1402
|
statusCode: 403
|
|
1308
1403
|
}).mockResolvedValue(statusPayload);
|
|
1309
|
-
|
|
1404
|
+
_context23.next = 1;
|
|
1310
1405
|
return call['handleOutgoingCallConnect']({
|
|
1311
1406
|
type: 'E_SEND_CALL_CONNECT'
|
|
1312
1407
|
});
|
|
@@ -1317,14 +1412,14 @@ describe('State Machine handler tests', function () {
|
|
|
1317
1412
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1318
1413
|
case 2:
|
|
1319
1414
|
case "end":
|
|
1320
|
-
return
|
|
1415
|
+
return _context23.stop();
|
|
1321
1416
|
}
|
|
1322
|
-
},
|
|
1417
|
+
}, _callee23);
|
|
1323
1418
|
})));
|
|
1324
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1419
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1325
1420
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1326
|
-
return _regenerator.default.wrap(function (
|
|
1327
|
-
while (1) switch (
|
|
1421
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1422
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1328
1423
|
case 0:
|
|
1329
1424
|
statusPayload = {
|
|
1330
1425
|
statusCode: 200,
|
|
@@ -1400,14 +1495,14 @@ describe('State Machine handler tests', function () {
|
|
|
1400
1495
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1401
1496
|
case 1:
|
|
1402
1497
|
case "end":
|
|
1403
|
-
return
|
|
1498
|
+
return _context24.stop();
|
|
1404
1499
|
}
|
|
1405
|
-
},
|
|
1500
|
+
}, _callee24);
|
|
1406
1501
|
})));
|
|
1407
|
-
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
|
|
1502
|
+
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 _callee25() {
|
|
1408
1503
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1409
|
-
return _regenerator.default.wrap(function (
|
|
1410
|
-
while (1) switch (
|
|
1504
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1505
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1411
1506
|
case 0:
|
|
1412
1507
|
statusPayload = {
|
|
1413
1508
|
statusCode: 200,
|
|
@@ -1475,14 +1570,14 @@ describe('State Machine handler tests', function () {
|
|
|
1475
1570
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1476
1571
|
case 1:
|
|
1477
1572
|
case "end":
|
|
1478
|
-
return
|
|
1573
|
+
return _context25.stop();
|
|
1479
1574
|
}
|
|
1480
|
-
},
|
|
1575
|
+
}, _callee25);
|
|
1481
1576
|
})));
|
|
1482
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1577
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1483
1578
|
var statusPayload, dummyEvent;
|
|
1484
|
-
return _regenerator.default.wrap(function (
|
|
1485
|
-
while (1) switch (
|
|
1579
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1580
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1486
1581
|
case 0:
|
|
1487
1582
|
statusPayload = {
|
|
1488
1583
|
statusCode: 200,
|
|
@@ -1521,14 +1616,14 @@ describe('State Machine handler tests', function () {
|
|
|
1521
1616
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1522
1617
|
case 1:
|
|
1523
1618
|
case "end":
|
|
1524
|
-
return
|
|
1619
|
+
return _context26.stop();
|
|
1525
1620
|
}
|
|
1526
|
-
},
|
|
1621
|
+
}, _callee26);
|
|
1527
1622
|
})));
|
|
1528
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1623
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1529
1624
|
var statusPayload, dummyEvent, errorSpy;
|
|
1530
|
-
return _regenerator.default.wrap(function (
|
|
1531
|
-
while (1) switch (
|
|
1625
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1626
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1532
1627
|
case 0:
|
|
1533
1628
|
statusPayload = {
|
|
1534
1629
|
statusCode: 403,
|
|
@@ -1545,13 +1640,13 @@ describe('State Machine handler tests', function () {
|
|
|
1545
1640
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1546
1641
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1547
1642
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1548
|
-
|
|
1643
|
+
_context27.next = 1;
|
|
1549
1644
|
return (0, _testUtil.flushPromises)(3);
|
|
1550
1645
|
case 1:
|
|
1551
|
-
|
|
1646
|
+
_context27.next = 2;
|
|
1552
1647
|
return _promise.default.resolve();
|
|
1553
1648
|
case 2:
|
|
1554
|
-
|
|
1649
|
+
_context27.next = 3;
|
|
1555
1650
|
return _promise.default.resolve();
|
|
1556
1651
|
case 3:
|
|
1557
1652
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
@@ -1562,14 +1657,14 @@ describe('State Machine handler tests', function () {
|
|
|
1562
1657
|
});
|
|
1563
1658
|
case 4:
|
|
1564
1659
|
case "end":
|
|
1565
|
-
return
|
|
1660
|
+
return _context27.stop();
|
|
1566
1661
|
}
|
|
1567
|
-
},
|
|
1662
|
+
}, _callee27);
|
|
1568
1663
|
})));
|
|
1569
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1664
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1570
1665
|
var statusPayload, dummyEvent, warnSpy;
|
|
1571
|
-
return _regenerator.default.wrap(function (
|
|
1572
|
-
while (1) switch (
|
|
1666
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1667
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1573
1668
|
case 0:
|
|
1574
1669
|
statusPayload = {
|
|
1575
1670
|
statusCode: 403,
|
|
@@ -1588,16 +1683,16 @@ describe('State Machine handler tests', function () {
|
|
|
1588
1683
|
webex.request.mockRejectedValue(statusPayload);
|
|
1589
1684
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1590
1685
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1591
|
-
|
|
1686
|
+
_context28.next = 1;
|
|
1592
1687
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1593
1688
|
case 1:
|
|
1594
|
-
|
|
1689
|
+
_context28.next = 2;
|
|
1595
1690
|
return (0, _testUtil.flushPromises)(2);
|
|
1596
1691
|
case 2:
|
|
1597
|
-
|
|
1692
|
+
_context28.next = 3;
|
|
1598
1693
|
return _promise.default.resolve();
|
|
1599
1694
|
case 3:
|
|
1600
|
-
|
|
1695
|
+
_context28.next = 4;
|
|
1601
1696
|
return _promise.default.resolve();
|
|
1602
1697
|
case 4:
|
|
1603
1698
|
expect(call.isConnected()).toBe(false);
|
|
@@ -1613,14 +1708,14 @@ describe('State Machine handler tests', function () {
|
|
|
1613
1708
|
});
|
|
1614
1709
|
case 5:
|
|
1615
1710
|
case "end":
|
|
1616
|
-
return
|
|
1711
|
+
return _context28.stop();
|
|
1617
1712
|
}
|
|
1618
|
-
},
|
|
1713
|
+
}, _callee28);
|
|
1619
1714
|
})));
|
|
1620
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1715
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1621
1716
|
var statusPayload, dummyEvent;
|
|
1622
|
-
return _regenerator.default.wrap(function (
|
|
1623
|
-
while (1) switch (
|
|
1717
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1718
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1624
1719
|
case 0:
|
|
1625
1720
|
statusPayload = {
|
|
1626
1721
|
statusCode: 403,
|
|
@@ -1643,14 +1738,14 @@ describe('State Machine handler tests', function () {
|
|
|
1643
1738
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1644
1739
|
case 1:
|
|
1645
1740
|
case "end":
|
|
1646
|
-
return
|
|
1741
|
+
return _context29.stop();
|
|
1647
1742
|
}
|
|
1648
|
-
},
|
|
1743
|
+
}, _callee29);
|
|
1649
1744
|
})));
|
|
1650
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1745
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1651
1746
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1652
|
-
return _regenerator.default.wrap(function (
|
|
1653
|
-
while (1) switch (
|
|
1747
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1748
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1654
1749
|
case 0:
|
|
1655
1750
|
statusPayload = {
|
|
1656
1751
|
statusCode: 503,
|
|
@@ -1672,7 +1767,7 @@ describe('State Machine handler tests', function () {
|
|
|
1672
1767
|
}
|
|
1673
1768
|
};
|
|
1674
1769
|
call['connected'] = true;
|
|
1675
|
-
|
|
1770
|
+
_context30.next = 1;
|
|
1676
1771
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1677
1772
|
case 1:
|
|
1678
1773
|
jest.advanceTimersByTime(1005);
|
|
@@ -1684,14 +1779,14 @@ describe('State Machine handler tests', function () {
|
|
|
1684
1779
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1685
1780
|
case 2:
|
|
1686
1781
|
case "end":
|
|
1687
|
-
return
|
|
1782
|
+
return _context30.stop();
|
|
1688
1783
|
}
|
|
1689
|
-
},
|
|
1784
|
+
}, _callee30);
|
|
1690
1785
|
})));
|
|
1691
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1786
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1692
1787
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1693
|
-
return _regenerator.default.wrap(function (
|
|
1694
|
-
while (1) switch (
|
|
1788
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1789
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1695
1790
|
case 0:
|
|
1696
1791
|
statusPayload = {
|
|
1697
1792
|
statusCode: 503,
|
|
@@ -1713,7 +1808,7 @@ describe('State Machine handler tests', function () {
|
|
|
1713
1808
|
}
|
|
1714
1809
|
};
|
|
1715
1810
|
call['connected'] = false;
|
|
1716
|
-
|
|
1811
|
+
_context31.next = 1;
|
|
1717
1812
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1718
1813
|
case 1:
|
|
1719
1814
|
jest.advanceTimersByTime(1005);
|
|
@@ -1724,14 +1819,14 @@ describe('State Machine handler tests', function () {
|
|
|
1724
1819
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1725
1820
|
case 2:
|
|
1726
1821
|
case "end":
|
|
1727
|
-
return
|
|
1822
|
+
return _context31.stop();
|
|
1728
1823
|
}
|
|
1729
|
-
},
|
|
1824
|
+
}, _callee31);
|
|
1730
1825
|
})));
|
|
1731
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1826
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1732
1827
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1733
|
-
return _regenerator.default.wrap(function (
|
|
1734
|
-
while (1) switch (
|
|
1828
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
1829
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1735
1830
|
case 0:
|
|
1736
1831
|
statusPayload = {
|
|
1737
1832
|
statusCode: 503,
|
|
@@ -1753,7 +1848,7 @@ describe('State Machine handler tests', function () {
|
|
|
1753
1848
|
};
|
|
1754
1849
|
call['connected'] = true;
|
|
1755
1850
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1756
|
-
|
|
1851
|
+
_context32.next = 1;
|
|
1757
1852
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1758
1853
|
case 1:
|
|
1759
1854
|
jest.advanceTimersByTime(1005);
|
|
@@ -1765,14 +1860,14 @@ describe('State Machine handler tests', function () {
|
|
|
1765
1860
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1766
1861
|
case 2:
|
|
1767
1862
|
case "end":
|
|
1768
|
-
return
|
|
1863
|
+
return _context32.stop();
|
|
1769
1864
|
}
|
|
1770
|
-
},
|
|
1865
|
+
}, _callee32);
|
|
1771
1866
|
})));
|
|
1772
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1867
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1773
1868
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1774
|
-
return _regenerator.default.wrap(function (
|
|
1775
|
-
while (1) switch (
|
|
1869
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
1870
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1776
1871
|
case 0:
|
|
1777
1872
|
statusPayload = {
|
|
1778
1873
|
statusCode: 503,
|
|
@@ -1793,7 +1888,7 @@ describe('State Machine handler tests', function () {
|
|
|
1793
1888
|
}
|
|
1794
1889
|
};
|
|
1795
1890
|
call['connected'] = false;
|
|
1796
|
-
|
|
1891
|
+
_context33.next = 1;
|
|
1797
1892
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1798
1893
|
case 1:
|
|
1799
1894
|
jest.advanceTimersByTime(1005);
|
|
@@ -1805,14 +1900,14 @@ describe('State Machine handler tests', function () {
|
|
|
1805
1900
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1806
1901
|
case 2:
|
|
1807
1902
|
case "end":
|
|
1808
|
-
return
|
|
1903
|
+
return _context33.stop();
|
|
1809
1904
|
}
|
|
1810
|
-
},
|
|
1905
|
+
}, _callee33);
|
|
1811
1906
|
})));
|
|
1812
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1907
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1813
1908
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1814
|
-
return _regenerator.default.wrap(function (
|
|
1815
|
-
while (1) switch (
|
|
1909
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
1910
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1816
1911
|
case 0:
|
|
1817
1912
|
statusPayload = {
|
|
1818
1913
|
statusCode: 200,
|
|
@@ -1837,14 +1932,14 @@ describe('State Machine handler tests', function () {
|
|
|
1837
1932
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1838
1933
|
case 1:
|
|
1839
1934
|
case "end":
|
|
1840
|
-
return
|
|
1935
|
+
return _context34.stop();
|
|
1841
1936
|
}
|
|
1842
|
-
},
|
|
1937
|
+
}, _callee34);
|
|
1843
1938
|
})));
|
|
1844
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1939
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1845
1940
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1846
|
-
return _regenerator.default.wrap(function (
|
|
1847
|
-
while (1) switch (
|
|
1941
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
1942
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1848
1943
|
case 0:
|
|
1849
1944
|
statusPayload = {
|
|
1850
1945
|
statusCode: 503,
|
|
@@ -1866,7 +1961,7 @@ describe('State Machine handler tests', function () {
|
|
|
1866
1961
|
};
|
|
1867
1962
|
call['connected'] = true;
|
|
1868
1963
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1869
|
-
|
|
1964
|
+
_context35.next = 1;
|
|
1870
1965
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1871
1966
|
case 1:
|
|
1872
1967
|
jest.advanceTimersByTime(1005);
|
|
@@ -1878,14 +1973,14 @@ describe('State Machine handler tests', function () {
|
|
|
1878
1973
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1879
1974
|
case 2:
|
|
1880
1975
|
case "end":
|
|
1881
|
-
return
|
|
1976
|
+
return _context35.stop();
|
|
1882
1977
|
}
|
|
1883
|
-
},
|
|
1978
|
+
}, _callee35);
|
|
1884
1979
|
})));
|
|
1885
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1980
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1886
1981
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1887
|
-
return _regenerator.default.wrap(function (
|
|
1888
|
-
while (1) switch (
|
|
1982
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
1983
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1889
1984
|
case 0:
|
|
1890
1985
|
statusPayload = {
|
|
1891
1986
|
statusCode: 403,
|
|
@@ -1908,14 +2003,14 @@ describe('State Machine handler tests', function () {
|
|
|
1908
2003
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1909
2004
|
case 1:
|
|
1910
2005
|
case "end":
|
|
1911
|
-
return
|
|
2006
|
+
return _context36.stop();
|
|
1912
2007
|
}
|
|
1913
|
-
},
|
|
2008
|
+
}, _callee36);
|
|
1914
2009
|
})));
|
|
1915
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2010
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1916
2011
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1917
|
-
return _regenerator.default.wrap(function (
|
|
1918
|
-
while (1) switch (
|
|
2012
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2013
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1919
2014
|
case 0:
|
|
1920
2015
|
statusPayload = {
|
|
1921
2016
|
statusCode: 200,
|
|
@@ -1933,7 +2028,7 @@ describe('State Machine handler tests', function () {
|
|
|
1933
2028
|
}
|
|
1934
2029
|
};
|
|
1935
2030
|
call['connected'] = false;
|
|
1936
|
-
|
|
2031
|
+
_context37.next = 1;
|
|
1937
2032
|
return call['handleRoapError']({}, errorEvent);
|
|
1938
2033
|
case 1:
|
|
1939
2034
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1949,14 +2044,14 @@ describe('State Machine handler tests', function () {
|
|
|
1949
2044
|
});
|
|
1950
2045
|
case 2:
|
|
1951
2046
|
case "end":
|
|
1952
|
-
return
|
|
2047
|
+
return _context37.stop();
|
|
1953
2048
|
}
|
|
1954
|
-
},
|
|
2049
|
+
}, _callee37);
|
|
1955
2050
|
})));
|
|
1956
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2051
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1957
2052
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1958
|
-
return _regenerator.default.wrap(function (
|
|
1959
|
-
while (1) switch (
|
|
2053
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2054
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1960
2055
|
case 0:
|
|
1961
2056
|
statusPayload = {
|
|
1962
2057
|
statusCode: 403,
|
|
@@ -1994,16 +2089,16 @@ describe('State Machine handler tests', function () {
|
|
|
1994
2089
|
messageType: 'ANSWER'
|
|
1995
2090
|
}
|
|
1996
2091
|
};
|
|
1997
|
-
|
|
2092
|
+
_context38.next = 1;
|
|
1998
2093
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1999
2094
|
case 1:
|
|
2000
|
-
|
|
2095
|
+
_context38.next = 2;
|
|
2001
2096
|
return (0, _testUtil.flushPromises)(2);
|
|
2002
2097
|
case 2:
|
|
2003
|
-
|
|
2098
|
+
_context38.next = 3;
|
|
2004
2099
|
return _promise.default.resolve();
|
|
2005
2100
|
case 3:
|
|
2006
|
-
|
|
2101
|
+
_context38.next = 4;
|
|
2007
2102
|
return _promise.default.resolve();
|
|
2008
2103
|
case 4:
|
|
2009
2104
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
@@ -2021,14 +2116,14 @@ describe('State Machine handler tests', function () {
|
|
|
2021
2116
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
2022
2117
|
case 5:
|
|
2023
2118
|
case "end":
|
|
2024
|
-
return
|
|
2119
|
+
return _context38.stop();
|
|
2025
2120
|
}
|
|
2026
|
-
},
|
|
2121
|
+
}, _callee38);
|
|
2027
2122
|
})));
|
|
2028
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2123
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2029
2124
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2030
|
-
return _regenerator.default.wrap(function (
|
|
2031
|
-
while (1) switch (
|
|
2125
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2126
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2032
2127
|
case 0:
|
|
2033
2128
|
statusPayload = {
|
|
2034
2129
|
statusCode: 200,
|
|
@@ -2061,7 +2156,7 @@ describe('State Machine handler tests', function () {
|
|
|
2061
2156
|
seq: 1,
|
|
2062
2157
|
messageType: 'ANSWER'
|
|
2063
2158
|
};
|
|
2064
|
-
|
|
2159
|
+
_context39.next = 1;
|
|
2065
2160
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2066
2161
|
case 1:
|
|
2067
2162
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2083,7 +2178,7 @@ describe('State Machine handler tests', function () {
|
|
|
2083
2178
|
seq: 2,
|
|
2084
2179
|
messageType: 'OFFER_REQUEST'
|
|
2085
2180
|
};
|
|
2086
|
-
|
|
2181
|
+
_context39.next = 2;
|
|
2087
2182
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2088
2183
|
case 2:
|
|
2089
2184
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2133,7 +2228,7 @@ describe('State Machine handler tests', function () {
|
|
|
2133
2228
|
};
|
|
2134
2229
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2135
2230
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2136
|
-
|
|
2231
|
+
_context39.next = 3;
|
|
2137
2232
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2138
2233
|
case 3:
|
|
2139
2234
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2142,7 +2237,7 @@ describe('State Machine handler tests', function () {
|
|
|
2142
2237
|
seq: 3,
|
|
2143
2238
|
messageType: 'ANSWER'
|
|
2144
2239
|
};
|
|
2145
|
-
|
|
2240
|
+
_context39.next = 4;
|
|
2146
2241
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2147
2242
|
case 4:
|
|
2148
2243
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2161,7 +2256,7 @@ describe('State Machine handler tests', function () {
|
|
|
2161
2256
|
messageType: 'OK'
|
|
2162
2257
|
}
|
|
2163
2258
|
};
|
|
2164
|
-
|
|
2259
|
+
_context39.next = 5;
|
|
2165
2260
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2166
2261
|
case 5:
|
|
2167
2262
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2176,14 +2271,14 @@ describe('State Machine handler tests', function () {
|
|
|
2176
2271
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2177
2272
|
case 6:
|
|
2178
2273
|
case "end":
|
|
2179
|
-
return
|
|
2274
|
+
return _context39.stop();
|
|
2180
2275
|
}
|
|
2181
|
-
},
|
|
2276
|
+
}, _callee39);
|
|
2182
2277
|
})));
|
|
2183
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2278
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2184
2279
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2185
|
-
return _regenerator.default.wrap(function (
|
|
2186
|
-
while (1) switch (
|
|
2280
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2281
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2187
2282
|
case 0:
|
|
2188
2283
|
mockStatusBody = {
|
|
2189
2284
|
device: {
|
|
@@ -2223,7 +2318,7 @@ describe('State Machine handler tests', function () {
|
|
|
2223
2318
|
seq: 1,
|
|
2224
2319
|
messageType: 'ANSWER'
|
|
2225
2320
|
};
|
|
2226
|
-
|
|
2321
|
+
_context40.next = 1;
|
|
2227
2322
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2228
2323
|
case 1:
|
|
2229
2324
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2245,7 +2340,7 @@ describe('State Machine handler tests', function () {
|
|
|
2245
2340
|
seq: 2,
|
|
2246
2341
|
messageType: 'OFFER_REQUEST'
|
|
2247
2342
|
};
|
|
2248
|
-
|
|
2343
|
+
_context40.next = 2;
|
|
2249
2344
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2250
2345
|
case 2:
|
|
2251
2346
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2295,7 +2390,7 @@ describe('State Machine handler tests', function () {
|
|
|
2295
2390
|
};
|
|
2296
2391
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2297
2392
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2298
|
-
|
|
2393
|
+
_context40.next = 3;
|
|
2299
2394
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2300
2395
|
case 3:
|
|
2301
2396
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2304,7 +2399,7 @@ describe('State Machine handler tests', function () {
|
|
|
2304
2399
|
seq: 3,
|
|
2305
2400
|
messageType: 'ANSWER'
|
|
2306
2401
|
};
|
|
2307
|
-
|
|
2402
|
+
_context40.next = 4;
|
|
2308
2403
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2309
2404
|
case 4:
|
|
2310
2405
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2321,7 +2416,7 @@ describe('State Machine handler tests', function () {
|
|
|
2321
2416
|
}
|
|
2322
2417
|
};
|
|
2323
2418
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2324
|
-
|
|
2419
|
+
_context40.next = 5;
|
|
2325
2420
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2326
2421
|
case 5:
|
|
2327
2422
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2337,14 +2432,14 @@ describe('State Machine handler tests', function () {
|
|
|
2337
2432
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2338
2433
|
case 6:
|
|
2339
2434
|
case "end":
|
|
2340
|
-
return
|
|
2435
|
+
return _context40.stop();
|
|
2341
2436
|
}
|
|
2342
|
-
},
|
|
2437
|
+
}, _callee40);
|
|
2343
2438
|
})));
|
|
2344
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2439
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2345
2440
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2346
|
-
return _regenerator.default.wrap(function (
|
|
2347
|
-
while (1) switch (
|
|
2441
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2442
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2348
2443
|
case 0:
|
|
2349
2444
|
statusPayload = {
|
|
2350
2445
|
statusCode: 200,
|
|
@@ -2411,14 +2506,14 @@ describe('State Machine handler tests', function () {
|
|
|
2411
2506
|
});
|
|
2412
2507
|
case 1:
|
|
2413
2508
|
case "end":
|
|
2414
|
-
return
|
|
2509
|
+
return _context41.stop();
|
|
2415
2510
|
}
|
|
2416
|
-
},
|
|
2511
|
+
}, _callee41);
|
|
2417
2512
|
})));
|
|
2418
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2513
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2419
2514
|
var emitSpy, deleteSpy;
|
|
2420
|
-
return _regenerator.default.wrap(function (
|
|
2421
|
-
while (1) switch (
|
|
2515
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2516
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2422
2517
|
case 0:
|
|
2423
2518
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2424
2519
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2427,7 +2522,7 @@ describe('State Machine handler tests', function () {
|
|
|
2427
2522
|
call.sendCallStateMachineEvt({
|
|
2428
2523
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2429
2524
|
});
|
|
2430
|
-
|
|
2525
|
+
_context42.next = 1;
|
|
2431
2526
|
return (0, _testUtil.flushPromises)(1);
|
|
2432
2527
|
case 1:
|
|
2433
2528
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2435,9 +2530,9 @@ describe('State Machine handler tests', function () {
|
|
|
2435
2530
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2436
2531
|
case 2:
|
|
2437
2532
|
case "end":
|
|
2438
|
-
return
|
|
2533
|
+
return _context42.stop();
|
|
2439
2534
|
}
|
|
2440
|
-
},
|
|
2535
|
+
}, _callee42);
|
|
2441
2536
|
})));
|
|
2442
2537
|
describe('Call event timers tests', function () {
|
|
2443
2538
|
var callManager;
|
|
@@ -2448,10 +2543,10 @@ describe('State Machine handler tests', function () {
|
|
|
2448
2543
|
afterEach(function () {
|
|
2449
2544
|
jest.clearAllTimers();
|
|
2450
2545
|
});
|
|
2451
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2546
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2452
2547
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2453
|
-
return _regenerator.default.wrap(function (
|
|
2454
|
-
while (1) switch (
|
|
2548
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2549
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2455
2550
|
case 0:
|
|
2456
2551
|
statusPayload = {
|
|
2457
2552
|
statusCode: 200,
|
|
@@ -2468,7 +2563,7 @@ describe('State Machine handler tests', function () {
|
|
|
2468
2563
|
webex.request.mockReturnValue(statusPayload);
|
|
2469
2564
|
|
|
2470
2565
|
// handleOutgoingCallSetup is asynchronous
|
|
2471
|
-
|
|
2566
|
+
_context43.next = 1;
|
|
2472
2567
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2473
2568
|
case 1:
|
|
2474
2569
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2511,14 +2606,14 @@ describe('State Machine handler tests', function () {
|
|
|
2511
2606
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2512
2607
|
case 2:
|
|
2513
2608
|
case "end":
|
|
2514
|
-
return
|
|
2609
|
+
return _context43.stop();
|
|
2515
2610
|
}
|
|
2516
|
-
},
|
|
2611
|
+
}, _callee43);
|
|
2517
2612
|
})));
|
|
2518
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2613
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2519
2614
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2520
|
-
return _regenerator.default.wrap(function (
|
|
2521
|
-
while (1) switch (
|
|
2615
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2616
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2522
2617
|
case 0:
|
|
2523
2618
|
statusPayload = {
|
|
2524
2619
|
statusCode: 200,
|
|
@@ -2537,7 +2632,7 @@ describe('State Machine handler tests', function () {
|
|
|
2537
2632
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2538
2633
|
|
|
2539
2634
|
// handleOutgoingCallSetup is asynchronous
|
|
2540
|
-
|
|
2635
|
+
_context44.next = 1;
|
|
2541
2636
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2542
2637
|
case 1:
|
|
2543
2638
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2549,9 +2644,9 @@ describe('State Machine handler tests', function () {
|
|
|
2549
2644
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2550
2645
|
case 2:
|
|
2551
2646
|
case "end":
|
|
2552
|
-
return
|
|
2647
|
+
return _context44.stop();
|
|
2553
2648
|
}
|
|
2554
|
-
},
|
|
2649
|
+
}, _callee44);
|
|
2555
2650
|
})));
|
|
2556
2651
|
});
|
|
2557
2652
|
});
|
|
@@ -2616,10 +2711,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2616
2711
|
beforeEach(function () {
|
|
2617
2712
|
call.removeAllListeners();
|
|
2618
2713
|
});
|
|
2619
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2714
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2620
2715
|
var responsePayload, warnSpy, roapEvent;
|
|
2621
|
-
return _regenerator.default.wrap(function (
|
|
2622
|
-
while (1) switch (
|
|
2716
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2717
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2623
2718
|
case 0:
|
|
2624
2719
|
expect.assertions(7);
|
|
2625
2720
|
responsePayload = {
|
|
@@ -2632,25 +2727,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2632
2727
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2633
2728
|
call['held'] = false;
|
|
2634
2729
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2635
|
-
var
|
|
2636
|
-
return _regenerator.default.wrap(function (
|
|
2637
|
-
while (1) switch (
|
|
2730
|
+
var _ref48 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
|
|
2731
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2732
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2638
2733
|
case 0:
|
|
2639
2734
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2640
2735
|
case 1:
|
|
2641
2736
|
case "end":
|
|
2642
|
-
return
|
|
2737
|
+
return _context45.stop();
|
|
2643
2738
|
}
|
|
2644
|
-
},
|
|
2739
|
+
}, _callee45);
|
|
2645
2740
|
}));
|
|
2646
2741
|
return function (_x) {
|
|
2647
|
-
return
|
|
2742
|
+
return _ref48.apply(this, arguments);
|
|
2648
2743
|
};
|
|
2649
2744
|
}());
|
|
2650
|
-
|
|
2745
|
+
_context46.next = 1;
|
|
2651
2746
|
return call.doHoldResume();
|
|
2652
2747
|
case 1:
|
|
2653
|
-
|
|
2748
|
+
_context46.next = 2;
|
|
2654
2749
|
return (0, _testUtil.flushPromises)(2);
|
|
2655
2750
|
case 2:
|
|
2656
2751
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2666,11 +2761,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2666
2761
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2667
2762
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2668
2763
|
roapEvent.data.type = 'ANSWER';
|
|
2669
|
-
|
|
2764
|
+
_context46.next = 3;
|
|
2670
2765
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2671
2766
|
case 3:
|
|
2672
2767
|
roapEvent.data.type = 'OK';
|
|
2673
|
-
|
|
2768
|
+
_context46.next = 4;
|
|
2674
2769
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2675
2770
|
case 4:
|
|
2676
2771
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2685,14 +2780,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2685
2780
|
});
|
|
2686
2781
|
case 5:
|
|
2687
2782
|
case "end":
|
|
2688
|
-
return
|
|
2783
|
+
return _context46.stop();
|
|
2689
2784
|
}
|
|
2690
|
-
},
|
|
2785
|
+
}, _callee46);
|
|
2691
2786
|
})));
|
|
2692
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2787
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2693
2788
|
var responsePayload, warnSpy, roapEvent;
|
|
2694
|
-
return _regenerator.default.wrap(function (
|
|
2695
|
-
while (1) switch (
|
|
2789
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2790
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2696
2791
|
case 0:
|
|
2697
2792
|
expect.assertions(8);
|
|
2698
2793
|
responsePayload = {
|
|
@@ -2705,26 +2800,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2705
2800
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2706
2801
|
call['held'] = false;
|
|
2707
2802
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2708
|
-
var
|
|
2709
|
-
return _regenerator.default.wrap(function (
|
|
2710
|
-
while (1) switch (
|
|
2803
|
+
var _ref50 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(correlationId) {
|
|
2804
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2805
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2711
2806
|
case 0:
|
|
2712
2807
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2713
2808
|
case 1:
|
|
2714
2809
|
case "end":
|
|
2715
|
-
return
|
|
2810
|
+
return _context47.stop();
|
|
2716
2811
|
}
|
|
2717
|
-
},
|
|
2812
|
+
}, _callee47);
|
|
2718
2813
|
}));
|
|
2719
2814
|
return function (_x2) {
|
|
2720
|
-
return
|
|
2815
|
+
return _ref50.apply(this, arguments);
|
|
2721
2816
|
};
|
|
2722
2817
|
}());
|
|
2723
2818
|
call.doHoldResume();
|
|
2724
|
-
|
|
2819
|
+
_context48.next = 1;
|
|
2725
2820
|
return _promise.default.resolve();
|
|
2726
2821
|
case 1:
|
|
2727
|
-
|
|
2822
|
+
_context48.next = 2;
|
|
2728
2823
|
return _promise.default.resolve();
|
|
2729
2824
|
case 2:
|
|
2730
2825
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2740,11 +2835,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2740
2835
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2741
2836
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2742
2837
|
roapEvent.data.type = 'ANSWER';
|
|
2743
|
-
|
|
2838
|
+
_context48.next = 3;
|
|
2744
2839
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2745
2840
|
case 3:
|
|
2746
2841
|
roapEvent.data.type = 'OK';
|
|
2747
|
-
|
|
2842
|
+
_context48.next = 4;
|
|
2748
2843
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2749
2844
|
case 4:
|
|
2750
2845
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2759,14 +2854,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2759
2854
|
});
|
|
2760
2855
|
case 5:
|
|
2761
2856
|
case "end":
|
|
2762
|
-
return
|
|
2857
|
+
return _context48.stop();
|
|
2763
2858
|
}
|
|
2764
|
-
},
|
|
2859
|
+
}, _callee48);
|
|
2765
2860
|
})));
|
|
2766
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2861
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2767
2862
|
var responsePayload;
|
|
2768
|
-
return _regenerator.default.wrap(function (
|
|
2769
|
-
while (1) switch (
|
|
2863
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
2864
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2770
2865
|
case 0:
|
|
2771
2866
|
expect.assertions(4);
|
|
2772
2867
|
responsePayload = {
|
|
@@ -2776,26 +2871,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2776
2871
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2777
2872
|
call['held'] = false;
|
|
2778
2873
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2779
|
-
var
|
|
2780
|
-
return _regenerator.default.wrap(function (
|
|
2781
|
-
while (1) switch (
|
|
2874
|
+
var _ref52 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
|
|
2875
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
2876
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2782
2877
|
case 0:
|
|
2783
2878
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2784
2879
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2785
2880
|
case 1:
|
|
2786
2881
|
case "end":
|
|
2787
|
-
return
|
|
2882
|
+
return _context49.stop();
|
|
2788
2883
|
}
|
|
2789
|
-
},
|
|
2884
|
+
}, _callee49);
|
|
2790
2885
|
}));
|
|
2791
2886
|
return function (_x3) {
|
|
2792
|
-
return
|
|
2887
|
+
return _ref52.apply(this, arguments);
|
|
2793
2888
|
};
|
|
2794
2889
|
}());
|
|
2795
|
-
|
|
2890
|
+
_context50.next = 1;
|
|
2796
2891
|
return call.doHoldResume();
|
|
2797
2892
|
case 1:
|
|
2798
|
-
|
|
2893
|
+
_context50.next = 2;
|
|
2799
2894
|
return (0, _testUtil.flushPromises)(2);
|
|
2800
2895
|
case 2:
|
|
2801
2896
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2805,14 +2900,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2805
2900
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2806
2901
|
case 3:
|
|
2807
2902
|
case "end":
|
|
2808
|
-
return
|
|
2903
|
+
return _context50.stop();
|
|
2809
2904
|
}
|
|
2810
|
-
},
|
|
2905
|
+
}, _callee50);
|
|
2811
2906
|
})));
|
|
2812
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2907
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2813
2908
|
var responsePayload, rejectPayload, roapEvent;
|
|
2814
|
-
return _regenerator.default.wrap(function (
|
|
2815
|
-
while (1) switch (
|
|
2909
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
2910
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2816
2911
|
case 0:
|
|
2817
2912
|
expect.assertions(5);
|
|
2818
2913
|
responsePayload = {
|
|
@@ -2826,24 +2921,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2826
2921
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2827
2922
|
call['held'] = false;
|
|
2828
2923
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2829
|
-
var
|
|
2830
|
-
return _regenerator.default.wrap(function (
|
|
2831
|
-
while (1) switch (
|
|
2924
|
+
var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
|
|
2925
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
2926
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2832
2927
|
case 0:
|
|
2833
2928
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2834
2929
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2835
2930
|
case 1:
|
|
2836
2931
|
case "end":
|
|
2837
|
-
return
|
|
2932
|
+
return _context51.stop();
|
|
2838
2933
|
}
|
|
2839
|
-
},
|
|
2934
|
+
}, _callee51);
|
|
2840
2935
|
}));
|
|
2841
2936
|
return function (_x4) {
|
|
2842
|
-
return
|
|
2937
|
+
return _ref54.apply(this, arguments);
|
|
2843
2938
|
};
|
|
2844
2939
|
}());
|
|
2845
2940
|
call.doHoldResume();
|
|
2846
|
-
|
|
2941
|
+
_context52.next = 1;
|
|
2847
2942
|
return (0, _testUtil.flushPromises)(2);
|
|
2848
2943
|
case 1:
|
|
2849
2944
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2853,7 +2948,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2853
2948
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2854
2949
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2855
2950
|
roapEvent.data.type = 'ANSWER';
|
|
2856
|
-
|
|
2951
|
+
_context52.next = 2;
|
|
2857
2952
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2858
2953
|
case 2:
|
|
2859
2954
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2861,14 +2956,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2861
2956
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2862
2957
|
case 3:
|
|
2863
2958
|
case "end":
|
|
2864
|
-
return
|
|
2959
|
+
return _context52.stop();
|
|
2865
2960
|
}
|
|
2866
|
-
},
|
|
2961
|
+
}, _callee52);
|
|
2867
2962
|
})));
|
|
2868
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2963
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2869
2964
|
var responsePayload, warnSpy, roapEvent;
|
|
2870
|
-
return _regenerator.default.wrap(function (
|
|
2871
|
-
while (1) switch (
|
|
2965
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
2966
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2872
2967
|
case 0:
|
|
2873
2968
|
responsePayload = {
|
|
2874
2969
|
statusCode: 200,
|
|
@@ -2879,10 +2974,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2879
2974
|
jest.spyOn(global, 'clearTimeout');
|
|
2880
2975
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2881
2976
|
call['held'] = false;
|
|
2882
|
-
|
|
2977
|
+
_context53.next = 1;
|
|
2883
2978
|
return call.doHoldResume();
|
|
2884
2979
|
case 1:
|
|
2885
|
-
|
|
2980
|
+
_context53.next = 2;
|
|
2886
2981
|
return (0, _testUtil.flushPromises)(2);
|
|
2887
2982
|
case 2:
|
|
2888
2983
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2897,19 +2992,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2897
2992
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2898
2993
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2899
2994
|
roapEvent.data.type = 'ANSWER';
|
|
2900
|
-
|
|
2995
|
+
_context53.next = 3;
|
|
2901
2996
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2902
2997
|
case 3:
|
|
2903
2998
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2904
2999
|
statusCode: 403
|
|
2905
3000
|
});
|
|
2906
3001
|
roapEvent.data.type = 'OK';
|
|
2907
|
-
|
|
3002
|
+
_context53.next = 4;
|
|
2908
3003
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2909
3004
|
case 4:
|
|
2910
3005
|
/* this is for coverage */
|
|
2911
3006
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2912
|
-
|
|
3007
|
+
_context53.next = 5;
|
|
2913
3008
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2914
3009
|
case 5:
|
|
2915
3010
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2921,14 +3016,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2921
3016
|
});
|
|
2922
3017
|
case 6:
|
|
2923
3018
|
case "end":
|
|
2924
|
-
return
|
|
3019
|
+
return _context53.stop();
|
|
2925
3020
|
}
|
|
2926
|
-
},
|
|
3021
|
+
}, _callee53);
|
|
2927
3022
|
})));
|
|
2928
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3023
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2929
3024
|
var responsePayload, warnSpy, roapEvent;
|
|
2930
|
-
return _regenerator.default.wrap(function (
|
|
2931
|
-
while (1) switch (
|
|
3025
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
3026
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2932
3027
|
case 0:
|
|
2933
3028
|
responsePayload = {
|
|
2934
3029
|
statusCode: 200,
|
|
@@ -2939,10 +3034,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2939
3034
|
jest.spyOn(global, 'clearTimeout');
|
|
2940
3035
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2941
3036
|
call['held'] = true;
|
|
2942
|
-
|
|
3037
|
+
_context54.next = 1;
|
|
2943
3038
|
return call.doHoldResume();
|
|
2944
3039
|
case 1:
|
|
2945
|
-
|
|
3040
|
+
_context54.next = 2;
|
|
2946
3041
|
return (0, _testUtil.flushPromises)(2);
|
|
2947
3042
|
case 2:
|
|
2948
3043
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2957,14 +3052,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2957
3052
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2958
3053
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2959
3054
|
roapEvent.data.type = 'ANSWER';
|
|
2960
|
-
|
|
3055
|
+
_context54.next = 3;
|
|
2961
3056
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2962
3057
|
case 3:
|
|
2963
3058
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2964
3059
|
statusCode: 403
|
|
2965
3060
|
});
|
|
2966
3061
|
roapEvent.data.type = 'OK';
|
|
2967
|
-
|
|
3062
|
+
_context54.next = 4;
|
|
2968
3063
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2969
3064
|
case 4:
|
|
2970
3065
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2976,14 +3071,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2976
3071
|
});
|
|
2977
3072
|
case 5:
|
|
2978
3073
|
case "end":
|
|
2979
|
-
return
|
|
3074
|
+
return _context54.stop();
|
|
2980
3075
|
}
|
|
2981
|
-
},
|
|
3076
|
+
}, _callee54);
|
|
2982
3077
|
})));
|
|
2983
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3078
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
2984
3079
|
var responsePayload, roapEvent;
|
|
2985
|
-
return _regenerator.default.wrap(function (
|
|
2986
|
-
while (1) switch (
|
|
3080
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3081
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2987
3082
|
case 0:
|
|
2988
3083
|
expect.assertions(5);
|
|
2989
3084
|
responsePayload = {
|
|
@@ -2993,25 +3088,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2993
3088
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2994
3089
|
call['held'] = false;
|
|
2995
3090
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2996
|
-
var
|
|
2997
|
-
return _regenerator.default.wrap(function (
|
|
2998
|
-
while (1) switch (
|
|
3091
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(errObj) {
|
|
3092
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
3093
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2999
3094
|
case 0:
|
|
3000
3095
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3001
3096
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
3002
3097
|
case 1:
|
|
3003
3098
|
case "end":
|
|
3004
|
-
return
|
|
3099
|
+
return _context55.stop();
|
|
3005
3100
|
}
|
|
3006
|
-
},
|
|
3101
|
+
}, _callee55);
|
|
3007
3102
|
}));
|
|
3008
3103
|
return function (_x5) {
|
|
3009
|
-
return
|
|
3104
|
+
return _ref58.apply(this, arguments);
|
|
3010
3105
|
};
|
|
3011
3106
|
}());
|
|
3012
3107
|
jest.runAllTimers();
|
|
3013
3108
|
call.doHoldResume();
|
|
3014
|
-
|
|
3109
|
+
_context56.next = 1;
|
|
3015
3110
|
return (0, _testUtil.flushPromises)(2);
|
|
3016
3111
|
case 1:
|
|
3017
3112
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -3024,11 +3119,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3024
3119
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3025
3120
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3026
3121
|
roapEvent.data.type = 'ANSWER';
|
|
3027
|
-
|
|
3122
|
+
_context56.next = 2;
|
|
3028
3123
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3029
3124
|
case 2:
|
|
3030
3125
|
roapEvent.data.type = 'OK';
|
|
3031
|
-
|
|
3126
|
+
_context56.next = 3;
|
|
3032
3127
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3033
3128
|
case 3:
|
|
3034
3129
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3040,14 +3135,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3040
3135
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3041
3136
|
case 4:
|
|
3042
3137
|
case "end":
|
|
3043
|
-
return
|
|
3138
|
+
return _context56.stop();
|
|
3044
3139
|
}
|
|
3045
|
-
},
|
|
3140
|
+
}, _callee56);
|
|
3046
3141
|
})));
|
|
3047
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3142
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
3048
3143
|
var responsePayload, warnSpy, roapEvent;
|
|
3049
|
-
return _regenerator.default.wrap(function (
|
|
3050
|
-
while (1) switch (
|
|
3144
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3145
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
3051
3146
|
case 0:
|
|
3052
3147
|
expect.assertions(7);
|
|
3053
3148
|
responsePayload = {
|
|
@@ -3060,25 +3155,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3060
3155
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3061
3156
|
call['held'] = true;
|
|
3062
3157
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3063
|
-
var
|
|
3064
|
-
return _regenerator.default.wrap(function (
|
|
3065
|
-
while (1) switch (
|
|
3158
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(correlationId) {
|
|
3159
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3160
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
3066
3161
|
case 0:
|
|
3067
3162
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3068
3163
|
case 1:
|
|
3069
3164
|
case "end":
|
|
3070
|
-
return
|
|
3165
|
+
return _context57.stop();
|
|
3071
3166
|
}
|
|
3072
|
-
},
|
|
3167
|
+
}, _callee57);
|
|
3073
3168
|
}));
|
|
3074
3169
|
return function (_x6) {
|
|
3075
|
-
return
|
|
3170
|
+
return _ref60.apply(this, arguments);
|
|
3076
3171
|
};
|
|
3077
3172
|
}());
|
|
3078
|
-
|
|
3173
|
+
_context58.next = 1;
|
|
3079
3174
|
return call.doHoldResume();
|
|
3080
3175
|
case 1:
|
|
3081
|
-
|
|
3176
|
+
_context58.next = 2;
|
|
3082
3177
|
return (0, _testUtil.flushPromises)(2);
|
|
3083
3178
|
case 2:
|
|
3084
3179
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3094,11 +3189,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3094
3189
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3095
3190
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3096
3191
|
roapEvent.data.type = 'ANSWER';
|
|
3097
|
-
|
|
3192
|
+
_context58.next = 3;
|
|
3098
3193
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3099
3194
|
case 3:
|
|
3100
3195
|
roapEvent.data.type = 'OK';
|
|
3101
|
-
|
|
3196
|
+
_context58.next = 4;
|
|
3102
3197
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3103
3198
|
case 4:
|
|
3104
3199
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3113,14 +3208,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3113
3208
|
});
|
|
3114
3209
|
case 5:
|
|
3115
3210
|
case "end":
|
|
3116
|
-
return
|
|
3211
|
+
return _context58.stop();
|
|
3117
3212
|
}
|
|
3118
|
-
},
|
|
3213
|
+
}, _callee58);
|
|
3119
3214
|
})));
|
|
3120
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3215
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
3121
3216
|
var responsePayload, warnSpy, roapEvent;
|
|
3122
|
-
return _regenerator.default.wrap(function (
|
|
3123
|
-
while (1) switch (
|
|
3217
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3218
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3124
3219
|
case 0:
|
|
3125
3220
|
expect.assertions(7);
|
|
3126
3221
|
responsePayload = {
|
|
@@ -3133,26 +3228,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3133
3228
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3134
3229
|
call['held'] = true;
|
|
3135
3230
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3136
|
-
var
|
|
3137
|
-
return _regenerator.default.wrap(function (
|
|
3138
|
-
while (1) switch (
|
|
3231
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
|
|
3232
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3233
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3139
3234
|
case 0:
|
|
3140
3235
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3141
3236
|
case 1:
|
|
3142
3237
|
case "end":
|
|
3143
|
-
return
|
|
3238
|
+
return _context59.stop();
|
|
3144
3239
|
}
|
|
3145
|
-
},
|
|
3240
|
+
}, _callee59);
|
|
3146
3241
|
}));
|
|
3147
3242
|
return function (_x7) {
|
|
3148
|
-
return
|
|
3243
|
+
return _ref62.apply(this, arguments);
|
|
3149
3244
|
};
|
|
3150
3245
|
}());
|
|
3151
3246
|
call.doHoldResume();
|
|
3152
|
-
|
|
3247
|
+
_context60.next = 1;
|
|
3153
3248
|
return _promise.default.resolve();
|
|
3154
3249
|
case 1:
|
|
3155
|
-
|
|
3250
|
+
_context60.next = 2;
|
|
3156
3251
|
return _promise.default.resolve();
|
|
3157
3252
|
case 2:
|
|
3158
3253
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3168,11 +3263,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3168
3263
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3169
3264
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3170
3265
|
roapEvent.data.type = 'ANSWER';
|
|
3171
|
-
|
|
3266
|
+
_context60.next = 3;
|
|
3172
3267
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3173
3268
|
case 3:
|
|
3174
3269
|
roapEvent.data.type = 'OK';
|
|
3175
|
-
|
|
3270
|
+
_context60.next = 4;
|
|
3176
3271
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3177
3272
|
case 4:
|
|
3178
3273
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3187,14 +3282,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3187
3282
|
});
|
|
3188
3283
|
case 5:
|
|
3189
3284
|
case "end":
|
|
3190
|
-
return
|
|
3285
|
+
return _context60.stop();
|
|
3191
3286
|
}
|
|
3192
|
-
},
|
|
3287
|
+
}, _callee60);
|
|
3193
3288
|
})));
|
|
3194
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3289
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
|
|
3195
3290
|
var responsePayload;
|
|
3196
|
-
return _regenerator.default.wrap(function (
|
|
3197
|
-
while (1) switch (
|
|
3291
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3292
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3198
3293
|
case 0:
|
|
3199
3294
|
expect.assertions(4);
|
|
3200
3295
|
responsePayload = {
|
|
@@ -3204,26 +3299,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3204
3299
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3205
3300
|
call['held'] = true;
|
|
3206
3301
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3207
|
-
var
|
|
3208
|
-
return _regenerator.default.wrap(function (
|
|
3209
|
-
while (1) switch (
|
|
3302
|
+
var _ref64 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(errObj) {
|
|
3303
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3304
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3210
3305
|
case 0:
|
|
3211
3306
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3212
3307
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3213
3308
|
case 1:
|
|
3214
3309
|
case "end":
|
|
3215
|
-
return
|
|
3310
|
+
return _context61.stop();
|
|
3216
3311
|
}
|
|
3217
|
-
},
|
|
3312
|
+
}, _callee61);
|
|
3218
3313
|
}));
|
|
3219
3314
|
return function (_x8) {
|
|
3220
|
-
return
|
|
3315
|
+
return _ref64.apply(this, arguments);
|
|
3221
3316
|
};
|
|
3222
3317
|
}());
|
|
3223
|
-
|
|
3318
|
+
_context62.next = 1;
|
|
3224
3319
|
return call.doHoldResume();
|
|
3225
3320
|
case 1:
|
|
3226
|
-
|
|
3321
|
+
_context62.next = 2;
|
|
3227
3322
|
return (0, _testUtil.flushPromises)(2);
|
|
3228
3323
|
case 2:
|
|
3229
3324
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3234,14 +3329,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3234
3329
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3235
3330
|
case 3:
|
|
3236
3331
|
case "end":
|
|
3237
|
-
return
|
|
3332
|
+
return _context62.stop();
|
|
3238
3333
|
}
|
|
3239
|
-
},
|
|
3334
|
+
}, _callee62);
|
|
3240
3335
|
})));
|
|
3241
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3336
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
3242
3337
|
var responsePayload, rejectPayload, roapEvent;
|
|
3243
|
-
return _regenerator.default.wrap(function (
|
|
3244
|
-
while (1) switch (
|
|
3338
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3339
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3245
3340
|
case 0:
|
|
3246
3341
|
expect.assertions(5);
|
|
3247
3342
|
responsePayload = {
|
|
@@ -3255,24 +3350,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3255
3350
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3256
3351
|
call['held'] = true;
|
|
3257
3352
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3258
|
-
var
|
|
3259
|
-
return _regenerator.default.wrap(function (
|
|
3260
|
-
while (1) switch (
|
|
3353
|
+
var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(errObj) {
|
|
3354
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3355
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3261
3356
|
case 0:
|
|
3262
3357
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3263
3358
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3264
3359
|
case 1:
|
|
3265
3360
|
case "end":
|
|
3266
|
-
return
|
|
3361
|
+
return _context63.stop();
|
|
3267
3362
|
}
|
|
3268
|
-
},
|
|
3363
|
+
}, _callee63);
|
|
3269
3364
|
}));
|
|
3270
3365
|
return function (_x9) {
|
|
3271
|
-
return
|
|
3366
|
+
return _ref66.apply(this, arguments);
|
|
3272
3367
|
};
|
|
3273
3368
|
}());
|
|
3274
3369
|
call.doHoldResume();
|
|
3275
|
-
|
|
3370
|
+
_context64.next = 1;
|
|
3276
3371
|
return (0, _testUtil.flushPromises)(2);
|
|
3277
3372
|
case 1:
|
|
3278
3373
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3283,7 +3378,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3283
3378
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3284
3379
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3285
3380
|
roapEvent.data.type = 'ANSWER';
|
|
3286
|
-
|
|
3381
|
+
_context64.next = 2;
|
|
3287
3382
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3288
3383
|
case 2:
|
|
3289
3384
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3291,14 +3386,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3291
3386
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3292
3387
|
case 3:
|
|
3293
3388
|
case "end":
|
|
3294
|
-
return
|
|
3389
|
+
return _context64.stop();
|
|
3295
3390
|
}
|
|
3296
|
-
},
|
|
3391
|
+
}, _callee64);
|
|
3297
3392
|
})));
|
|
3298
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3393
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3299
3394
|
var responsePayload, roapEvent;
|
|
3300
|
-
return _regenerator.default.wrap(function (
|
|
3301
|
-
while (1) switch (
|
|
3395
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3396
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3302
3397
|
case 0:
|
|
3303
3398
|
expect.assertions(5);
|
|
3304
3399
|
responsePayload = {
|
|
@@ -3308,24 +3403,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3308
3403
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3309
3404
|
call['held'] = true;
|
|
3310
3405
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3311
|
-
var
|
|
3312
|
-
return _regenerator.default.wrap(function (
|
|
3313
|
-
while (1) switch (
|
|
3406
|
+
var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(errObj) {
|
|
3407
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3408
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3314
3409
|
case 0:
|
|
3315
3410
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3316
3411
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3317
3412
|
case 1:
|
|
3318
3413
|
case "end":
|
|
3319
|
-
return
|
|
3414
|
+
return _context65.stop();
|
|
3320
3415
|
}
|
|
3321
|
-
},
|
|
3416
|
+
}, _callee65);
|
|
3322
3417
|
}));
|
|
3323
3418
|
return function (_x0) {
|
|
3324
|
-
return
|
|
3419
|
+
return _ref68.apply(this, arguments);
|
|
3325
3420
|
};
|
|
3326
3421
|
}());
|
|
3327
3422
|
call.doHoldResume();
|
|
3328
|
-
|
|
3423
|
+
_context66.next = 1;
|
|
3329
3424
|
return (0, _testUtil.flushPromises)(2);
|
|
3330
3425
|
case 1:
|
|
3331
3426
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3338,11 +3433,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3338
3433
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3339
3434
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3340
3435
|
roapEvent.data.type = 'ANSWER';
|
|
3341
|
-
|
|
3436
|
+
_context66.next = 2;
|
|
3342
3437
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3343
3438
|
case 2:
|
|
3344
3439
|
roapEvent.data.type = 'OK';
|
|
3345
|
-
|
|
3440
|
+
_context66.next = 3;
|
|
3346
3441
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3347
3442
|
case 3:
|
|
3348
3443
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3352,9 +3447,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3352
3447
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3353
3448
|
case 4:
|
|
3354
3449
|
case "end":
|
|
3355
|
-
return
|
|
3450
|
+
return _context66.stop();
|
|
3356
3451
|
}
|
|
3357
|
-
},
|
|
3452
|
+
}, _callee66);
|
|
3358
3453
|
})));
|
|
3359
3454
|
});
|
|
3360
3455
|
describe('Call transfer tests', function () {
|
|
@@ -3387,10 +3482,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3387
3482
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3388
3483
|
secondCall['held'] = false;
|
|
3389
3484
|
});
|
|
3390
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3485
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
|
|
3391
3486
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3392
|
-
return _regenerator.default.wrap(function (
|
|
3393
|
-
while (1) switch (
|
|
3487
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3488
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3394
3489
|
case 0:
|
|
3395
3490
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3396
3491
|
responsePayload = {
|
|
@@ -3402,41 +3497,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3402
3497
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3403
3498
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3404
3499
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3405
|
-
var
|
|
3406
|
-
return _regenerator.default.wrap(function (
|
|
3407
|
-
while (1) switch (
|
|
3500
|
+
var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
|
|
3501
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3502
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3408
3503
|
case 0:
|
|
3409
3504
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3410
3505
|
case 1:
|
|
3411
3506
|
case "end":
|
|
3412
|
-
return
|
|
3507
|
+
return _context67.stop();
|
|
3413
3508
|
}
|
|
3414
|
-
},
|
|
3509
|
+
}, _callee67);
|
|
3415
3510
|
}));
|
|
3416
3511
|
return function (_x1) {
|
|
3417
|
-
return
|
|
3512
|
+
return _ref70.apply(this, arguments);
|
|
3418
3513
|
};
|
|
3419
3514
|
}());
|
|
3420
3515
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3421
|
-
var
|
|
3422
|
-
return _regenerator.default.wrap(function (
|
|
3423
|
-
while (1) switch (
|
|
3516
|
+
var _ref71 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
|
|
3517
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3518
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3424
3519
|
case 0:
|
|
3425
3520
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3426
3521
|
case 1:
|
|
3427
3522
|
case "end":
|
|
3428
|
-
return
|
|
3523
|
+
return _context68.stop();
|
|
3429
3524
|
}
|
|
3430
|
-
},
|
|
3525
|
+
}, _callee68);
|
|
3431
3526
|
}));
|
|
3432
3527
|
return function (_x10) {
|
|
3433
|
-
return
|
|
3528
|
+
return _ref71.apply(this, arguments);
|
|
3434
3529
|
};
|
|
3435
3530
|
}());
|
|
3436
|
-
|
|
3531
|
+
_context69.next = 1;
|
|
3437
3532
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3438
3533
|
case 1:
|
|
3439
|
-
|
|
3534
|
+
_context69.next = 2;
|
|
3440
3535
|
return (0, _testUtil.flushPromises)(2);
|
|
3441
3536
|
case 2:
|
|
3442
3537
|
expect(requestSpy).toBeCalled();
|
|
@@ -3459,14 +3554,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3459
3554
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3460
3555
|
case 3:
|
|
3461
3556
|
case "end":
|
|
3462
|
-
return
|
|
3557
|
+
return _context69.stop();
|
|
3463
3558
|
}
|
|
3464
|
-
},
|
|
3559
|
+
}, _callee69);
|
|
3465
3560
|
})));
|
|
3466
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3561
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
|
|
3467
3562
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3468
|
-
return _regenerator.default.wrap(function (
|
|
3469
|
-
while (1) switch (
|
|
3563
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3564
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3470
3565
|
case 0:
|
|
3471
3566
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3472
3567
|
responsePayload = {
|
|
@@ -3478,25 +3573,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3478
3573
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3479
3574
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3480
3575
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3481
|
-
var
|
|
3482
|
-
return _regenerator.default.wrap(function (
|
|
3483
|
-
while (1) switch (
|
|
3576
|
+
var _ref73 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70(correlationId) {
|
|
3577
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3578
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3484
3579
|
case 0:
|
|
3485
3580
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3486
3581
|
case 1:
|
|
3487
3582
|
case "end":
|
|
3488
|
-
return
|
|
3583
|
+
return _context70.stop();
|
|
3489
3584
|
}
|
|
3490
|
-
},
|
|
3585
|
+
}, _callee70);
|
|
3491
3586
|
}));
|
|
3492
3587
|
return function (_x11) {
|
|
3493
|
-
return
|
|
3588
|
+
return _ref73.apply(this, arguments);
|
|
3494
3589
|
};
|
|
3495
3590
|
}());
|
|
3496
|
-
|
|
3591
|
+
_context71.next = 1;
|
|
3497
3592
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3498
3593
|
case 1:
|
|
3499
|
-
|
|
3594
|
+
_context71.next = 2;
|
|
3500
3595
|
return (0, _testUtil.flushPromises)(2);
|
|
3501
3596
|
case 2:
|
|
3502
3597
|
expect(requestSpy).toBeCalled();
|
|
@@ -3515,14 +3610,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3515
3610
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3516
3611
|
case 3:
|
|
3517
3612
|
case "end":
|
|
3518
|
-
return
|
|
3613
|
+
return _context71.stop();
|
|
3519
3614
|
}
|
|
3520
|
-
},
|
|
3615
|
+
}, _callee71);
|
|
3521
3616
|
})));
|
|
3522
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3617
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3523
3618
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3524
|
-
return _regenerator.default.wrap(function (
|
|
3525
|
-
while (1) switch (
|
|
3619
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3620
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3526
3621
|
case 0:
|
|
3527
3622
|
responsePayload = {
|
|
3528
3623
|
statusCode: 403,
|
|
@@ -3533,10 +3628,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3533
3628
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3534
3629
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3535
3630
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3536
|
-
|
|
3631
|
+
_context72.next = 1;
|
|
3537
3632
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3538
3633
|
case 1:
|
|
3539
|
-
|
|
3634
|
+
_context72.next = 2;
|
|
3540
3635
|
return (0, _testUtil.flushPromises)(1);
|
|
3541
3636
|
case 2:
|
|
3542
3637
|
expect(requestSpy).toBeCalled();
|
|
@@ -3557,14 +3652,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3557
3652
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3558
3653
|
case 3:
|
|
3559
3654
|
case "end":
|
|
3560
|
-
return
|
|
3655
|
+
return _context72.stop();
|
|
3561
3656
|
}
|
|
3562
|
-
},
|
|
3657
|
+
}, _callee72);
|
|
3563
3658
|
})));
|
|
3564
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3659
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3565
3660
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3566
|
-
return _regenerator.default.wrap(function (
|
|
3567
|
-
while (1) switch (
|
|
3661
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3662
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3568
3663
|
case 0:
|
|
3569
3664
|
responsePayload = {
|
|
3570
3665
|
statusCode: 403,
|
|
@@ -3574,10 +3669,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3574
3669
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3575
3670
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3576
3671
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3577
|
-
|
|
3672
|
+
_context73.next = 1;
|
|
3578
3673
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3579
3674
|
case 1:
|
|
3580
|
-
|
|
3675
|
+
_context73.next = 2;
|
|
3581
3676
|
return (0, _testUtil.flushPromises)(2);
|
|
3582
3677
|
case 2:
|
|
3583
3678
|
expect(requestSpy).toBeCalled();
|
|
@@ -3598,18 +3693,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3598
3693
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3599
3694
|
case 3:
|
|
3600
3695
|
case "end":
|
|
3601
|
-
return
|
|
3696
|
+
return _context73.stop();
|
|
3602
3697
|
}
|
|
3603
|
-
},
|
|
3698
|
+
}, _callee73);
|
|
3604
3699
|
})));
|
|
3605
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3700
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3606
3701
|
var requestSpy, warnSpy;
|
|
3607
|
-
return _regenerator.default.wrap(function (
|
|
3608
|
-
while (1) switch (
|
|
3702
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3703
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3609
3704
|
case 0:
|
|
3610
3705
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3611
3706
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3612
|
-
|
|
3707
|
+
_context74.next = 1;
|
|
3613
3708
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3614
3709
|
case 1:
|
|
3615
3710
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3621,18 +3716,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3621
3716
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3622
3717
|
case 2:
|
|
3623
3718
|
case "end":
|
|
3624
|
-
return
|
|
3719
|
+
return _context74.stop();
|
|
3625
3720
|
}
|
|
3626
|
-
},
|
|
3721
|
+
}, _callee74);
|
|
3627
3722
|
})));
|
|
3628
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3723
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
|
|
3629
3724
|
var requestSpy, warnSpy;
|
|
3630
|
-
return _regenerator.default.wrap(function (
|
|
3631
|
-
while (1) switch (
|
|
3725
|
+
return _regenerator.default.wrap(function (_context75) {
|
|
3726
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
3632
3727
|
case 0:
|
|
3633
3728
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3634
3729
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3635
|
-
|
|
3730
|
+
_context75.next = 1;
|
|
3636
3731
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3637
3732
|
case 1:
|
|
3638
3733
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3644,9 +3739,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3644
3739
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3645
3740
|
case 2:
|
|
3646
3741
|
case "end":
|
|
3647
|
-
return
|
|
3742
|
+
return _context75.stop();
|
|
3648
3743
|
}
|
|
3649
|
-
},
|
|
3744
|
+
}, _callee75);
|
|
3650
3745
|
})));
|
|
3651
3746
|
});
|
|
3652
3747
|
});
|