@webex/calling 3.12.0-next.82 → 3.12.0-next.84

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.
Files changed (36) hide show
  1. package/dist/CallingClient/CallingClient.js +13 -13
  2. package/dist/CallingClient/CallingClient.js.map +1 -1
  3. package/dist/CallingClient/calling/call.js +45 -9
  4. package/dist/CallingClient/calling/call.js.map +1 -1
  5. package/dist/CallingClient/calling/call.test.js +544 -454
  6. package/dist/CallingClient/calling/call.test.js.map +1 -1
  7. package/dist/CallingClient/calling/callManager.js +25 -4
  8. package/dist/CallingClient/calling/callManager.js.map +1 -1
  9. package/dist/CallingClient/calling/callManager.test.js +17 -0
  10. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  11. package/dist/CallingClient/calling/types.js +3 -0
  12. package/dist/CallingClient/calling/types.js.map +1 -1
  13. package/dist/CallingClient/constants.js +4 -2
  14. package/dist/CallingClient/constants.js.map +1 -1
  15. package/dist/CallingClient/types.js +7 -0
  16. package/dist/CallingClient/types.js.map +1 -1
  17. package/dist/index.js +6 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/module/CallingClient/CallingClient.js +1 -1
  20. package/dist/module/CallingClient/calling/call.js +20 -4
  21. package/dist/module/CallingClient/calling/callManager.js +12 -4
  22. package/dist/module/CallingClient/constants.js +1 -0
  23. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  24. package/dist/types/CallingClient/calling/call.d.ts +5 -3
  25. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  26. package/dist/types/CallingClient/calling/callManager.d.ts +5 -3
  27. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  28. package/dist/types/CallingClient/calling/types.d.ts +4 -0
  29. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  30. package/dist/types/CallingClient/constants.d.ts +1 -0
  31. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  32. package/dist/types/CallingClient/types.d.ts +3 -2
  33. package/dist/types/CallingClient/types.d.ts.map +1 -1
  34. package/dist/types/index.d.ts +1 -1
  35. package/dist/types/index.d.ts.map +1 -1
  36. package/package.json +4 -4
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
4
- var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
5
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
5
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
6
6
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
7
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
8
+ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
9
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
10
+ var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
7
11
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
9
13
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
10
14
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
11
15
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
12
16
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
17
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
13
18
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
14
19
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
15
20
  var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
@@ -30,10 +35,8 @@ var _Errors = require("../../Errors");
30
35
  var _constants2 = require("../../common/constants");
31
36
  var _request = require("../utils/request");
32
37
  function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
33
- /* eslint-disable @typescript-eslint/no-explicit-any */
34
- /* eslint-disable dot-notation */
35
- /* eslint-disable @typescript-eslint/no-shadow */
36
-
38
+ function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
39
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable dot-notation */ /* eslint-disable @typescript-eslint/no-shadow */
37
40
  jest.mock('../../mobius-socket', function () {
38
41
  return {
39
42
  getMobiusSocketInstance: jest.fn().mockReturnValue({
@@ -650,10 +653,97 @@ describe('Call Tests', function () {
650
653
  }
651
654
  }, _callee9);
652
655
  })));
653
- it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
656
+ var iceLiteOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'a=ice-lite\r\nm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\n';
657
+ var fullIceOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\na=ice-ufrag:mLbW\r\n';
658
+ describe.each([{
659
+ name: 'reduced timeout when the offer is ice-lite and reduceTimeoutForIceLite is enabled',
660
+ sdp: iceLiteOfferSdp,
661
+ iceGatheringConfig: {
662
+ reduceTimeoutForIceLite: true
663
+ },
664
+ expectedTimeout: _constants.ICE_LITE_CANDIDATES_TIMEOUT
665
+ }, {
666
+ name: 'custom reduced timeout when the offer is ice-lite and iceLiteTimeout is overridden',
667
+ sdp: iceLiteOfferSdp,
668
+ iceGatheringConfig: {
669
+ reduceTimeoutForIceLite: true,
670
+ iceLiteTimeout: 750
671
+ },
672
+ expectedTimeout: 750
673
+ }, {
674
+ name: 'default timeout when the offer is ice-lite but reduceTimeoutForIceLite is disabled',
675
+ sdp: iceLiteOfferSdp,
676
+ iceGatheringConfig: {
677
+ reduceTimeoutForIceLite: false
678
+ },
679
+ expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
680
+ }, {
681
+ name: 'default timeout when the offer is ice-lite but no iceGathering config is provided',
682
+ sdp: iceLiteOfferSdp,
683
+ iceGatheringConfig: undefined,
684
+ expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
685
+ }, {
686
+ name: 'default timeout when reduceTimeoutForIceLite is enabled but the offer is not ice-lite',
687
+ sdp: fullIceOfferSdp,
688
+ iceGatheringConfig: {
689
+ reduceTimeoutForIceLite: true
690
+ },
691
+ expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
692
+ }])('ICE candidates timeout selection', function (_ref16) {
693
+ var name = _ref16.name,
694
+ sdp = _ref16.sdp,
695
+ iceGatheringConfig = _ref16.iceGatheringConfig,
696
+ expectedTimeout = _ref16.expectedTimeout;
697
+ it("uses ".concat(name), /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
698
+ var mockStream, localAudioStream, call;
699
+ return _regenerator.default.wrap(function (_context0) {
700
+ while (1) switch (_context0.prev = _context0.next) {
701
+ case 0:
702
+ mockStream = {
703
+ outputStream: {
704
+ getAudioTracks: jest.fn().mockReturnValue([mockTrack])
705
+ },
706
+ on: jest.fn(),
707
+ getEffectByKind: jest.fn().mockImplementation(function () {
708
+ return mockEffect;
709
+ })
710
+ };
711
+ localAudioStream = mockStream;
712
+ call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.INBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest, iceGatheringConfig);
713
+ webex.request.mockReturnValue({
714
+ statusCode: 200,
715
+ body: {
716
+ callId: 'mock-call-id'
717
+ }
718
+ });
719
+
720
+ /* Buffer the remote offer before answering so it is available at media connection init. */
721
+ call.sendMediaStateMachineEvt({
722
+ type: 'E_RECV_ROAP_OFFER',
723
+ data: {
724
+ seq: 1,
725
+ messageType: 'OFFER',
726
+ version: 1,
727
+ sdp: sdp
728
+ }
729
+ });
730
+ _context0.next = 1;
731
+ return call.answer(localAudioStream);
732
+ case 1:
733
+ expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(_objectSpread(_objectSpread({}, roapMediaConnectionConfig), {}, {
734
+ iceCandidatesTimeout: expectedTimeout
735
+ }), roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
736
+ case 2:
737
+ case "end":
738
+ return _context0.stop();
739
+ }
740
+ }, _callee0);
741
+ })));
742
+ });
743
+ it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
654
744
  var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
655
- return _regenerator.default.wrap(function (_context0) {
656
- while (1) switch (_context0.prev = _context0.next) {
745
+ return _regenerator.default.wrap(function (_context1) {
746
+ while (1) switch (_context1.prev = _context1.next) {
657
747
  case 0:
658
748
  mockStream = {
659
749
  outputStream: {
@@ -709,7 +799,7 @@ describe('Call Tests', function () {
709
799
  });
710
800
  expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
711
801
  call.end();
712
- _context0.next = 1;
802
+ _context1.next = 1;
713
803
  return (0, _Utils.waitForMsecs)(50);
714
804
  case 1:
715
805
  /* Checks for switching off the listeners on call disconnect */
@@ -720,14 +810,14 @@ describe('Call Tests', function () {
720
810
  expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
721
811
  case 2:
722
812
  case "end":
723
- return _context0.stop();
813
+ return _context1.stop();
724
814
  }
725
- }, _callee0);
815
+ }, _callee1);
726
816
  })));
727
- it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
817
+ it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
728
818
  var mockStream, localAudioStream, warnSpy, call;
729
- return _regenerator.default.wrap(function (_context1) {
730
- while (1) switch (_context1.prev = _context1.next) {
819
+ return _regenerator.default.wrap(function (_context10) {
820
+ while (1) switch (_context10.prev = _context10.next) {
731
821
  case 0:
732
822
  mockStream = {
733
823
  outputStream: {
@@ -751,7 +841,7 @@ describe('Call Tests', function () {
751
841
  warnSpy = jest.spyOn(_Logger.default, 'warn');
752
842
  call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
753
843
  call.answer(localAudioStream);
754
- _context1.next = 1;
844
+ _context10.next = 1;
755
845
  return (0, _Utils.waitForMsecs)(50);
756
846
  case 1:
757
847
  expect(warnSpy).toBeCalledTimes(2);
@@ -766,14 +856,14 @@ describe('Call Tests', function () {
766
856
  expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
767
857
  case 2:
768
858
  case "end":
769
- return _context1.stop();
859
+ return _context10.stop();
770
860
  }
771
- }, _callee1);
861
+ }, _callee10);
772
862
  })));
773
- it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
863
+ it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
774
864
  var mockStream, localAudioStream, warnSpy, call;
775
- return _regenerator.default.wrap(function (_context10) {
776
- while (1) switch (_context10.prev = _context10.next) {
865
+ return _regenerator.default.wrap(function (_context11) {
866
+ while (1) switch (_context11.prev = _context11.next) {
777
867
  case 0:
778
868
  mockStream = {
779
869
  outputStream: {
@@ -785,7 +875,7 @@ describe('Call Tests', function () {
785
875
  warnSpy = jest.spyOn(_Logger.default, 'warn');
786
876
  call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
787
877
  call.dial(localAudioStream);
788
- _context10.next = 1;
878
+ _context11.next = 1;
789
879
  return (0, _Utils.waitForMsecs)(50);
790
880
  case 1:
791
881
  expect(warnSpy).toBeCalledTimes(1);
@@ -798,9 +888,9 @@ describe('Call Tests', function () {
798
888
  expect(webex.request).not.toBeCalledOnceWith();
799
889
  case 2:
800
890
  case "end":
801
- return _context10.stop();
891
+ return _context11.stop();
802
892
  }
803
- }, _callee10);
893
+ }, _callee11);
804
894
  })));
805
895
  it('update media after call creation with valid stream', function () {
806
896
  var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
@@ -874,10 +964,10 @@ describe('Call Tests', function () {
874
964
  method: 'dial'
875
965
  });
876
966
  });
877
- it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
967
+ it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
878
968
  var logSpy, callManager, mockStream, localAudioStream, call;
879
- return _regenerator.default.wrap(function (_context11) {
880
- while (1) switch (_context11.prev = _context11.next) {
969
+ return _regenerator.default.wrap(function (_context12) {
970
+ while (1) switch (_context12.prev = _context12.next) {
881
971
  case 0:
882
972
  logSpy = jest.spyOn(_Logger.default, 'info');
883
973
  webex.request.mockReturnValue({
@@ -953,9 +1043,9 @@ describe('Call Tests', function () {
953
1043
  expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
954
1044
  case 1:
955
1045
  case "end":
956
- return _context11.stop();
1046
+ return _context12.stop();
957
1047
  }
958
- }, _callee11);
1048
+ }, _callee12);
959
1049
  })));
960
1050
  describe('Guest Calling Flow Tests', function () {
961
1051
  var dummyEvent = {
@@ -963,10 +1053,10 @@ describe('Call Tests', function () {
963
1053
  data: undefined
964
1054
  };
965
1055
  var call;
966
- it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
1056
+ it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
967
1057
  var requestSpy, requestArgs;
968
- return _regenerator.default.wrap(function (_context12) {
969
- while (1) switch (_context12.prev = _context12.next) {
1058
+ return _regenerator.default.wrap(function (_context13) {
1059
+ while (1) switch (_context13.prev = _context13.next) {
970
1060
  case 0:
971
1061
  call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
972
1062
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -979,14 +1069,14 @@ describe('Call Tests', function () {
979
1069
  expect('callee' in requestArgs.body).toBe(true);
980
1070
  case 1:
981
1071
  case "end":
982
- return _context12.stop();
1072
+ return _context13.stop();
983
1073
  }
984
- }, _callee12);
1074
+ }, _callee13);
985
1075
  })));
986
- it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
1076
+ it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
987
1077
  var requestSpy, requestArgs;
988
- return _regenerator.default.wrap(function (_context13) {
989
- while (1) switch (_context13.prev = _context13.next) {
1078
+ return _regenerator.default.wrap(function (_context14) {
1079
+ while (1) switch (_context14.prev = _context14.next) {
990
1080
  case 0:
991
1081
  call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
992
1082
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -999,9 +1089,9 @@ describe('Call Tests', function () {
999
1089
  expect('callee' in requestArgs.body).toBe(false);
1000
1090
  case 1:
1001
1091
  case "end":
1002
- return _context13.stop();
1092
+ return _context14.stop();
1003
1093
  }
1004
- }, _callee13);
1094
+ }, _callee14);
1005
1095
  })));
1006
1096
  });
1007
1097
  });
@@ -1039,10 +1129,10 @@ describe('State Machine handler tests', function () {
1039
1129
 
1040
1130
  // afterEach(() => call.removeAllListeners());
1041
1131
 
1042
- it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
1132
+ it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
1043
1133
  var statusPayload, dummyEvent, funcSpy, logSpy;
1044
- return _regenerator.default.wrap(function (_context14) {
1045
- while (1) switch (_context14.prev = _context14.next) {
1134
+ return _regenerator.default.wrap(function (_context15) {
1135
+ while (1) switch (_context15.prev = _context15.next) {
1046
1136
  case 0:
1047
1137
  statusPayload = {
1048
1138
  statusCode: 200,
@@ -1062,7 +1152,7 @@ describe('State Machine handler tests', function () {
1062
1152
  /* This is to flush all the promises from the Promise queue so that
1063
1153
  * Jest.fakeTimers can advance time and also clear the promise Queue
1064
1154
  */
1065
- _context14.next = 1;
1155
+ _context15.next = 1;
1066
1156
  return (0, _testUtil.flushPromises)(3);
1067
1157
  case 1:
1068
1158
  expect(setInterval).toHaveBeenCalledTimes(1);
@@ -1078,14 +1168,14 @@ describe('State Machine handler tests', function () {
1078
1168
  });
1079
1169
  case 2:
1080
1170
  case "end":
1081
- return _context14.stop();
1171
+ return _context15.stop();
1082
1172
  }
1083
- }, _callee14);
1173
+ }, _callee15);
1084
1174
  })));
1085
- it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
1175
+ it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
1086
1176
  var statusPayload, emitSpy, funcSpy;
1087
- return _regenerator.default.wrap(function (_context15) {
1088
- while (1) switch (_context15.prev = _context15.next) {
1177
+ return _regenerator.default.wrap(function (_context16) {
1178
+ while (1) switch (_context16.prev = _context16.next) {
1089
1179
  case 0:
1090
1180
  expect.assertions(4);
1091
1181
  statusPayload = {
@@ -1100,10 +1190,10 @@ describe('State Machine handler tests', function () {
1100
1190
  funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
1101
1191
  call['handleCallEstablished']({});
1102
1192
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
1103
- _context15.next = 1;
1193
+ _context16.next = 1;
1104
1194
  return _promise.default.resolve();
1105
1195
  case 1:
1106
- _context15.next = 2;
1196
+ _context16.next = 2;
1107
1197
  return _promise.default.resolve();
1108
1198
  case 2:
1109
1199
  // clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
@@ -1113,14 +1203,14 @@ describe('State Machine handler tests', function () {
1113
1203
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
1114
1204
  case 3:
1115
1205
  case "end":
1116
- return _context15.stop();
1206
+ return _context16.stop();
1117
1207
  }
1118
- }, _callee15);
1208
+ }, _callee16);
1119
1209
  })));
1120
- it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
1210
+ it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
1121
1211
  var statusPayload, funcSpy;
1122
- return _regenerator.default.wrap(function (_context16) {
1123
- while (1) switch (_context16.prev = _context16.next) {
1212
+ return _regenerator.default.wrap(function (_context17) {
1213
+ while (1) switch (_context17.prev = _context17.next) {
1124
1214
  case 0:
1125
1215
  expect.assertions(4);
1126
1216
  statusPayload = {
@@ -1139,7 +1229,7 @@ describe('State Machine handler tests', function () {
1139
1229
  /* This is to flush all the promises from the Promise queue so that
1140
1230
  * Jest.fakeTimers can advance time and also clear the promise Queue
1141
1231
  */
1142
- _context16.next = 1;
1232
+ _context17.next = 1;
1143
1233
  return (0, _testUtil.flushPromises)(2);
1144
1234
  case 1:
1145
1235
  // clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
@@ -1148,14 +1238,14 @@ describe('State Machine handler tests', function () {
1148
1238
  expect(funcSpy).toBeCalledTimes(1);
1149
1239
  case 2:
1150
1240
  case "end":
1151
- return _context16.stop();
1241
+ return _context17.stop();
1152
1242
  }
1153
- }, _callee16);
1243
+ }, _callee17);
1154
1244
  })));
1155
- it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
1245
+ it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
1156
1246
  var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
1157
- return _regenerator.default.wrap(function (_context17) {
1158
- while (1) switch (_context17.prev = _context17.next) {
1247
+ return _regenerator.default.wrap(function (_context18) {
1248
+ while (1) switch (_context18.prev = _context18.next) {
1159
1249
  case 0:
1160
1250
  errorPayload = {
1161
1251
  statusCode: 500,
@@ -1173,28 +1263,28 @@ describe('State Machine handler tests', function () {
1173
1263
  call['handleCallEstablished']({});
1174
1264
  }
1175
1265
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
1176
- _context17.next = 1;
1266
+ _context18.next = 1;
1177
1267
  return (0, _testUtil.flushPromises)(2);
1178
1268
  case 1:
1179
1269
  expect(postStatusSpy).toHaveBeenCalledTimes(1);
1180
1270
 
1181
1271
  // Now advance by 1 second for the retry-after interval
1182
1272
  jest.advanceTimersByTime(1000);
1183
- _context17.next = 2;
1273
+ _context18.next = 2;
1184
1274
  return (0, _testUtil.flushPromises)(2);
1185
1275
  case 2:
1186
1276
  expect(postStatusSpy).toHaveBeenCalledTimes(2);
1187
1277
  expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
1188
1278
  case 3:
1189
1279
  case "end":
1190
- return _context17.stop();
1280
+ return _context18.stop();
1191
1281
  }
1192
- }, _callee17);
1282
+ }, _callee18);
1193
1283
  })));
1194
- it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
1284
+ it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
1195
1285
  var firstTimer, secondTimer;
1196
- return _regenerator.default.wrap(function (_context18) {
1197
- while (1) switch (_context18.prev = _context18.next) {
1286
+ return _regenerator.default.wrap(function (_context19) {
1287
+ while (1) switch (_context19.prev = _context19.next) {
1198
1288
  case 0:
1199
1289
  jest.spyOn(global, 'setInterval');
1200
1290
  jest.spyOn(global, 'clearInterval');
@@ -1222,14 +1312,14 @@ describe('State Machine handler tests', function () {
1222
1312
  expect(secondTimer).toBeDefined();
1223
1313
  case 1:
1224
1314
  case "end":
1225
- return _context18.stop();
1315
+ return _context19.stop();
1226
1316
  }
1227
- }, _callee18);
1317
+ }, _callee19);
1228
1318
  })));
1229
- it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
1319
+ it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1230
1320
  var errorPayload, warnSpy, postStatusSpy;
1231
- return _regenerator.default.wrap(function (_context19) {
1232
- while (1) switch (_context19.prev = _context19.next) {
1321
+ return _regenerator.default.wrap(function (_context20) {
1322
+ while (1) switch (_context20.prev = _context20.next) {
1233
1323
  case 0:
1234
1324
  errorPayload = {
1235
1325
  statusCode: 500,
@@ -1248,25 +1338,25 @@ describe('State Machine handler tests', function () {
1248
1338
 
1249
1339
  // Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
1250
1340
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
1251
- _context19.next = 1;
1341
+ _context20.next = 1;
1252
1342
  return (0, _testUtil.flushPromises)(2);
1253
1343
  case 1:
1254
1344
  // Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
1255
1345
  // Need to do this separately to allow state machine to process and create new intervals
1256
1346
  jest.advanceTimersByTime(1000);
1257
- _context19.next = 2;
1347
+ _context20.next = 2;
1258
1348
  return (0, _testUtil.flushPromises)(2);
1259
1349
  case 2:
1260
1350
  jest.advanceTimersByTime(1000);
1261
- _context19.next = 3;
1351
+ _context20.next = 3;
1262
1352
  return (0, _testUtil.flushPromises)(2);
1263
1353
  case 3:
1264
1354
  jest.advanceTimersByTime(1000);
1265
- _context19.next = 4;
1355
+ _context20.next = 4;
1266
1356
  return (0, _testUtil.flushPromises)(2);
1267
1357
  case 4:
1268
1358
  jest.advanceTimersByTime(1000);
1269
- _context19.next = 5;
1359
+ _context20.next = 5;
1270
1360
  return (0, _testUtil.flushPromises)(2);
1271
1361
  case 5:
1272
1362
  // The error handler should detect we're at max retry count and stop
@@ -1278,14 +1368,14 @@ describe('State Machine handler tests', function () {
1278
1368
  expect(call['callKeepaliveRetryCount']).toBe(4);
1279
1369
  case 6:
1280
1370
  case "end":
1281
- return _context19.stop();
1371
+ return _context20.stop();
1282
1372
  }
1283
- }, _callee19);
1373
+ }, _callee20);
1284
1374
  })));
1285
- it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1375
+ it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1286
1376
  var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
1287
- return _regenerator.default.wrap(function (_context20) {
1288
- while (1) switch (_context20.prev = _context20.next) {
1377
+ return _regenerator.default.wrap(function (_context21) {
1378
+ while (1) switch (_context21.prev = _context21.next) {
1289
1379
  case 0:
1290
1380
  statusPayload = {
1291
1381
  statusCode: 200,
@@ -1341,14 +1431,14 @@ describe('State Machine handler tests', function () {
1341
1431
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1342
1432
  case 1:
1343
1433
  case "end":
1344
- return _context20.stop();
1434
+ return _context21.stop();
1345
1435
  }
1346
- }, _callee20);
1436
+ }, _callee21);
1347
1437
  })));
1348
- it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1438
+ it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1349
1439
  var statusPayload, dummyEvent;
1350
- return _regenerator.default.wrap(function (_context21) {
1351
- while (1) switch (_context21.prev = _context21.next) {
1440
+ return _regenerator.default.wrap(function (_context22) {
1441
+ while (1) switch (_context22.prev = _context22.next) {
1352
1442
  case 0:
1353
1443
  call['direction'] = _types3.CallDirection.INBOUND;
1354
1444
  statusPayload = {
@@ -1366,7 +1456,7 @@ describe('State Machine handler tests', function () {
1366
1456
  webex.request.mockReturnValue(statusPayload);
1367
1457
  call.sendCallStateMachineEvt(dummyEvent);
1368
1458
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
1369
- _context21.next = 1;
1459
+ _context22.next = 1;
1370
1460
  return call['handleOutgoingCallConnect']({
1371
1461
  type: 'E_SEND_CALL_CONNECT'
1372
1462
  });
@@ -1380,14 +1470,14 @@ describe('State Machine handler tests', function () {
1380
1470
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1381
1471
  case 2:
1382
1472
  case "end":
1383
- return _context21.stop();
1473
+ return _context22.stop();
1384
1474
  }
1385
- }, _callee21);
1475
+ }, _callee22);
1386
1476
  })));
1387
- it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1477
+ it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1388
1478
  var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
1389
- return _regenerator.default.wrap(function (_context22) {
1390
- while (1) switch (_context22.prev = _context22.next) {
1479
+ return _regenerator.default.wrap(function (_context23) {
1480
+ while (1) switch (_context23.prev = _context23.next) {
1391
1481
  case 0:
1392
1482
  callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
1393
1483
  statusPayload = {
@@ -1481,14 +1571,14 @@ describe('State Machine handler tests', function () {
1481
1571
  expect(call.earlyMedia).not.toBe(true);
1482
1572
  case 1:
1483
1573
  case "end":
1484
- return _context22.stop();
1574
+ return _context23.stop();
1485
1575
  }
1486
- }, _callee22);
1576
+ }, _callee23);
1487
1577
  })));
1488
- it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1578
+ it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1489
1579
  var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
1490
- return _regenerator.default.wrap(function (_context23) {
1491
- while (1) switch (_context23.prev = _context23.next) {
1580
+ return _regenerator.default.wrap(function (_context24) {
1581
+ while (1) switch (_context24.prev = _context24.next) {
1492
1582
  case 0:
1493
1583
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1494
1584
  errorSpy = jest.spyOn(_Logger.default, 'error');
@@ -1515,7 +1605,7 @@ describe('State Machine handler tests', function () {
1515
1605
  webex.request.mockRejectedValueOnce({
1516
1606
  statusCode: 403
1517
1607
  }).mockResolvedValue(statusPayload);
1518
- _context23.next = 1;
1608
+ _context24.next = 1;
1519
1609
  return call['handleOutgoingCallConnect']({
1520
1610
  type: 'E_SEND_CALL_CONNECT'
1521
1611
  });
@@ -1526,14 +1616,14 @@ describe('State Machine handler tests', function () {
1526
1616
  expect(errorSpy).toBeCalledTimes(1);
1527
1617
  case 2:
1528
1618
  case "end":
1529
- return _context23.stop();
1619
+ return _context24.stop();
1530
1620
  }
1531
- }, _callee23);
1621
+ }, _callee24);
1532
1622
  })));
1533
- it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1623
+ it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1534
1624
  var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
1535
- return _regenerator.default.wrap(function (_context24) {
1536
- while (1) switch (_context24.prev = _context24.next) {
1625
+ return _regenerator.default.wrap(function (_context25) {
1626
+ while (1) switch (_context25.prev = _context25.next) {
1537
1627
  case 0:
1538
1628
  statusPayload = {
1539
1629
  statusCode: 200,
@@ -1609,14 +1699,14 @@ describe('State Machine handler tests', function () {
1609
1699
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1610
1700
  case 1:
1611
1701
  case "end":
1612
- return _context24.stop();
1702
+ return _context25.stop();
1613
1703
  }
1614
- }, _callee24);
1704
+ }, _callee25);
1615
1705
  })));
1616
- 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() {
1706
+ it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1617
1707
  var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
1618
- return _regenerator.default.wrap(function (_context25) {
1619
- while (1) switch (_context25.prev = _context25.next) {
1708
+ return _regenerator.default.wrap(function (_context26) {
1709
+ while (1) switch (_context26.prev = _context26.next) {
1620
1710
  case 0:
1621
1711
  statusPayload = {
1622
1712
  statusCode: 200,
@@ -1684,14 +1774,14 @@ describe('State Machine handler tests', function () {
1684
1774
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1685
1775
  case 1:
1686
1776
  case "end":
1687
- return _context25.stop();
1777
+ return _context26.stop();
1688
1778
  }
1689
- }, _callee25);
1779
+ }, _callee26);
1690
1780
  })));
1691
- it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1781
+ it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1692
1782
  var statusPayload, dummyEvent;
1693
- return _regenerator.default.wrap(function (_context26) {
1694
- while (1) switch (_context26.prev = _context26.next) {
1783
+ return _regenerator.default.wrap(function (_context27) {
1784
+ while (1) switch (_context27.prev = _context27.next) {
1695
1785
  case 0:
1696
1786
  statusPayload = {
1697
1787
  statusCode: 200,
@@ -1730,14 +1820,14 @@ describe('State Machine handler tests', function () {
1730
1820
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1731
1821
  case 1:
1732
1822
  case "end":
1733
- return _context26.stop();
1823
+ return _context27.stop();
1734
1824
  }
1735
- }, _callee26);
1825
+ }, _callee27);
1736
1826
  })));
1737
- it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1827
+ it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1738
1828
  var statusPayload, dummyEvent, errorSpy;
1739
- return _regenerator.default.wrap(function (_context27) {
1740
- while (1) switch (_context27.prev = _context27.next) {
1829
+ return _regenerator.default.wrap(function (_context28) {
1830
+ while (1) switch (_context28.prev = _context28.next) {
1741
1831
  case 0:
1742
1832
  statusPayload = {
1743
1833
  statusCode: 403,
@@ -1754,13 +1844,13 @@ describe('State Machine handler tests', function () {
1754
1844
  webex.request.mockRejectedValueOnce(statusPayload);
1755
1845
  errorSpy = jest.spyOn(_Logger.default, 'error');
1756
1846
  call.sendCallStateMachineEvt(dummyEvent);
1757
- _context27.next = 1;
1847
+ _context28.next = 1;
1758
1848
  return (0, _testUtil.flushPromises)(3);
1759
1849
  case 1:
1760
- _context27.next = 2;
1850
+ _context28.next = 2;
1761
1851
  return _promise.default.resolve();
1762
1852
  case 2:
1763
- _context27.next = 3;
1853
+ _context28.next = 3;
1764
1854
  return _promise.default.resolve();
1765
1855
  case 3:
1766
1856
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
@@ -1771,14 +1861,14 @@ describe('State Machine handler tests', function () {
1771
1861
  });
1772
1862
  case 4:
1773
1863
  case "end":
1774
- return _context27.stop();
1864
+ return _context28.stop();
1775
1865
  }
1776
- }, _callee27);
1866
+ }, _callee28);
1777
1867
  })));
1778
- it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1868
+ it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1779
1869
  var statusPayload, dummyEvent, warnSpy;
1780
- return _regenerator.default.wrap(function (_context28) {
1781
- while (1) switch (_context28.prev = _context28.next) {
1870
+ return _regenerator.default.wrap(function (_context29) {
1871
+ while (1) switch (_context29.prev = _context29.next) {
1782
1872
  case 0:
1783
1873
  statusPayload = {
1784
1874
  statusCode: 403,
@@ -1797,16 +1887,16 @@ describe('State Machine handler tests', function () {
1797
1887
  webex.request.mockRejectedValue(statusPayload);
1798
1888
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1799
1889
  jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
1800
- _context28.next = 1;
1890
+ _context29.next = 1;
1801
1891
  return call['handleRoapEstablished']({}, dummyEvent);
1802
1892
  case 1:
1803
- _context28.next = 2;
1893
+ _context29.next = 2;
1804
1894
  return (0, _testUtil.flushPromises)(2);
1805
1895
  case 2:
1806
- _context28.next = 3;
1896
+ _context29.next = 3;
1807
1897
  return _promise.default.resolve();
1808
1898
  case 3:
1809
- _context28.next = 4;
1899
+ _context29.next = 4;
1810
1900
  return _promise.default.resolve();
1811
1901
  case 4:
1812
1902
  expect(call.isConnected()).toBe(false);
@@ -1822,14 +1912,14 @@ describe('State Machine handler tests', function () {
1822
1912
  });
1823
1913
  case 5:
1824
1914
  case "end":
1825
- return _context28.stop();
1915
+ return _context29.stop();
1826
1916
  }
1827
- }, _callee28);
1917
+ }, _callee29);
1828
1918
  })));
1829
- it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1919
+ it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1830
1920
  var statusPayload, dummyEvent;
1831
- return _regenerator.default.wrap(function (_context29) {
1832
- while (1) switch (_context29.prev = _context29.next) {
1921
+ return _regenerator.default.wrap(function (_context30) {
1922
+ while (1) switch (_context30.prev = _context30.next) {
1833
1923
  case 0:
1834
1924
  statusPayload = {
1835
1925
  statusCode: 403,
@@ -1852,14 +1942,14 @@ describe('State Machine handler tests', function () {
1852
1942
  expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
1853
1943
  case 1:
1854
1944
  case "end":
1855
- return _context29.stop();
1945
+ return _context30.stop();
1856
1946
  }
1857
- }, _callee29);
1947
+ }, _callee30);
1858
1948
  })));
1859
- it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1949
+ it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1860
1950
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1861
- return _regenerator.default.wrap(function (_context30) {
1862
- while (1) switch (_context30.prev = _context30.next) {
1951
+ return _regenerator.default.wrap(function (_context31) {
1952
+ while (1) switch (_context31.prev = _context31.next) {
1863
1953
  case 0:
1864
1954
  statusPayload = {
1865
1955
  statusCode: 503,
@@ -1881,7 +1971,7 @@ describe('State Machine handler tests', function () {
1881
1971
  }
1882
1972
  };
1883
1973
  call['connected'] = true;
1884
- _context30.next = 1;
1974
+ _context31.next = 1;
1885
1975
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1886
1976
  case 1:
1887
1977
  jest.advanceTimersByTime(1005);
@@ -1893,14 +1983,14 @@ describe('State Machine handler tests', function () {
1893
1983
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1894
1984
  case 2:
1895
1985
  case "end":
1896
- return _context30.stop();
1986
+ return _context31.stop();
1897
1987
  }
1898
- }, _callee30);
1988
+ }, _callee31);
1899
1989
  })));
1900
- it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1990
+ it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1901
1991
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1902
- return _regenerator.default.wrap(function (_context31) {
1903
- while (1) switch (_context31.prev = _context31.next) {
1992
+ return _regenerator.default.wrap(function (_context32) {
1993
+ while (1) switch (_context32.prev = _context32.next) {
1904
1994
  case 0:
1905
1995
  statusPayload = {
1906
1996
  statusCode: 503,
@@ -1922,7 +2012,7 @@ describe('State Machine handler tests', function () {
1922
2012
  }
1923
2013
  };
1924
2014
  call['connected'] = false;
1925
- _context31.next = 1;
2015
+ _context32.next = 1;
1926
2016
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1927
2017
  case 1:
1928
2018
  jest.advanceTimersByTime(1005);
@@ -1933,14 +2023,14 @@ describe('State Machine handler tests', function () {
1933
2023
  expect(stateMachineSpy).not.toBeCalled();
1934
2024
  case 2:
1935
2025
  case "end":
1936
- return _context31.stop();
2026
+ return _context32.stop();
1937
2027
  }
1938
- }, _callee31);
2028
+ }, _callee32);
1939
2029
  })));
1940
- it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
2030
+ it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1941
2031
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1942
- return _regenerator.default.wrap(function (_context32) {
1943
- while (1) switch (_context32.prev = _context32.next) {
2032
+ return _regenerator.default.wrap(function (_context33) {
2033
+ while (1) switch (_context33.prev = _context33.next) {
1944
2034
  case 0:
1945
2035
  statusPayload = {
1946
2036
  statusCode: 503,
@@ -1962,7 +2052,7 @@ describe('State Machine handler tests', function () {
1962
2052
  };
1963
2053
  call['connected'] = true;
1964
2054
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
1965
- _context32.next = 1;
2055
+ _context33.next = 1;
1966
2056
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1967
2057
  case 1:
1968
2058
  jest.advanceTimersByTime(1005);
@@ -1974,14 +2064,14 @@ describe('State Machine handler tests', function () {
1974
2064
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1975
2065
  case 2:
1976
2066
  case "end":
1977
- return _context32.stop();
2067
+ return _context33.stop();
1978
2068
  }
1979
- }, _callee32);
2069
+ }, _callee33);
1980
2070
  })));
1981
- it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
2071
+ it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1982
2072
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1983
- return _regenerator.default.wrap(function (_context33) {
1984
- while (1) switch (_context33.prev = _context33.next) {
2073
+ return _regenerator.default.wrap(function (_context34) {
2074
+ while (1) switch (_context34.prev = _context34.next) {
1985
2075
  case 0:
1986
2076
  statusPayload = {
1987
2077
  statusCode: 503,
@@ -2002,7 +2092,7 @@ describe('State Machine handler tests', function () {
2002
2092
  }
2003
2093
  };
2004
2094
  call['connected'] = false;
2005
- _context33.next = 1;
2095
+ _context34.next = 1;
2006
2096
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2007
2097
  case 1:
2008
2098
  jest.advanceTimersByTime(1005);
@@ -2014,14 +2104,14 @@ describe('State Machine handler tests', function () {
2014
2104
  expect(stateMachineSpy).not.toBeCalled();
2015
2105
  case 2:
2016
2106
  case "end":
2017
- return _context33.stop();
2107
+ return _context34.stop();
2018
2108
  }
2019
- }, _callee33);
2109
+ }, _callee34);
2020
2110
  })));
2021
- it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
2111
+ it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
2022
2112
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
2023
- return _regenerator.default.wrap(function (_context34) {
2024
- while (1) switch (_context34.prev = _context34.next) {
2113
+ return _regenerator.default.wrap(function (_context35) {
2114
+ while (1) switch (_context35.prev = _context35.next) {
2025
2115
  case 0:
2026
2116
  statusPayload = {
2027
2117
  statusCode: 200,
@@ -2046,14 +2136,14 @@ describe('State Machine handler tests', function () {
2046
2136
  expect(stateMachineSpy).not.toHaveBeenCalled();
2047
2137
  case 1:
2048
2138
  case "end":
2049
- return _context34.stop();
2139
+ return _context35.stop();
2050
2140
  }
2051
- }, _callee34);
2141
+ }, _callee35);
2052
2142
  })));
2053
- it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
2143
+ it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
2054
2144
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
2055
- return _regenerator.default.wrap(function (_context35) {
2056
- while (1) switch (_context35.prev = _context35.next) {
2145
+ return _regenerator.default.wrap(function (_context36) {
2146
+ while (1) switch (_context36.prev = _context36.next) {
2057
2147
  case 0:
2058
2148
  statusPayload = {
2059
2149
  statusCode: 503,
@@ -2075,7 +2165,7 @@ describe('State Machine handler tests', function () {
2075
2165
  };
2076
2166
  call['connected'] = true;
2077
2167
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
2078
- _context35.next = 1;
2168
+ _context36.next = 1;
2079
2169
  return call['handleRoapEstablished']({}, dummyEvent);
2080
2170
  case 1:
2081
2171
  jest.advanceTimersByTime(1005);
@@ -2087,14 +2177,14 @@ describe('State Machine handler tests', function () {
2087
2177
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
2088
2178
  case 2:
2089
2179
  case "end":
2090
- return _context35.stop();
2180
+ return _context36.stop();
2091
2181
  }
2092
- }, _callee35);
2182
+ }, _callee36);
2093
2183
  })));
2094
- it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
2184
+ it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
2095
2185
  var statusPayload, stateMachineSpy, funcSpy, errorEvent;
2096
- return _regenerator.default.wrap(function (_context36) {
2097
- while (1) switch (_context36.prev = _context36.next) {
2186
+ return _regenerator.default.wrap(function (_context37) {
2187
+ while (1) switch (_context37.prev = _context37.next) {
2098
2188
  case 0:
2099
2189
  statusPayload = {
2100
2190
  statusCode: 403,
@@ -2117,14 +2207,14 @@ describe('State Machine handler tests', function () {
2117
2207
  expect(stateMachineSpy).not.toHaveBeenCalled();
2118
2208
  case 1:
2119
2209
  case "end":
2120
- return _context36.stop();
2210
+ return _context37.stop();
2121
2211
  }
2122
- }, _callee36);
2212
+ }, _callee37);
2123
2213
  })));
2124
- it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
2214
+ it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
2125
2215
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
2126
- return _regenerator.default.wrap(function (_context37) {
2127
- while (1) switch (_context37.prev = _context37.next) {
2216
+ return _regenerator.default.wrap(function (_context38) {
2217
+ while (1) switch (_context38.prev = _context38.next) {
2128
2218
  case 0:
2129
2219
  statusPayload = {
2130
2220
  statusCode: 200,
@@ -2142,7 +2232,7 @@ describe('State Machine handler tests', function () {
2142
2232
  }
2143
2233
  };
2144
2234
  call['connected'] = false;
2145
- _context37.next = 1;
2235
+ _context38.next = 1;
2146
2236
  return call['handleRoapError']({}, errorEvent);
2147
2237
  case 1:
2148
2238
  expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
@@ -2158,14 +2248,14 @@ describe('State Machine handler tests', function () {
2158
2248
  });
2159
2249
  case 2:
2160
2250
  case "end":
2161
- return _context37.stop();
2251
+ return _context38.stop();
2162
2252
  }
2163
- }, _callee37);
2253
+ }, _callee38);
2164
2254
  })));
2165
- it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
2255
+ it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2166
2256
  var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
2167
- return _regenerator.default.wrap(function (_context38) {
2168
- while (1) switch (_context38.prev = _context38.next) {
2257
+ return _regenerator.default.wrap(function (_context39) {
2258
+ while (1) switch (_context39.prev = _context39.next) {
2169
2259
  case 0:
2170
2260
  statusPayload = {
2171
2261
  statusCode: 403,
@@ -2203,16 +2293,16 @@ describe('State Machine handler tests', function () {
2203
2293
  messageType: 'ANSWER'
2204
2294
  }
2205
2295
  };
2206
- _context38.next = 1;
2296
+ _context39.next = 1;
2207
2297
  return call.sendMediaStateMachineEvt(answerEvent);
2208
2298
  case 1:
2209
- _context38.next = 2;
2299
+ _context39.next = 2;
2210
2300
  return (0, _testUtil.flushPromises)(2);
2211
2301
  case 2:
2212
- _context38.next = 3;
2302
+ _context39.next = 3;
2213
2303
  return _promise.default.resolve();
2214
2304
  case 3:
2215
- _context38.next = 4;
2305
+ _context39.next = 4;
2216
2306
  return _promise.default.resolve();
2217
2307
  case 4:
2218
2308
  expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
@@ -2230,14 +2320,14 @@ describe('State Machine handler tests', function () {
2230
2320
  expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
2231
2321
  case 5:
2232
2322
  case "end":
2233
- return _context38.stop();
2323
+ return _context39.stop();
2234
2324
  }
2235
- }, _callee38);
2325
+ }, _callee39);
2236
2326
  })));
2237
- it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2327
+ it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2238
2328
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
2239
- return _regenerator.default.wrap(function (_context39) {
2240
- while (1) switch (_context39.prev = _context39.next) {
2329
+ return _regenerator.default.wrap(function (_context40) {
2330
+ while (1) switch (_context40.prev = _context40.next) {
2241
2331
  case 0:
2242
2332
  statusPayload = {
2243
2333
  statusCode: 200,
@@ -2270,7 +2360,7 @@ describe('State Machine handler tests', function () {
2270
2360
  seq: 1,
2271
2361
  messageType: 'ANSWER'
2272
2362
  };
2273
- _context39.next = 1;
2363
+ _context40.next = 1;
2274
2364
  return call.sendMediaStateMachineEvt(dummyEvent);
2275
2365
  case 1:
2276
2366
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -2292,7 +2382,7 @@ describe('State Machine handler tests', function () {
2292
2382
  seq: 2,
2293
2383
  messageType: 'OFFER_REQUEST'
2294
2384
  };
2295
- _context39.next = 2;
2385
+ _context40.next = 2;
2296
2386
  return call.sendMediaStateMachineEvt(dummyEvent);
2297
2387
  case 2:
2298
2388
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -2342,7 +2432,7 @@ describe('State Machine handler tests', function () {
2342
2432
  };
2343
2433
  call.sendCallStateMachineEvt(dummyEvent);
2344
2434
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
2345
- _context39.next = 3;
2435
+ _context40.next = 3;
2346
2436
  return call.sendMediaStateMachineEvt(dummyEvent);
2347
2437
  case 3:
2348
2438
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2351,7 +2441,7 @@ describe('State Machine handler tests', function () {
2351
2441
  seq: 3,
2352
2442
  messageType: 'ANSWER'
2353
2443
  };
2354
- _context39.next = 4;
2444
+ _context40.next = 4;
2355
2445
  return call.sendMediaStateMachineEvt(dummyEvent);
2356
2446
  case 4:
2357
2447
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2370,7 +2460,7 @@ describe('State Machine handler tests', function () {
2370
2460
  messageType: 'OK'
2371
2461
  }
2372
2462
  };
2373
- _context39.next = 5;
2463
+ _context40.next = 5;
2374
2464
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2375
2465
  case 5:
2376
2466
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
@@ -2385,14 +2475,14 @@ describe('State Machine handler tests', function () {
2385
2475
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2386
2476
  case 6:
2387
2477
  case "end":
2388
- return _context39.stop();
2478
+ return _context40.stop();
2389
2479
  }
2390
- }, _callee39);
2480
+ }, _callee40);
2391
2481
  })));
2392
- 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() {
2482
+ it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2393
2483
  var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
2394
- return _regenerator.default.wrap(function (_context40) {
2395
- while (1) switch (_context40.prev = _context40.next) {
2484
+ return _regenerator.default.wrap(function (_context41) {
2485
+ while (1) switch (_context41.prev = _context41.next) {
2396
2486
  case 0:
2397
2487
  mockStatusBody = {
2398
2488
  device: {
@@ -2432,7 +2522,7 @@ describe('State Machine handler tests', function () {
2432
2522
  seq: 1,
2433
2523
  messageType: 'ANSWER'
2434
2524
  };
2435
- _context40.next = 1;
2525
+ _context41.next = 1;
2436
2526
  return call.sendMediaStateMachineEvt(dummyEvent);
2437
2527
  case 1:
2438
2528
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -2454,7 +2544,7 @@ describe('State Machine handler tests', function () {
2454
2544
  seq: 2,
2455
2545
  messageType: 'OFFER_REQUEST'
2456
2546
  };
2457
- _context40.next = 2;
2547
+ _context41.next = 2;
2458
2548
  return call.sendMediaStateMachineEvt(dummyEvent);
2459
2549
  case 2:
2460
2550
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -2504,7 +2594,7 @@ describe('State Machine handler tests', function () {
2504
2594
  };
2505
2595
  call.sendCallStateMachineEvt(dummyEvent);
2506
2596
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
2507
- _context40.next = 3;
2597
+ _context41.next = 3;
2508
2598
  return call.sendMediaStateMachineEvt(dummyEvent);
2509
2599
  case 3:
2510
2600
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2513,7 +2603,7 @@ describe('State Machine handler tests', function () {
2513
2603
  seq: 3,
2514
2604
  messageType: 'ANSWER'
2515
2605
  };
2516
- _context40.next = 4;
2606
+ _context41.next = 4;
2517
2607
  return call.sendMediaStateMachineEvt(dummyEvent);
2518
2608
  case 4:
2519
2609
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2530,7 +2620,7 @@ describe('State Machine handler tests', function () {
2530
2620
  }
2531
2621
  };
2532
2622
  call.sendMediaStateMachineEvt(dummyEvent);
2533
- _context40.next = 5;
2623
+ _context41.next = 5;
2534
2624
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2535
2625
  case 5:
2536
2626
  expect(call['receivedRoapOKSeq']).toBe(3);
@@ -2546,14 +2636,14 @@ describe('State Machine handler tests', function () {
2546
2636
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2547
2637
  case 6:
2548
2638
  case "end":
2549
- return _context40.stop();
2639
+ return _context41.stop();
2550
2640
  }
2551
- }, _callee40);
2641
+ }, _callee41);
2552
2642
  })));
2553
- it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2643
+ it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
2554
2644
  var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
2555
- return _regenerator.default.wrap(function (_context41) {
2556
- while (1) switch (_context41.prev = _context41.next) {
2645
+ return _regenerator.default.wrap(function (_context42) {
2646
+ while (1) switch (_context42.prev = _context42.next) {
2557
2647
  case 0:
2558
2648
  statusPayload = {
2559
2649
  statusCode: 200,
@@ -2620,14 +2710,14 @@ describe('State Machine handler tests', function () {
2620
2710
  });
2621
2711
  case 1:
2622
2712
  case "end":
2623
- return _context41.stop();
2713
+ return _context42.stop();
2624
2714
  }
2625
- }, _callee41);
2715
+ }, _callee42);
2626
2716
  })));
2627
- it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
2717
+ it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
2628
2718
  var emitSpy, deleteSpy;
2629
- return _regenerator.default.wrap(function (_context42) {
2630
- while (1) switch (_context42.prev = _context42.next) {
2719
+ return _regenerator.default.wrap(function (_context43) {
2720
+ while (1) switch (_context43.prev = _context43.next) {
2631
2721
  case 0:
2632
2722
  emitSpy = jest.spyOn(call, 'emit');
2633
2723
  deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
@@ -2636,7 +2726,7 @@ describe('State Machine handler tests', function () {
2636
2726
  call.sendCallStateMachineEvt({
2637
2727
  type: 'E_RECV_CALL_DISCONNECT'
2638
2728
  });
2639
- _context42.next = 1;
2729
+ _context43.next = 1;
2640
2730
  return (0, _testUtil.flushPromises)(1);
2641
2731
  case 1:
2642
2732
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
@@ -2644,9 +2734,9 @@ describe('State Machine handler tests', function () {
2644
2734
  expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
2645
2735
  case 2:
2646
2736
  case "end":
2647
- return _context42.stop();
2737
+ return _context43.stop();
2648
2738
  }
2649
- }, _callee42);
2739
+ }, _callee43);
2650
2740
  })));
2651
2741
  describe('Call event timers tests', function () {
2652
2742
  var callManager;
@@ -2657,10 +2747,10 @@ describe('State Machine handler tests', function () {
2657
2747
  afterEach(function () {
2658
2748
  jest.clearAllTimers();
2659
2749
  });
2660
- it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
2750
+ it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
2661
2751
  var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
2662
- return _regenerator.default.wrap(function (_context43) {
2663
- while (1) switch (_context43.prev = _context43.next) {
2752
+ return _regenerator.default.wrap(function (_context44) {
2753
+ while (1) switch (_context44.prev = _context44.next) {
2664
2754
  case 0:
2665
2755
  statusPayload = {
2666
2756
  statusCode: 200,
@@ -2677,7 +2767,7 @@ describe('State Machine handler tests', function () {
2677
2767
  webex.request.mockReturnValue(statusPayload);
2678
2768
 
2679
2769
  // handleOutgoingCallSetup is asynchronous
2680
- _context43.next = 1;
2770
+ _context44.next = 1;
2681
2771
  return call.sendCallStateMachineEvt(dummyEvent);
2682
2772
  case 1:
2683
2773
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2720,14 +2810,14 @@ describe('State Machine handler tests', function () {
2720
2810
  expect(callManager.callCollection).toStrictEqual({});
2721
2811
  case 2:
2722
2812
  case "end":
2723
- return _context43.stop();
2813
+ return _context44.stop();
2724
2814
  }
2725
- }, _callee43);
2815
+ }, _callee44);
2726
2816
  })));
2727
- it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
2817
+ it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
2728
2818
  var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
2729
- return _regenerator.default.wrap(function (_context44) {
2730
- while (1) switch (_context44.prev = _context44.next) {
2819
+ return _regenerator.default.wrap(function (_context45) {
2820
+ while (1) switch (_context45.prev = _context45.next) {
2731
2821
  case 0:
2732
2822
  statusPayload = {
2733
2823
  statusCode: 200,
@@ -2746,7 +2836,7 @@ describe('State Machine handler tests', function () {
2746
2836
  expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
2747
2837
 
2748
2838
  // handleOutgoingCallSetup is asynchronous
2749
- _context44.next = 1;
2839
+ _context45.next = 1;
2750
2840
  return call.sendCallStateMachineEvt(dummyEvent);
2751
2841
  case 1:
2752
2842
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2758,9 +2848,9 @@ describe('State Machine handler tests', function () {
2758
2848
  expect(callManager.callCollection).toStrictEqual({});
2759
2849
  case 2:
2760
2850
  case "end":
2761
- return _context44.stop();
2851
+ return _context45.stop();
2762
2852
  }
2763
- }, _callee44);
2853
+ }, _callee45);
2764
2854
  })));
2765
2855
  });
2766
2856
  });
@@ -2825,10 +2915,10 @@ describe('Supplementary Services tests', function () {
2825
2915
  beforeEach(function () {
2826
2916
  call.removeAllListeners();
2827
2917
  });
2828
- it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
2918
+ it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
2829
2919
  var responsePayload, warnSpy, roapEvent;
2830
- return _regenerator.default.wrap(function (_context46) {
2831
- while (1) switch (_context46.prev = _context46.next) {
2920
+ return _regenerator.default.wrap(function (_context47) {
2921
+ while (1) switch (_context47.prev = _context47.next) {
2832
2922
  case 0:
2833
2923
  expect.assertions(7);
2834
2924
  responsePayload = {
@@ -2841,25 +2931,25 @@ describe('Supplementary Services tests', function () {
2841
2931
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2842
2932
  call['held'] = false;
2843
2933
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2844
- var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
2845
- return _regenerator.default.wrap(function (_context45) {
2846
- while (1) switch (_context45.prev = _context45.next) {
2934
+ var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(correlationId) {
2935
+ return _regenerator.default.wrap(function (_context46) {
2936
+ while (1) switch (_context46.prev = _context46.next) {
2847
2937
  case 0:
2848
2938
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2849
2939
  case 1:
2850
2940
  case "end":
2851
- return _context45.stop();
2941
+ return _context46.stop();
2852
2942
  }
2853
- }, _callee45);
2943
+ }, _callee46);
2854
2944
  }));
2855
2945
  return function (_x) {
2856
- return _ref54.apply(this, arguments);
2946
+ return _ref56.apply(this, arguments);
2857
2947
  };
2858
2948
  }());
2859
- _context46.next = 1;
2949
+ _context47.next = 1;
2860
2950
  return call.doHoldResume();
2861
2951
  case 1:
2862
- _context46.next = 2;
2952
+ _context47.next = 2;
2863
2953
  return (0, _testUtil.flushPromises)(2);
2864
2954
  case 2:
2865
2955
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2875,11 +2965,11 @@ describe('Supplementary Services tests', function () {
2875
2965
  call['handleIncomingRoapOffer']({}, dummyEvent);
2876
2966
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2877
2967
  roapEvent.data.type = 'ANSWER';
2878
- _context46.next = 3;
2968
+ _context47.next = 3;
2879
2969
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2880
2970
  case 3:
2881
2971
  roapEvent.data.type = 'OK';
2882
- _context46.next = 4;
2972
+ _context47.next = 4;
2883
2973
  return call['handleRoapEstablished']({}, dummyEvent);
2884
2974
  case 4:
2885
2975
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2894,14 +2984,14 @@ describe('Supplementary Services tests', function () {
2894
2984
  });
2895
2985
  case 5:
2896
2986
  case "end":
2897
- return _context46.stop();
2987
+ return _context47.stop();
2898
2988
  }
2899
- }, _callee46);
2989
+ }, _callee47);
2900
2990
  })));
2901
- it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
2991
+ it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
2902
2992
  var responsePayload, warnSpy, roapEvent;
2903
- return _regenerator.default.wrap(function (_context48) {
2904
- while (1) switch (_context48.prev = _context48.next) {
2993
+ return _regenerator.default.wrap(function (_context49) {
2994
+ while (1) switch (_context49.prev = _context49.next) {
2905
2995
  case 0:
2906
2996
  expect.assertions(8);
2907
2997
  responsePayload = {
@@ -2914,26 +3004,26 @@ describe('Supplementary Services tests', function () {
2914
3004
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2915
3005
  call['held'] = false;
2916
3006
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2917
- var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(correlationId) {
2918
- return _regenerator.default.wrap(function (_context47) {
2919
- while (1) switch (_context47.prev = _context47.next) {
3007
+ var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(correlationId) {
3008
+ return _regenerator.default.wrap(function (_context48) {
3009
+ while (1) switch (_context48.prev = _context48.next) {
2920
3010
  case 0:
2921
3011
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2922
3012
  case 1:
2923
3013
  case "end":
2924
- return _context47.stop();
3014
+ return _context48.stop();
2925
3015
  }
2926
- }, _callee47);
3016
+ }, _callee48);
2927
3017
  }));
2928
3018
  return function (_x2) {
2929
- return _ref56.apply(this, arguments);
3019
+ return _ref58.apply(this, arguments);
2930
3020
  };
2931
3021
  }());
2932
3022
  call.doHoldResume();
2933
- _context48.next = 1;
3023
+ _context49.next = 1;
2934
3024
  return _promise.default.resolve();
2935
3025
  case 1:
2936
- _context48.next = 2;
3026
+ _context49.next = 2;
2937
3027
  return _promise.default.resolve();
2938
3028
  case 2:
2939
3029
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2949,11 +3039,11 @@ describe('Supplementary Services tests', function () {
2949
3039
  call['handleIncomingRoapOffer']({}, dummyEvent);
2950
3040
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2951
3041
  roapEvent.data.type = 'ANSWER';
2952
- _context48.next = 3;
3042
+ _context49.next = 3;
2953
3043
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2954
3044
  case 3:
2955
3045
  roapEvent.data.type = 'OK';
2956
- _context48.next = 4;
3046
+ _context49.next = 4;
2957
3047
  return call['handleRoapEstablished']({}, dummyEvent);
2958
3048
  case 4:
2959
3049
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2968,14 +3058,14 @@ describe('Supplementary Services tests', function () {
2968
3058
  });
2969
3059
  case 5:
2970
3060
  case "end":
2971
- return _context48.stop();
3061
+ return _context49.stop();
2972
3062
  }
2973
- }, _callee48);
3063
+ }, _callee49);
2974
3064
  })));
2975
- it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
3065
+ it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
2976
3066
  var responsePayload;
2977
- return _regenerator.default.wrap(function (_context50) {
2978
- while (1) switch (_context50.prev = _context50.next) {
3067
+ return _regenerator.default.wrap(function (_context51) {
3068
+ while (1) switch (_context51.prev = _context51.next) {
2979
3069
  case 0:
2980
3070
  expect.assertions(4);
2981
3071
  responsePayload = {
@@ -2985,26 +3075,26 @@ describe('Supplementary Services tests', function () {
2985
3075
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2986
3076
  call['held'] = false;
2987
3077
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2988
- var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
2989
- return _regenerator.default.wrap(function (_context49) {
2990
- while (1) switch (_context49.prev = _context49.next) {
3078
+ var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(errObj) {
3079
+ return _regenerator.default.wrap(function (_context50) {
3080
+ while (1) switch (_context50.prev = _context50.next) {
2991
3081
  case 0:
2992
3082
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2993
3083
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2994
3084
  case 1:
2995
3085
  case "end":
2996
- return _context49.stop();
3086
+ return _context50.stop();
2997
3087
  }
2998
- }, _callee49);
3088
+ }, _callee50);
2999
3089
  }));
3000
3090
  return function (_x3) {
3001
- return _ref58.apply(this, arguments);
3091
+ return _ref60.apply(this, arguments);
3002
3092
  };
3003
3093
  }());
3004
- _context50.next = 1;
3094
+ _context51.next = 1;
3005
3095
  return call.doHoldResume();
3006
3096
  case 1:
3007
- _context50.next = 2;
3097
+ _context51.next = 2;
3008
3098
  return (0, _testUtil.flushPromises)(2);
3009
3099
  case 2:
3010
3100
  expect(call.isHeld()).toStrictEqual(false);
@@ -3014,14 +3104,14 @@ describe('Supplementary Services tests', function () {
3014
3104
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3015
3105
  case 3:
3016
3106
  case "end":
3017
- return _context50.stop();
3107
+ return _context51.stop();
3018
3108
  }
3019
- }, _callee50);
3109
+ }, _callee51);
3020
3110
  })));
3021
- it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
3111
+ it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
3022
3112
  var responsePayload, rejectPayload, roapEvent;
3023
- return _regenerator.default.wrap(function (_context52) {
3024
- while (1) switch (_context52.prev = _context52.next) {
3113
+ return _regenerator.default.wrap(function (_context53) {
3114
+ while (1) switch (_context53.prev = _context53.next) {
3025
3115
  case 0:
3026
3116
  expect.assertions(5);
3027
3117
  responsePayload = {
@@ -3035,24 +3125,24 @@ describe('Supplementary Services tests', function () {
3035
3125
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
3036
3126
  call['held'] = false;
3037
3127
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
3038
- var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
3039
- return _regenerator.default.wrap(function (_context51) {
3040
- while (1) switch (_context51.prev = _context51.next) {
3128
+ var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
3129
+ return _regenerator.default.wrap(function (_context52) {
3130
+ while (1) switch (_context52.prev = _context52.next) {
3041
3131
  case 0:
3042
3132
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3043
3133
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3044
3134
  case 1:
3045
3135
  case "end":
3046
- return _context51.stop();
3136
+ return _context52.stop();
3047
3137
  }
3048
- }, _callee51);
3138
+ }, _callee52);
3049
3139
  }));
3050
3140
  return function (_x4) {
3051
- return _ref60.apply(this, arguments);
3141
+ return _ref62.apply(this, arguments);
3052
3142
  };
3053
3143
  }());
3054
3144
  call.doHoldResume();
3055
- _context52.next = 1;
3145
+ _context53.next = 1;
3056
3146
  return (0, _testUtil.flushPromises)(2);
3057
3147
  case 1:
3058
3148
  /* the Call State should transition to S_CALL_ESTABLISHED
@@ -3062,7 +3152,7 @@ describe('Supplementary Services tests', function () {
3062
3152
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3063
3153
  /* We are intentionally failing the ROAP ANSWER */
3064
3154
  roapEvent.data.type = 'ANSWER';
3065
- _context52.next = 2;
3155
+ _context53.next = 2;
3066
3156
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3067
3157
  case 2:
3068
3158
  expect(call.isHeld()).toStrictEqual(false);
@@ -3070,14 +3160,14 @@ describe('Supplementary Services tests', function () {
3070
3160
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3071
3161
  case 3:
3072
3162
  case "end":
3073
- return _context52.stop();
3163
+ return _context53.stop();
3074
3164
  }
3075
- }, _callee52);
3165
+ }, _callee53);
3076
3166
  })));
3077
- it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
3167
+ it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
3078
3168
  var responsePayload, warnSpy, roapEvent;
3079
- return _regenerator.default.wrap(function (_context53) {
3080
- while (1) switch (_context53.prev = _context53.next) {
3169
+ return _regenerator.default.wrap(function (_context54) {
3170
+ while (1) switch (_context54.prev = _context54.next) {
3081
3171
  case 0:
3082
3172
  responsePayload = {
3083
3173
  statusCode: 200,
@@ -3088,10 +3178,10 @@ describe('Supplementary Services tests', function () {
3088
3178
  jest.spyOn(global, 'clearTimeout');
3089
3179
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3090
3180
  call['held'] = false;
3091
- _context53.next = 1;
3181
+ _context54.next = 1;
3092
3182
  return call.doHoldResume();
3093
3183
  case 1:
3094
- _context53.next = 2;
3184
+ _context54.next = 2;
3095
3185
  return (0, _testUtil.flushPromises)(2);
3096
3186
  case 2:
3097
3187
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -3106,19 +3196,19 @@ describe('Supplementary Services tests', function () {
3106
3196
  call['handleIncomingRoapOffer']({}, dummyEvent);
3107
3197
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3108
3198
  roapEvent.data.type = 'ANSWER';
3109
- _context53.next = 3;
3199
+ _context54.next = 3;
3110
3200
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3111
3201
  case 3:
3112
3202
  jest.spyOn(webex, 'request').mockRejectedValue({
3113
3203
  statusCode: 403
3114
3204
  });
3115
3205
  roapEvent.data.type = 'OK';
3116
- _context53.next = 4;
3206
+ _context54.next = 4;
3117
3207
  return call['handleRoapEstablished']({}, dummyEvent);
3118
3208
  case 4:
3119
3209
  /* this is for coverage */
3120
3210
  call['callStateMachine'].state.value = 'S_CALL_HOLD';
3121
- _context53.next = 5;
3211
+ _context54.next = 5;
3122
3212
  return call['handleRoapEstablished']({}, dummyEvent);
3123
3213
  case 5:
3124
3214
  expect(call.isHeld()).toStrictEqual(false);
@@ -3130,14 +3220,14 @@ describe('Supplementary Services tests', function () {
3130
3220
  });
3131
3221
  case 6:
3132
3222
  case "end":
3133
- return _context53.stop();
3223
+ return _context54.stop();
3134
3224
  }
3135
- }, _callee53);
3225
+ }, _callee54);
3136
3226
  })));
3137
- it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
3227
+ it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
3138
3228
  var responsePayload, warnSpy, roapEvent;
3139
- return _regenerator.default.wrap(function (_context54) {
3140
- while (1) switch (_context54.prev = _context54.next) {
3229
+ return _regenerator.default.wrap(function (_context55) {
3230
+ while (1) switch (_context55.prev = _context55.next) {
3141
3231
  case 0:
3142
3232
  responsePayload = {
3143
3233
  statusCode: 200,
@@ -3148,10 +3238,10 @@ describe('Supplementary Services tests', function () {
3148
3238
  jest.spyOn(global, 'clearTimeout');
3149
3239
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3150
3240
  call['held'] = true;
3151
- _context54.next = 1;
3241
+ _context55.next = 1;
3152
3242
  return call.doHoldResume();
3153
3243
  case 1:
3154
- _context54.next = 2;
3244
+ _context55.next = 2;
3155
3245
  return (0, _testUtil.flushPromises)(2);
3156
3246
  case 2:
3157
3247
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -3166,14 +3256,14 @@ describe('Supplementary Services tests', function () {
3166
3256
  call['handleIncomingRoapOffer']({}, dummyEvent);
3167
3257
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3168
3258
  roapEvent.data.type = 'ANSWER';
3169
- _context54.next = 3;
3259
+ _context55.next = 3;
3170
3260
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3171
3261
  case 3:
3172
3262
  jest.spyOn(webex, 'request').mockRejectedValue({
3173
3263
  statusCode: 403
3174
3264
  });
3175
3265
  roapEvent.data.type = 'OK';
3176
- _context54.next = 4;
3266
+ _context55.next = 4;
3177
3267
  return call['handleRoapEstablished']({}, dummyEvent);
3178
3268
  case 4:
3179
3269
  expect(call.isHeld()).toStrictEqual(true);
@@ -3185,14 +3275,14 @@ describe('Supplementary Services tests', function () {
3185
3275
  });
3186
3276
  case 5:
3187
3277
  case "end":
3188
- return _context54.stop();
3278
+ return _context55.stop();
3189
3279
  }
3190
- }, _callee54);
3280
+ }, _callee55);
3191
3281
  })));
3192
- it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
3282
+ it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
3193
3283
  var responsePayload, roapEvent;
3194
- return _regenerator.default.wrap(function (_context56) {
3195
- while (1) switch (_context56.prev = _context56.next) {
3284
+ return _regenerator.default.wrap(function (_context57) {
3285
+ while (1) switch (_context57.prev = _context57.next) {
3196
3286
  case 0:
3197
3287
  expect.assertions(5);
3198
3288
  responsePayload = {
@@ -3202,25 +3292,25 @@ describe('Supplementary Services tests', function () {
3202
3292
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
3203
3293
  call['held'] = false;
3204
3294
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
3205
- var _ref64 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(errObj) {
3206
- return _regenerator.default.wrap(function (_context55) {
3207
- while (1) switch (_context55.prev = _context55.next) {
3295
+ var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(errObj) {
3296
+ return _regenerator.default.wrap(function (_context56) {
3297
+ while (1) switch (_context56.prev = _context56.next) {
3208
3298
  case 0:
3209
3299
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
3210
3300
  expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
3211
3301
  case 1:
3212
3302
  case "end":
3213
- return _context55.stop();
3303
+ return _context56.stop();
3214
3304
  }
3215
- }, _callee55);
3305
+ }, _callee56);
3216
3306
  }));
3217
3307
  return function (_x5) {
3218
- return _ref64.apply(this, arguments);
3308
+ return _ref66.apply(this, arguments);
3219
3309
  };
3220
3310
  }());
3221
3311
  jest.runAllTimers();
3222
3312
  call.doHoldResume();
3223
- _context56.next = 1;
3313
+ _context57.next = 1;
3224
3314
  return (0, _testUtil.flushPromises)(2);
3225
3315
  case 1:
3226
3316
  /* At this point, the Call State should be S_CALL_HOLD
@@ -3233,11 +3323,11 @@ describe('Supplementary Services tests', function () {
3233
3323
  call['handleIncomingRoapOffer']({}, dummyEvent);
3234
3324
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3235
3325
  roapEvent.data.type = 'ANSWER';
3236
- _context56.next = 2;
3326
+ _context57.next = 2;
3237
3327
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3238
3328
  case 2:
3239
3329
  roapEvent.data.type = 'OK';
3240
- _context56.next = 3;
3330
+ _context57.next = 3;
3241
3331
  return call['handleRoapEstablished']({}, dummyEvent);
3242
3332
  case 3:
3243
3333
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -3249,14 +3339,14 @@ describe('Supplementary Services tests', function () {
3249
3339
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3250
3340
  case 4:
3251
3341
  case "end":
3252
- return _context56.stop();
3342
+ return _context57.stop();
3253
3343
  }
3254
- }, _callee56);
3344
+ }, _callee57);
3255
3345
  })));
3256
- it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
3346
+ it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
3257
3347
  var responsePayload, warnSpy, roapEvent;
3258
- return _regenerator.default.wrap(function (_context58) {
3259
- while (1) switch (_context58.prev = _context58.next) {
3348
+ return _regenerator.default.wrap(function (_context59) {
3349
+ while (1) switch (_context59.prev = _context59.next) {
3260
3350
  case 0:
3261
3351
  expect.assertions(7);
3262
3352
  responsePayload = {
@@ -3269,25 +3359,25 @@ describe('Supplementary Services tests', function () {
3269
3359
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3270
3360
  call['held'] = true;
3271
3361
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
3272
- var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(correlationId) {
3273
- return _regenerator.default.wrap(function (_context57) {
3274
- while (1) switch (_context57.prev = _context57.next) {
3362
+ var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(correlationId) {
3363
+ return _regenerator.default.wrap(function (_context58) {
3364
+ while (1) switch (_context58.prev = _context58.next) {
3275
3365
  case 0:
3276
3366
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3277
3367
  case 1:
3278
3368
  case "end":
3279
- return _context57.stop();
3369
+ return _context58.stop();
3280
3370
  }
3281
- }, _callee57);
3371
+ }, _callee58);
3282
3372
  }));
3283
3373
  return function (_x6) {
3284
- return _ref66.apply(this, arguments);
3374
+ return _ref68.apply(this, arguments);
3285
3375
  };
3286
3376
  }());
3287
- _context58.next = 1;
3377
+ _context59.next = 1;
3288
3378
  return call.doHoldResume();
3289
3379
  case 1:
3290
- _context58.next = 2;
3380
+ _context59.next = 2;
3291
3381
  return (0, _testUtil.flushPromises)(2);
3292
3382
  case 2:
3293
3383
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -3303,11 +3393,11 @@ describe('Supplementary Services tests', function () {
3303
3393
  call['handleIncomingRoapOffer']({}, dummyEvent);
3304
3394
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3305
3395
  roapEvent.data.type = 'ANSWER';
3306
- _context58.next = 3;
3396
+ _context59.next = 3;
3307
3397
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3308
3398
  case 3:
3309
3399
  roapEvent.data.type = 'OK';
3310
- _context58.next = 4;
3400
+ _context59.next = 4;
3311
3401
  return call['handleRoapEstablished']({}, dummyEvent);
3312
3402
  case 4:
3313
3403
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -3322,14 +3412,14 @@ describe('Supplementary Services tests', function () {
3322
3412
  });
3323
3413
  case 5:
3324
3414
  case "end":
3325
- return _context58.stop();
3415
+ return _context59.stop();
3326
3416
  }
3327
- }, _callee58);
3417
+ }, _callee59);
3328
3418
  })));
3329
- it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
3419
+ it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
3330
3420
  var responsePayload, warnSpy, roapEvent;
3331
- return _regenerator.default.wrap(function (_context60) {
3332
- while (1) switch (_context60.prev = _context60.next) {
3421
+ return _regenerator.default.wrap(function (_context61) {
3422
+ while (1) switch (_context61.prev = _context61.next) {
3333
3423
  case 0:
3334
3424
  expect.assertions(7);
3335
3425
  responsePayload = {
@@ -3342,26 +3432,26 @@ describe('Supplementary Services tests', function () {
3342
3432
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3343
3433
  call['held'] = true;
3344
3434
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
3345
- var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
3346
- return _regenerator.default.wrap(function (_context59) {
3347
- while (1) switch (_context59.prev = _context59.next) {
3435
+ var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
3436
+ return _regenerator.default.wrap(function (_context60) {
3437
+ while (1) switch (_context60.prev = _context60.next) {
3348
3438
  case 0:
3349
3439
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3350
3440
  case 1:
3351
3441
  case "end":
3352
- return _context59.stop();
3442
+ return _context60.stop();
3353
3443
  }
3354
- }, _callee59);
3444
+ }, _callee60);
3355
3445
  }));
3356
3446
  return function (_x7) {
3357
- return _ref68.apply(this, arguments);
3447
+ return _ref70.apply(this, arguments);
3358
3448
  };
3359
3449
  }());
3360
3450
  call.doHoldResume();
3361
- _context60.next = 1;
3451
+ _context61.next = 1;
3362
3452
  return _promise.default.resolve();
3363
3453
  case 1:
3364
- _context60.next = 2;
3454
+ _context61.next = 2;
3365
3455
  return _promise.default.resolve();
3366
3456
  case 2:
3367
3457
  expect(setTimeout).not.toHaveBeenCalled();
@@ -3377,11 +3467,11 @@ describe('Supplementary Services tests', function () {
3377
3467
  call['handleIncomingRoapOffer']({}, dummyEvent);
3378
3468
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3379
3469
  roapEvent.data.type = 'ANSWER';
3380
- _context60.next = 3;
3470
+ _context61.next = 3;
3381
3471
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3382
3472
  case 3:
3383
3473
  roapEvent.data.type = 'OK';
3384
- _context60.next = 4;
3474
+ _context61.next = 4;
3385
3475
  return call['handleRoapEstablished']({}, dummyEvent);
3386
3476
  case 4:
3387
3477
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -3396,14 +3486,14 @@ describe('Supplementary Services tests', function () {
3396
3486
  });
3397
3487
  case 5:
3398
3488
  case "end":
3399
- return _context60.stop();
3489
+ return _context61.stop();
3400
3490
  }
3401
- }, _callee60);
3491
+ }, _callee61);
3402
3492
  })));
3403
- it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
3493
+ it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
3404
3494
  var responsePayload;
3405
- return _regenerator.default.wrap(function (_context62) {
3406
- while (1) switch (_context62.prev = _context62.next) {
3495
+ return _regenerator.default.wrap(function (_context63) {
3496
+ while (1) switch (_context63.prev = _context63.next) {
3407
3497
  case 0:
3408
3498
  expect.assertions(4);
3409
3499
  responsePayload = {
@@ -3413,26 +3503,26 @@ describe('Supplementary Services tests', function () {
3413
3503
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3414
3504
  call['held'] = true;
3415
3505
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3416
- var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(errObj) {
3417
- return _regenerator.default.wrap(function (_context61) {
3418
- while (1) switch (_context61.prev = _context61.next) {
3506
+ var _ref72 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
3507
+ return _regenerator.default.wrap(function (_context62) {
3508
+ while (1) switch (_context62.prev = _context62.next) {
3419
3509
  case 0:
3420
3510
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3421
3511
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3422
3512
  case 1:
3423
3513
  case "end":
3424
- return _context61.stop();
3514
+ return _context62.stop();
3425
3515
  }
3426
- }, _callee61);
3516
+ }, _callee62);
3427
3517
  }));
3428
3518
  return function (_x8) {
3429
- return _ref70.apply(this, arguments);
3519
+ return _ref72.apply(this, arguments);
3430
3520
  };
3431
3521
  }());
3432
- _context62.next = 1;
3522
+ _context63.next = 1;
3433
3523
  return call.doHoldResume();
3434
3524
  case 1:
3435
- _context62.next = 2;
3525
+ _context63.next = 2;
3436
3526
  return (0, _testUtil.flushPromises)(2);
3437
3527
  case 2:
3438
3528
  expect(call.isHeld()).toStrictEqual(true);
@@ -3443,14 +3533,14 @@ describe('Supplementary Services tests', function () {
3443
3533
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3444
3534
  case 3:
3445
3535
  case "end":
3446
- return _context62.stop();
3536
+ return _context63.stop();
3447
3537
  }
3448
- }, _callee62);
3538
+ }, _callee63);
3449
3539
  })));
3450
- it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
3540
+ it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
3451
3541
  var responsePayload, rejectPayload, roapEvent;
3452
- return _regenerator.default.wrap(function (_context64) {
3453
- while (1) switch (_context64.prev = _context64.next) {
3542
+ return _regenerator.default.wrap(function (_context65) {
3543
+ while (1) switch (_context65.prev = _context65.next) {
3454
3544
  case 0:
3455
3545
  expect.assertions(5);
3456
3546
  responsePayload = {
@@ -3464,24 +3554,24 @@ describe('Supplementary Services tests', function () {
3464
3554
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
3465
3555
  call['held'] = true;
3466
3556
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3467
- var _ref72 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(errObj) {
3468
- return _regenerator.default.wrap(function (_context63) {
3469
- while (1) switch (_context63.prev = _context63.next) {
3557
+ var _ref74 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(errObj) {
3558
+ return _regenerator.default.wrap(function (_context64) {
3559
+ while (1) switch (_context64.prev = _context64.next) {
3470
3560
  case 0:
3471
3561
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3472
3562
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3473
3563
  case 1:
3474
3564
  case "end":
3475
- return _context63.stop();
3565
+ return _context64.stop();
3476
3566
  }
3477
- }, _callee63);
3567
+ }, _callee64);
3478
3568
  }));
3479
3569
  return function (_x9) {
3480
- return _ref72.apply(this, arguments);
3570
+ return _ref74.apply(this, arguments);
3481
3571
  };
3482
3572
  }());
3483
3573
  call.doHoldResume();
3484
- _context64.next = 1;
3574
+ _context65.next = 1;
3485
3575
  return (0, _testUtil.flushPromises)(2);
3486
3576
  case 1:
3487
3577
  /* At this point , the Call State should transition to S_CALL_ESTABLISHED
@@ -3492,7 +3582,7 @@ describe('Supplementary Services tests', function () {
3492
3582
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3493
3583
  /* We are intentionally failing the ROAP ANSWER */
3494
3584
  roapEvent.data.type = 'ANSWER';
3495
- _context64.next = 2;
3585
+ _context65.next = 2;
3496
3586
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3497
3587
  case 2:
3498
3588
  expect(call.isHeld()).toStrictEqual(true);
@@ -3500,14 +3590,14 @@ describe('Supplementary Services tests', function () {
3500
3590
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3501
3591
  case 3:
3502
3592
  case "end":
3503
- return _context64.stop();
3593
+ return _context65.stop();
3504
3594
  }
3505
- }, _callee64);
3595
+ }, _callee65);
3506
3596
  })));
3507
- it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
3597
+ it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
3508
3598
  var responsePayload, roapEvent;
3509
- return _regenerator.default.wrap(function (_context66) {
3510
- while (1) switch (_context66.prev = _context66.next) {
3599
+ return _regenerator.default.wrap(function (_context67) {
3600
+ while (1) switch (_context67.prev = _context67.next) {
3511
3601
  case 0:
3512
3602
  expect.assertions(5);
3513
3603
  responsePayload = {
@@ -3517,24 +3607,24 @@ describe('Supplementary Services tests', function () {
3517
3607
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
3518
3608
  call['held'] = true;
3519
3609
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3520
- var _ref74 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(errObj) {
3521
- return _regenerator.default.wrap(function (_context65) {
3522
- while (1) switch (_context65.prev = _context65.next) {
3610
+ var _ref76 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(errObj) {
3611
+ return _regenerator.default.wrap(function (_context66) {
3612
+ while (1) switch (_context66.prev = _context66.next) {
3523
3613
  case 0:
3524
3614
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
3525
3615
  expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
3526
3616
  case 1:
3527
3617
  case "end":
3528
- return _context65.stop();
3618
+ return _context66.stop();
3529
3619
  }
3530
- }, _callee65);
3620
+ }, _callee66);
3531
3621
  }));
3532
3622
  return function (_x0) {
3533
- return _ref74.apply(this, arguments);
3623
+ return _ref76.apply(this, arguments);
3534
3624
  };
3535
3625
  }());
3536
3626
  call.doHoldResume();
3537
- _context66.next = 1;
3627
+ _context67.next = 1;
3538
3628
  return (0, _testUtil.flushPromises)(2);
3539
3629
  case 1:
3540
3630
  /* At this point ,the Call State should be S_CALL_RESUME
@@ -3547,11 +3637,11 @@ describe('Supplementary Services tests', function () {
3547
3637
  call['handleIncomingRoapOffer']({}, dummyEvent);
3548
3638
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3549
3639
  roapEvent.data.type = 'ANSWER';
3550
- _context66.next = 2;
3640
+ _context67.next = 2;
3551
3641
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3552
3642
  case 2:
3553
3643
  roapEvent.data.type = 'OK';
3554
- _context66.next = 3;
3644
+ _context67.next = 3;
3555
3645
  return call['handleRoapEstablished']({}, dummyEvent);
3556
3646
  case 3:
3557
3647
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -3561,9 +3651,9 @@ describe('Supplementary Services tests', function () {
3561
3651
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3562
3652
  case 4:
3563
3653
  case "end":
3564
- return _context66.stop();
3654
+ return _context67.stop();
3565
3655
  }
3566
- }, _callee66);
3656
+ }, _callee67);
3567
3657
  })));
3568
3658
  });
3569
3659
  describe('Call transfer tests', function () {
@@ -3596,10 +3686,10 @@ describe('Supplementary Services tests', function () {
3596
3686
  secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
3597
3687
  secondCall['held'] = false;
3598
3688
  });
3599
- it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
3689
+ it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
3600
3690
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3601
- return _regenerator.default.wrap(function (_context69) {
3602
- while (1) switch (_context69.prev = _context69.next) {
3691
+ return _regenerator.default.wrap(function (_context70) {
3692
+ while (1) switch (_context70.prev = _context70.next) {
3603
3693
  case 0:
3604
3694
  expect.assertions(12); // Updated to match actual assertion count
3605
3695
  responsePayload = {
@@ -3611,41 +3701,41 @@ describe('Supplementary Services tests', function () {
3611
3701
  infoSpy = jest.spyOn(_Logger.default, 'info');
3612
3702
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3613
3703
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3614
- var _ref76 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
3615
- return _regenerator.default.wrap(function (_context67) {
3616
- while (1) switch (_context67.prev = _context67.next) {
3704
+ var _ref78 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
3705
+ return _regenerator.default.wrap(function (_context68) {
3706
+ while (1) switch (_context68.prev = _context68.next) {
3617
3707
  case 0:
3618
3708
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3619
3709
  case 1:
3620
3710
  case "end":
3621
- return _context67.stop();
3711
+ return _context68.stop();
3622
3712
  }
3623
- }, _callee67);
3713
+ }, _callee68);
3624
3714
  }));
3625
3715
  return function (_x1) {
3626
- return _ref76.apply(this, arguments);
3716
+ return _ref78.apply(this, arguments);
3627
3717
  };
3628
3718
  }());
3629
3719
  secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3630
- var _ref77 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
3631
- return _regenerator.default.wrap(function (_context68) {
3632
- while (1) switch (_context68.prev = _context68.next) {
3720
+ var _ref79 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
3721
+ return _regenerator.default.wrap(function (_context69) {
3722
+ while (1) switch (_context69.prev = _context69.next) {
3633
3723
  case 0:
3634
3724
  expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
3635
3725
  case 1:
3636
3726
  case "end":
3637
- return _context68.stop();
3727
+ return _context69.stop();
3638
3728
  }
3639
- }, _callee68);
3729
+ }, _callee69);
3640
3730
  }));
3641
3731
  return function (_x10) {
3642
- return _ref77.apply(this, arguments);
3732
+ return _ref79.apply(this, arguments);
3643
3733
  };
3644
3734
  }());
3645
- _context69.next = 1;
3735
+ _context70.next = 1;
3646
3736
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3647
3737
  case 1:
3648
- _context69.next = 2;
3738
+ _context70.next = 2;
3649
3739
  return (0, _testUtil.flushPromises)(2);
3650
3740
  case 2:
3651
3741
  expect(requestSpy).toBeCalled();
@@ -3668,14 +3758,14 @@ describe('Supplementary Services tests', function () {
3668
3758
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3669
3759
  case 3:
3670
3760
  case "end":
3671
- return _context69.stop();
3761
+ return _context70.stop();
3672
3762
  }
3673
- }, _callee69);
3763
+ }, _callee70);
3674
3764
  })));
3675
- it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
3765
+ it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3676
3766
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3677
- return _regenerator.default.wrap(function (_context71) {
3678
- while (1) switch (_context71.prev = _context71.next) {
3767
+ return _regenerator.default.wrap(function (_context72) {
3768
+ while (1) switch (_context72.prev = _context72.next) {
3679
3769
  case 0:
3680
3770
  expect.assertions(10); // Updated to match actual assertion count
3681
3771
  responsePayload = {
@@ -3687,25 +3777,25 @@ describe('Supplementary Services tests', function () {
3687
3777
  infoSpy = jest.spyOn(_Logger.default, 'info');
3688
3778
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3689
3779
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3690
- var _ref79 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70(correlationId) {
3691
- return _regenerator.default.wrap(function (_context70) {
3692
- while (1) switch (_context70.prev = _context70.next) {
3780
+ var _ref81 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71(correlationId) {
3781
+ return _regenerator.default.wrap(function (_context71) {
3782
+ while (1) switch (_context71.prev = _context71.next) {
3693
3783
  case 0:
3694
3784
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3695
3785
  case 1:
3696
3786
  case "end":
3697
- return _context70.stop();
3787
+ return _context71.stop();
3698
3788
  }
3699
- }, _callee70);
3789
+ }, _callee71);
3700
3790
  }));
3701
3791
  return function (_x11) {
3702
- return _ref79.apply(this, arguments);
3792
+ return _ref81.apply(this, arguments);
3703
3793
  };
3704
3794
  }());
3705
- _context71.next = 1;
3795
+ _context72.next = 1;
3706
3796
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3707
3797
  case 1:
3708
- _context71.next = 2;
3798
+ _context72.next = 2;
3709
3799
  return (0, _testUtil.flushPromises)(2);
3710
3800
  case 2:
3711
3801
  expect(requestSpy).toBeCalled();
@@ -3724,14 +3814,14 @@ describe('Supplementary Services tests', function () {
3724
3814
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3725
3815
  case 3:
3726
3816
  case "end":
3727
- return _context71.stop();
3817
+ return _context72.stop();
3728
3818
  }
3729
- }, _callee71);
3819
+ }, _callee72);
3730
3820
  })));
3731
- it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3821
+ it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
3732
3822
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3733
- return _regenerator.default.wrap(function (_context72) {
3734
- while (1) switch (_context72.prev = _context72.next) {
3823
+ return _regenerator.default.wrap(function (_context73) {
3824
+ while (1) switch (_context73.prev = _context73.next) {
3735
3825
  case 0:
3736
3826
  responsePayload = {
3737
3827
  statusCode: 403,
@@ -3742,10 +3832,10 @@ describe('Supplementary Services tests', function () {
3742
3832
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3743
3833
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3744
3834
  call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
3745
- _context72.next = 1;
3835
+ _context73.next = 1;
3746
3836
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3747
3837
  case 1:
3748
- _context72.next = 2;
3838
+ _context73.next = 2;
3749
3839
  return (0, _testUtil.flushPromises)(1);
3750
3840
  case 2:
3751
3841
  expect(requestSpy).toBeCalled();
@@ -3766,14 +3856,14 @@ describe('Supplementary Services tests', function () {
3766
3856
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3767
3857
  case 3:
3768
3858
  case "end":
3769
- return _context72.stop();
3859
+ return _context73.stop();
3770
3860
  }
3771
- }, _callee72);
3861
+ }, _callee73);
3772
3862
  })));
3773
- it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
3863
+ it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
3774
3864
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3775
- return _regenerator.default.wrap(function (_context73) {
3776
- while (1) switch (_context73.prev = _context73.next) {
3865
+ return _regenerator.default.wrap(function (_context74) {
3866
+ while (1) switch (_context74.prev = _context74.next) {
3777
3867
  case 0:
3778
3868
  responsePayload = {
3779
3869
  statusCode: 403,
@@ -3783,10 +3873,10 @@ describe('Supplementary Services tests', function () {
3783
3873
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3784
3874
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3785
3875
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3786
- _context73.next = 1;
3876
+ _context74.next = 1;
3787
3877
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3788
3878
  case 1:
3789
- _context73.next = 2;
3879
+ _context74.next = 2;
3790
3880
  return (0, _testUtil.flushPromises)(2);
3791
3881
  case 2:
3792
3882
  expect(requestSpy).toBeCalled();
@@ -3807,18 +3897,18 @@ describe('Supplementary Services tests', function () {
3807
3897
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3808
3898
  case 3:
3809
3899
  case "end":
3810
- return _context73.stop();
3900
+ return _context74.stop();
3811
3901
  }
3812
- }, _callee73);
3902
+ }, _callee74);
3813
3903
  })));
3814
- it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
3904
+ it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
3815
3905
  var requestSpy, warnSpy;
3816
- return _regenerator.default.wrap(function (_context74) {
3817
- while (1) switch (_context74.prev = _context74.next) {
3906
+ return _regenerator.default.wrap(function (_context75) {
3907
+ while (1) switch (_context75.prev = _context75.next) {
3818
3908
  case 0:
3819
3909
  requestSpy = jest.spyOn(webex, 'request');
3820
3910
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3821
- _context74.next = 1;
3911
+ _context75.next = 1;
3822
3912
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
3823
3913
  case 1:
3824
3914
  /* We should be in CALL_ESTABLISHED state */
@@ -3830,18 +3920,18 @@ describe('Supplementary Services tests', function () {
3830
3920
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3831
3921
  case 2:
3832
3922
  case "end":
3833
- return _context74.stop();
3923
+ return _context75.stop();
3834
3924
  }
3835
- }, _callee74);
3925
+ }, _callee75);
3836
3926
  })));
3837
- it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
3927
+ it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee76() {
3838
3928
  var requestSpy, warnSpy;
3839
- return _regenerator.default.wrap(function (_context75) {
3840
- while (1) switch (_context75.prev = _context75.next) {
3929
+ return _regenerator.default.wrap(function (_context76) {
3930
+ while (1) switch (_context76.prev = _context76.next) {
3841
3931
  case 0:
3842
3932
  requestSpy = jest.spyOn(webex, 'request');
3843
3933
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3844
- _context75.next = 1;
3934
+ _context76.next = 1;
3845
3935
  return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
3846
3936
  case 1:
3847
3937
  /* We should be in CALL_ESTABLISHED state */
@@ -3853,9 +3943,9 @@ describe('Supplementary Services tests', function () {
3853
3943
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3854
3944
  case 2:
3855
3945
  case "end":
3856
- return _context75.stop();
3946
+ return _context76.stop();
3857
3947
  }
3858
- }, _callee75);
3948
+ }, _callee76);
3859
3949
  })));
3860
3950
  });
3861
3951
  });