@webex/calling 3.10.0-next.12 → 3.10.0-next.13

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.
@@ -838,16 +838,17 @@ describe('State Machine handler tests', function () {
838
838
  return (0, _testUtil.flushPromises)(3);
839
839
  case 11:
840
840
  expect(setInterval).toHaveBeenCalledTimes(1);
841
+ expect(setInterval).toHaveBeenCalledWith(expect.any(Function), _constants.DEFAULT_SESSION_TIMER);
841
842
  expect(funcSpy).toBeCalledTimes(1);
842
843
  expect(logSpy).toBeCalledWith('Session refresh successful', {
843
844
  file: 'call',
844
- method: 'handleCallEstablished'
845
+ method: 'scheduleCallKeepaliveInterval'
845
846
  });
846
847
  expect(logSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(call.getCorrelationId()), {
847
848
  file: 'call',
848
849
  method: 'handleCallEstablished'
849
850
  });
850
- case 15:
851
+ case 16:
851
852
  case "end":
852
853
  return _context13.stop();
853
854
  }
@@ -902,33 +903,25 @@ describe('State Machine handler tests', function () {
902
903
  expect(errObj.message).toStrictEqual('An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.');
903
904
  });
904
905
  funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
905
- if (call['sessionTimer'] === undefined) {
906
- /* In cases where this test is run independently/alone, there is no sessionTimer initiated
907
- Thus we will check and initialize the timer when not present by calling handleCallEstablish() */
908
- call['handleCallEstablished']({});
909
- }
910
906
  call['handleCallEstablished']({});
911
907
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
912
908
 
913
909
  /* This is to flush all the promises from the Promise queue so that
914
910
  * Jest.fakeTimers can advance time and also clear the promise Queue
915
911
  */
916
- _context15.next = 11;
917
- return _promise.default.resolve();
918
- case 11:
919
- _context15.next = 13;
920
- return _promise.default.resolve();
921
- case 13:
922
- expect(clearInterval).toHaveBeenCalledTimes(2); // check this
912
+ _context15.next = 10;
913
+ return (0, _testUtil.flushPromises)(2);
914
+ case 10:
915
+ expect(clearInterval).toHaveBeenCalledTimes(1);
923
916
  expect(funcSpy).toBeCalledTimes(1);
924
- case 15:
917
+ case 12:
925
918
  case "end":
926
919
  return _context15.stop();
927
920
  }
928
921
  }, _callee15);
929
922
  })));
930
923
  it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
931
- var errorPayload, okPayload, sendEvtSpy, postStatusSpy;
924
+ var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
932
925
  return _regenerator.default.wrap(function _callee16$(_context16) {
933
926
  while (1) switch (_context16.prev = _context16.next) {
934
927
  case 0:
@@ -942,53 +935,35 @@ describe('State Machine handler tests', function () {
942
935
  statusCode: 200,
943
936
  body: {}
944
937
  };
945
- sendEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
938
+ scheduleKeepaliveSpy = jest.spyOn(call, 'scheduleCallKeepaliveInterval');
946
939
  postStatusSpy = jest.spyOn(call, 'postStatus').mockRejectedValueOnce(errorPayload).mockResolvedValueOnce(okPayload);
947
940
  if (call['sessionTimer'] === undefined) {
948
941
  call['handleCallEstablished']({});
949
942
  }
950
943
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
951
944
  _context16.next = 8;
952
- return _promise.default.resolve();
945
+ return (0, _testUtil.flushPromises)(2);
953
946
  case 8:
954
- _context16.next = 10;
955
- return _promise.default.resolve();
956
- case 10:
957
947
  expect(postStatusSpy).toHaveBeenCalledTimes(1);
958
- expect(sendEvtSpy).toHaveBeenCalledWith({
959
- type: 'E_CALL_ESTABLISHED'
960
- });
948
+
949
+ // Now advance by 1 second for the retry-after interval
950
+ jest.advanceTimersByTime(1000);
951
+ _context16.next = 12;
952
+ return (0, _testUtil.flushPromises)(2);
961
953
  case 12:
954
+ expect(postStatusSpy).toHaveBeenCalledTimes(2);
955
+ expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
956
+ case 14:
962
957
  case "end":
963
958
  return _context16.stop();
964
959
  }
965
960
  }, _callee16);
966
961
  })));
967
- it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
968
- var resolvePromise, errorPayload, warnSpy, postStatusSpy;
969
- return _regenerator.default.wrap(function _callee18$(_context18) {
970
- while (1) switch (_context18.prev = _context18.next) {
962
+ it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
963
+ var errorPayload, warnSpy, postStatusSpy;
964
+ return _regenerator.default.wrap(function _callee17$(_context17) {
965
+ while (1) switch (_context17.prev = _context17.next) {
971
966
  case 0:
972
- resolvePromise = /*#__PURE__*/function () {
973
- var _ref18 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
974
- return _regenerator.default.wrap(function _callee17$(_context17) {
975
- while (1) switch (_context17.prev = _context17.next) {
976
- case 0:
977
- _context17.next = 2;
978
- return _promise.default.resolve();
979
- case 2:
980
- _context17.next = 4;
981
- return _promise.default.resolve();
982
- case 4:
983
- case "end":
984
- return _context17.stop();
985
- }
986
- }, _callee17);
987
- }));
988
- return function resolvePromise() {
989
- return _ref18.apply(this, arguments);
990
- };
991
- }();
992
967
  errorPayload = {
993
968
  statusCode: 500,
994
969
  headers: {
@@ -1006,41 +981,44 @@ describe('State Machine handler tests', function () {
1006
981
 
1007
982
  // Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
1008
983
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
1009
- _context18.next = 11;
1010
- return resolvePromise();
1011
- case 11:
1012
- // Now advance by 1 second for each of the 3 more retry attempts (retry-after: 1 second each)
984
+ _context17.next = 10;
985
+ return (0, _testUtil.flushPromises)(2);
986
+ case 10:
987
+ // Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
1013
988
  // Need to do this separately to allow state machine to process and create new intervals
1014
989
  jest.advanceTimersByTime(1000);
1015
- _context18.next = 14;
1016
- return resolvePromise();
1017
- case 14:
990
+ _context17.next = 13;
991
+ return (0, _testUtil.flushPromises)(2);
992
+ case 13:
1018
993
  jest.advanceTimersByTime(1000);
1019
- _context18.next = 17;
1020
- return resolvePromise();
1021
- case 17:
994
+ _context17.next = 16;
995
+ return (0, _testUtil.flushPromises)(2);
996
+ case 16:
1022
997
  jest.advanceTimersByTime(1000);
1023
- _context18.next = 20;
1024
- return resolvePromise();
1025
- case 20:
998
+ _context17.next = 19;
999
+ return (0, _testUtil.flushPromises)(2);
1000
+ case 19:
1001
+ jest.advanceTimersByTime(1000);
1002
+ _context17.next = 22;
1003
+ return (0, _testUtil.flushPromises)(2);
1004
+ case 22:
1026
1005
  // The error handler should detect we're at max retry count and stop
1027
- expect(warnSpy).toHaveBeenCalledWith("Max call keepalive retry attempts reached for call: ".concat(call.getCorrelationId()), {
1006
+ expect(warnSpy).toHaveBeenCalledWith("Max keepalive retry attempts reached. Aborting call keepalive for callId: ".concat(call.getCallId()), {
1028
1007
  file: 'call',
1029
- method: 'handleCallEstablished'
1008
+ method: 'keepaliveRetryCallback'
1030
1009
  });
1031
- expect(postStatusSpy).toHaveBeenCalledTimes(4);
1032
- expect(call['callKeepaliveRetryCount']).toBe(0);
1033
- expect(call['sessionTimer']).toBeUndefined();
1034
- case 24:
1010
+ expect(postStatusSpy).toHaveBeenCalledTimes(5);
1011
+ expect(call['callKeepaliveRetryCount']).toBe(4);
1012
+ case 25:
1035
1013
  case "end":
1036
- return _context18.stop();
1014
+ return _context17.stop();
1037
1015
  }
1038
- }, _callee18);
1016
+ }, _callee17);
1039
1017
  })));
1040
- it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
1018
+ it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
1041
1019
  var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
1042
- return _regenerator.default.wrap(function _callee19$(_context19) {
1043
- while (1) switch (_context19.prev = _context19.next) {
1020
+ return _regenerator.default.wrap(function _callee18$(_context18) {
1021
+ while (1) switch (_context18.prev = _context18.next) {
1044
1022
  case 0:
1045
1023
  statusPayload = {
1046
1024
  statusCode: 200,
@@ -1096,14 +1074,14 @@ describe('State Machine handler tests', function () {
1096
1074
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1097
1075
  case 27:
1098
1076
  case "end":
1099
- return _context19.stop();
1077
+ return _context18.stop();
1100
1078
  }
1101
- }, _callee19);
1079
+ }, _callee18);
1102
1080
  })));
1103
- it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1081
+ it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
1104
1082
  var statusPayload, dummyEvent;
1105
- return _regenerator.default.wrap(function _callee20$(_context20) {
1106
- while (1) switch (_context20.prev = _context20.next) {
1083
+ return _regenerator.default.wrap(function _callee19$(_context19) {
1084
+ while (1) switch (_context19.prev = _context19.next) {
1107
1085
  case 0:
1108
1086
  call['direction'] = _types3.CallDirection.INBOUND;
1109
1087
  statusPayload = {
@@ -1121,7 +1099,7 @@ describe('State Machine handler tests', function () {
1121
1099
  webex.request.mockReturnValue(statusPayload);
1122
1100
  call.sendCallStateMachineEvt(dummyEvent);
1123
1101
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
1124
- _context20.next = 8;
1102
+ _context19.next = 8;
1125
1103
  return call['handleOutgoingCallConnect']({
1126
1104
  type: 'E_SEND_CALL_CONNECT'
1127
1105
  });
@@ -1135,14 +1113,14 @@ describe('State Machine handler tests', function () {
1135
1113
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1136
1114
  case 12:
1137
1115
  case "end":
1138
- return _context20.stop();
1116
+ return _context19.stop();
1139
1117
  }
1140
- }, _callee20);
1118
+ }, _callee19);
1141
1119
  })));
1142
- it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1120
+ it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1143
1121
  var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
1144
- return _regenerator.default.wrap(function _callee21$(_context21) {
1145
- while (1) switch (_context21.prev = _context21.next) {
1122
+ return _regenerator.default.wrap(function _callee20$(_context20) {
1123
+ while (1) switch (_context20.prev = _context20.next) {
1146
1124
  case 0:
1147
1125
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1148
1126
  errorSpy = jest.spyOn(_Logger.default, 'error');
@@ -1169,7 +1147,7 @@ describe('State Machine handler tests', function () {
1169
1147
  webex.request.mockRejectedValueOnce({
1170
1148
  statusCode: 403
1171
1149
  }).mockResolvedValue(statusPayload);
1172
- _context21.next = 13;
1150
+ _context20.next = 13;
1173
1151
  return call['handleOutgoingCallConnect']({
1174
1152
  type: 'E_SEND_CALL_CONNECT'
1175
1153
  });
@@ -1180,14 +1158,14 @@ describe('State Machine handler tests', function () {
1180
1158
  expect(errorSpy).toBeCalledTimes(1);
1181
1159
  case 17:
1182
1160
  case "end":
1183
- return _context21.stop();
1161
+ return _context20.stop();
1184
1162
  }
1185
- }, _callee21);
1163
+ }, _callee20);
1186
1164
  })));
1187
- it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1165
+ it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1188
1166
  var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
1189
- return _regenerator.default.wrap(function _callee22$(_context22) {
1190
- while (1) switch (_context22.prev = _context22.next) {
1167
+ return _regenerator.default.wrap(function _callee21$(_context21) {
1168
+ while (1) switch (_context21.prev = _context21.next) {
1191
1169
  case 0:
1192
1170
  statusPayload = {
1193
1171
  statusCode: 200,
@@ -1263,14 +1241,14 @@ describe('State Machine handler tests', function () {
1263
1241
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1264
1242
  case 42:
1265
1243
  case "end":
1266
- return _context22.stop();
1244
+ return _context21.stop();
1267
1245
  }
1268
- }, _callee22);
1246
+ }, _callee21);
1269
1247
  })));
1270
- 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 _callee23() {
1248
+ it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1271
1249
  var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
1272
- return _regenerator.default.wrap(function _callee23$(_context23) {
1273
- while (1) switch (_context23.prev = _context23.next) {
1250
+ return _regenerator.default.wrap(function _callee22$(_context22) {
1251
+ while (1) switch (_context22.prev = _context22.next) {
1274
1252
  case 0:
1275
1253
  statusPayload = {
1276
1254
  statusCode: 200,
@@ -1338,14 +1316,14 @@ describe('State Machine handler tests', function () {
1338
1316
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1339
1317
  case 25:
1340
1318
  case "end":
1341
- return _context23.stop();
1319
+ return _context22.stop();
1342
1320
  }
1343
- }, _callee23);
1321
+ }, _callee22);
1344
1322
  })));
1345
- it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1323
+ it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1346
1324
  var statusPayload, dummyEvent;
1347
- return _regenerator.default.wrap(function _callee24$(_context24) {
1348
- while (1) switch (_context24.prev = _context24.next) {
1325
+ return _regenerator.default.wrap(function _callee23$(_context23) {
1326
+ while (1) switch (_context23.prev = _context23.next) {
1349
1327
  case 0:
1350
1328
  statusPayload = {
1351
1329
  statusCode: 200,
@@ -1384,14 +1362,14 @@ describe('State Machine handler tests', function () {
1384
1362
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1385
1363
  case 17:
1386
1364
  case "end":
1387
- return _context24.stop();
1365
+ return _context23.stop();
1388
1366
  }
1389
- }, _callee24);
1367
+ }, _callee23);
1390
1368
  })));
1391
- it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1369
+ it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1392
1370
  var statusPayload, dummyEvent, errorSpy;
1393
- return _regenerator.default.wrap(function _callee25$(_context25) {
1394
- while (1) switch (_context25.prev = _context25.next) {
1371
+ return _regenerator.default.wrap(function _callee24$(_context24) {
1372
+ while (1) switch (_context24.prev = _context24.next) {
1395
1373
  case 0:
1396
1374
  statusPayload = {
1397
1375
  statusCode: 403,
@@ -1408,7 +1386,7 @@ describe('State Machine handler tests', function () {
1408
1386
  webex.request.mockRejectedValueOnce(statusPayload);
1409
1387
  errorSpy = jest.spyOn(_Logger.default, 'error');
1410
1388
  call.sendCallStateMachineEvt(dummyEvent);
1411
- _context25.next = 7;
1389
+ _context24.next = 7;
1412
1390
  return (0, _testUtil.flushPromises)(3);
1413
1391
  case 7:
1414
1392
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
@@ -1419,14 +1397,14 @@ describe('State Machine handler tests', function () {
1419
1397
  });
1420
1398
  case 10:
1421
1399
  case "end":
1422
- return _context25.stop();
1400
+ return _context24.stop();
1423
1401
  }
1424
- }, _callee25);
1402
+ }, _callee24);
1425
1403
  })));
1426
- it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1404
+ it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1427
1405
  var statusPayload, dummyEvent, warnSpy;
1428
- return _regenerator.default.wrap(function _callee26$(_context26) {
1429
- while (1) switch (_context26.prev = _context26.next) {
1406
+ return _regenerator.default.wrap(function _callee25$(_context25) {
1407
+ while (1) switch (_context25.prev = _context25.next) {
1430
1408
  case 0:
1431
1409
  statusPayload = {
1432
1410
  statusCode: 403,
@@ -1445,10 +1423,10 @@ describe('State Machine handler tests', function () {
1445
1423
  webex.request.mockRejectedValue(statusPayload);
1446
1424
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1447
1425
  jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
1448
- _context26.next = 10;
1426
+ _context25.next = 10;
1449
1427
  return call['handleRoapEstablished']({}, dummyEvent);
1450
1428
  case 10:
1451
- _context26.next = 12;
1429
+ _context25.next = 12;
1452
1430
  return (0, _testUtil.flushPromises)(2);
1453
1431
  case 12:
1454
1432
  expect(call.isConnected()).toBe(false);
@@ -1464,14 +1442,14 @@ describe('State Machine handler tests', function () {
1464
1442
  });
1465
1443
  case 17:
1466
1444
  case "end":
1467
- return _context26.stop();
1445
+ return _context25.stop();
1468
1446
  }
1469
- }, _callee26);
1447
+ }, _callee25);
1470
1448
  })));
1471
- it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1449
+ it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1472
1450
  var statusPayload, dummyEvent;
1473
- return _regenerator.default.wrap(function _callee27$(_context27) {
1474
- while (1) switch (_context27.prev = _context27.next) {
1451
+ return _regenerator.default.wrap(function _callee26$(_context26) {
1452
+ while (1) switch (_context26.prev = _context26.next) {
1475
1453
  case 0:
1476
1454
  statusPayload = {
1477
1455
  statusCode: 403,
@@ -1494,14 +1472,14 @@ describe('State Machine handler tests', function () {
1494
1472
  expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
1495
1473
  case 8:
1496
1474
  case "end":
1497
- return _context27.stop();
1475
+ return _context26.stop();
1498
1476
  }
1499
- }, _callee27);
1477
+ }, _callee26);
1500
1478
  })));
1501
- it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1479
+ it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1502
1480
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1503
- return _regenerator.default.wrap(function _callee28$(_context28) {
1504
- while (1) switch (_context28.prev = _context28.next) {
1481
+ return _regenerator.default.wrap(function _callee27$(_context27) {
1482
+ while (1) switch (_context27.prev = _context27.next) {
1505
1483
  case 0:
1506
1484
  statusPayload = {
1507
1485
  statusCode: 503,
@@ -1523,7 +1501,7 @@ describe('State Machine handler tests', function () {
1523
1501
  }
1524
1502
  };
1525
1503
  call['connected'] = true;
1526
- _context28.next = 8;
1504
+ _context27.next = 8;
1527
1505
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1528
1506
  case 8:
1529
1507
  jest.advanceTimersByTime(1005);
@@ -1535,14 +1513,14 @@ describe('State Machine handler tests', function () {
1535
1513
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1536
1514
  case 13:
1537
1515
  case "end":
1538
- return _context28.stop();
1516
+ return _context27.stop();
1539
1517
  }
1540
- }, _callee28);
1518
+ }, _callee27);
1541
1519
  })));
1542
- it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1520
+ it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1543
1521
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1544
- return _regenerator.default.wrap(function _callee29$(_context29) {
1545
- while (1) switch (_context29.prev = _context29.next) {
1522
+ return _regenerator.default.wrap(function _callee28$(_context28) {
1523
+ while (1) switch (_context28.prev = _context28.next) {
1546
1524
  case 0:
1547
1525
  statusPayload = {
1548
1526
  statusCode: 503,
@@ -1564,7 +1542,7 @@ describe('State Machine handler tests', function () {
1564
1542
  }
1565
1543
  };
1566
1544
  call['connected'] = false;
1567
- _context29.next = 8;
1545
+ _context28.next = 8;
1568
1546
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1569
1547
  case 8:
1570
1548
  jest.advanceTimersByTime(1005);
@@ -1575,14 +1553,14 @@ describe('State Machine handler tests', function () {
1575
1553
  expect(stateMachineSpy).not.toBeCalled();
1576
1554
  case 12:
1577
1555
  case "end":
1578
- return _context29.stop();
1556
+ return _context28.stop();
1579
1557
  }
1580
- }, _callee29);
1558
+ }, _callee28);
1581
1559
  })));
1582
- it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1560
+ it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1583
1561
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1584
- return _regenerator.default.wrap(function _callee30$(_context30) {
1585
- while (1) switch (_context30.prev = _context30.next) {
1562
+ return _regenerator.default.wrap(function _callee29$(_context29) {
1563
+ while (1) switch (_context29.prev = _context29.next) {
1586
1564
  case 0:
1587
1565
  statusPayload = {
1588
1566
  statusCode: 503,
@@ -1604,7 +1582,7 @@ describe('State Machine handler tests', function () {
1604
1582
  };
1605
1583
  call['connected'] = true;
1606
1584
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
1607
- _context30.next = 9;
1585
+ _context29.next = 9;
1608
1586
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1609
1587
  case 9:
1610
1588
  jest.advanceTimersByTime(1005);
@@ -1616,14 +1594,14 @@ describe('State Machine handler tests', function () {
1616
1594
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1617
1595
  case 14:
1618
1596
  case "end":
1619
- return _context30.stop();
1597
+ return _context29.stop();
1620
1598
  }
1621
- }, _callee30);
1599
+ }, _callee29);
1622
1600
  })));
1623
- it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1601
+ it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1624
1602
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1625
- return _regenerator.default.wrap(function _callee31$(_context31) {
1626
- while (1) switch (_context31.prev = _context31.next) {
1603
+ return _regenerator.default.wrap(function _callee30$(_context30) {
1604
+ while (1) switch (_context30.prev = _context30.next) {
1627
1605
  case 0:
1628
1606
  statusPayload = {
1629
1607
  statusCode: 503,
@@ -1644,7 +1622,7 @@ describe('State Machine handler tests', function () {
1644
1622
  }
1645
1623
  };
1646
1624
  call['connected'] = false;
1647
- _context31.next = 8;
1625
+ _context30.next = 8;
1648
1626
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1649
1627
  case 8:
1650
1628
  jest.advanceTimersByTime(1005);
@@ -1656,14 +1634,14 @@ describe('State Machine handler tests', function () {
1656
1634
  expect(stateMachineSpy).not.toBeCalled();
1657
1635
  case 13:
1658
1636
  case "end":
1659
- return _context31.stop();
1637
+ return _context30.stop();
1660
1638
  }
1661
- }, _callee31);
1639
+ }, _callee30);
1662
1640
  })));
1663
- it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1641
+ it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1664
1642
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1665
- return _regenerator.default.wrap(function _callee32$(_context32) {
1666
- while (1) switch (_context32.prev = _context32.next) {
1643
+ return _regenerator.default.wrap(function _callee31$(_context31) {
1644
+ while (1) switch (_context31.prev = _context31.next) {
1667
1645
  case 0:
1668
1646
  statusPayload = {
1669
1647
  statusCode: 200,
@@ -1688,14 +1666,14 @@ describe('State Machine handler tests', function () {
1688
1666
  expect(stateMachineSpy).not.toHaveBeenCalled();
1689
1667
  case 11:
1690
1668
  case "end":
1691
- return _context32.stop();
1669
+ return _context31.stop();
1692
1670
  }
1693
- }, _callee32);
1671
+ }, _callee31);
1694
1672
  })));
1695
- it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1673
+ it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1696
1674
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1697
- return _regenerator.default.wrap(function _callee33$(_context33) {
1698
- while (1) switch (_context33.prev = _context33.next) {
1675
+ return _regenerator.default.wrap(function _callee32$(_context32) {
1676
+ while (1) switch (_context32.prev = _context32.next) {
1699
1677
  case 0:
1700
1678
  statusPayload = {
1701
1679
  statusCode: 503,
@@ -1717,7 +1695,7 @@ describe('State Machine handler tests', function () {
1717
1695
  };
1718
1696
  call['connected'] = true;
1719
1697
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1720
- _context33.next = 9;
1698
+ _context32.next = 9;
1721
1699
  return call['handleRoapEstablished']({}, dummyEvent);
1722
1700
  case 9:
1723
1701
  jest.advanceTimersByTime(1005);
@@ -1729,14 +1707,14 @@ describe('State Machine handler tests', function () {
1729
1707
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1730
1708
  case 14:
1731
1709
  case "end":
1732
- return _context33.stop();
1710
+ return _context32.stop();
1733
1711
  }
1734
- }, _callee33);
1712
+ }, _callee32);
1735
1713
  })));
1736
- it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1714
+ it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1737
1715
  var statusPayload, stateMachineSpy, funcSpy, errorEvent;
1738
- return _regenerator.default.wrap(function _callee34$(_context34) {
1739
- while (1) switch (_context34.prev = _context34.next) {
1716
+ return _regenerator.default.wrap(function _callee33$(_context33) {
1717
+ while (1) switch (_context33.prev = _context33.next) {
1740
1718
  case 0:
1741
1719
  statusPayload = {
1742
1720
  statusCode: 403,
@@ -1759,14 +1737,14 @@ describe('State Machine handler tests', function () {
1759
1737
  expect(stateMachineSpy).not.toHaveBeenCalled();
1760
1738
  case 9:
1761
1739
  case "end":
1762
- return _context34.stop();
1740
+ return _context33.stop();
1763
1741
  }
1764
- }, _callee34);
1742
+ }, _callee33);
1765
1743
  })));
1766
- it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1744
+ it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1767
1745
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1768
- return _regenerator.default.wrap(function _callee35$(_context35) {
1769
- while (1) switch (_context35.prev = _context35.next) {
1746
+ return _regenerator.default.wrap(function _callee34$(_context34) {
1747
+ while (1) switch (_context34.prev = _context34.next) {
1770
1748
  case 0:
1771
1749
  statusPayload = {
1772
1750
  statusCode: 200,
@@ -1784,7 +1762,7 @@ describe('State Machine handler tests', function () {
1784
1762
  }
1785
1763
  };
1786
1764
  call['connected'] = false;
1787
- _context35.next = 8;
1765
+ _context34.next = 8;
1788
1766
  return call['handleRoapError']({}, errorEvent);
1789
1767
  case 8:
1790
1768
  expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
@@ -1800,14 +1778,14 @@ describe('State Machine handler tests', function () {
1800
1778
  });
1801
1779
  case 11:
1802
1780
  case "end":
1803
- return _context35.stop();
1781
+ return _context34.stop();
1804
1782
  }
1805
- }, _callee35);
1783
+ }, _callee34);
1806
1784
  })));
1807
- it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1785
+ it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1808
1786
  var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
1809
- return _regenerator.default.wrap(function _callee36$(_context36) {
1810
- while (1) switch (_context36.prev = _context36.next) {
1787
+ return _regenerator.default.wrap(function _callee35$(_context35) {
1788
+ while (1) switch (_context35.prev = _context35.next) {
1811
1789
  case 0:
1812
1790
  statusPayload = {
1813
1791
  statusCode: 403,
@@ -1845,10 +1823,10 @@ describe('State Machine handler tests', function () {
1845
1823
  messageType: 'ANSWER'
1846
1824
  }
1847
1825
  };
1848
- _context36.next = 15;
1826
+ _context35.next = 15;
1849
1827
  return call.sendMediaStateMachineEvt(answerEvent);
1850
1828
  case 15:
1851
- _context36.next = 17;
1829
+ _context35.next = 17;
1852
1830
  return (0, _testUtil.flushPromises)(2);
1853
1831
  case 17:
1854
1832
  expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
@@ -1866,14 +1844,14 @@ describe('State Machine handler tests', function () {
1866
1844
  expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
1867
1845
  case 22:
1868
1846
  case "end":
1869
- return _context36.stop();
1847
+ return _context35.stop();
1870
1848
  }
1871
- }, _callee36);
1849
+ }, _callee35);
1872
1850
  })));
1873
- it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
1851
+ it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1874
1852
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1875
- return _regenerator.default.wrap(function _callee37$(_context37) {
1876
- while (1) switch (_context37.prev = _context37.next) {
1853
+ return _regenerator.default.wrap(function _callee36$(_context36) {
1854
+ while (1) switch (_context36.prev = _context36.next) {
1877
1855
  case 0:
1878
1856
  statusPayload = {
1879
1857
  statusCode: 200,
@@ -1906,7 +1884,7 @@ describe('State Machine handler tests', function () {
1906
1884
  seq: 1,
1907
1885
  messageType: 'ANSWER'
1908
1886
  };
1909
- _context37.next = 17;
1887
+ _context36.next = 17;
1910
1888
  return call.sendMediaStateMachineEvt(dummyEvent);
1911
1889
  case 17:
1912
1890
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1928,7 +1906,7 @@ describe('State Machine handler tests', function () {
1928
1906
  seq: 2,
1929
1907
  messageType: 'OFFER_REQUEST'
1930
1908
  };
1931
- _context37.next = 23;
1909
+ _context36.next = 23;
1932
1910
  return call.sendMediaStateMachineEvt(dummyEvent);
1933
1911
  case 23:
1934
1912
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1978,7 +1956,7 @@ describe('State Machine handler tests', function () {
1978
1956
  };
1979
1957
  call.sendCallStateMachineEvt(dummyEvent);
1980
1958
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
1981
- _context37.next = 49;
1959
+ _context36.next = 49;
1982
1960
  return call.sendMediaStateMachineEvt(dummyEvent);
1983
1961
  case 49:
1984
1962
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1987,7 +1965,7 @@ describe('State Machine handler tests', function () {
1987
1965
  seq: 3,
1988
1966
  messageType: 'ANSWER'
1989
1967
  };
1990
- _context37.next = 54;
1968
+ _context36.next = 54;
1991
1969
  return call.sendMediaStateMachineEvt(dummyEvent);
1992
1970
  case 54:
1993
1971
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2006,7 +1984,7 @@ describe('State Machine handler tests', function () {
2006
1984
  messageType: 'OK'
2007
1985
  }
2008
1986
  };
2009
- _context37.next = 63;
1987
+ _context36.next = 63;
2010
1988
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2011
1989
  case 63:
2012
1990
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
@@ -2021,14 +1999,14 @@ describe('State Machine handler tests', function () {
2021
1999
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2022
2000
  case 70:
2023
2001
  case "end":
2024
- return _context37.stop();
2002
+ return _context36.stop();
2025
2003
  }
2026
- }, _callee37);
2004
+ }, _callee36);
2027
2005
  })));
2028
- it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
2006
+ it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
2029
2007
  var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
2030
- return _regenerator.default.wrap(function _callee38$(_context38) {
2031
- while (1) switch (_context38.prev = _context38.next) {
2008
+ return _regenerator.default.wrap(function _callee37$(_context37) {
2009
+ while (1) switch (_context37.prev = _context37.next) {
2032
2010
  case 0:
2033
2011
  mockStatusBody = {
2034
2012
  device: {
@@ -2068,7 +2046,7 @@ describe('State Machine handler tests', function () {
2068
2046
  seq: 1,
2069
2047
  messageType: 'ANSWER'
2070
2048
  };
2071
- _context38.next = 18;
2049
+ _context37.next = 18;
2072
2050
  return call.sendMediaStateMachineEvt(dummyEvent);
2073
2051
  case 18:
2074
2052
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -2090,7 +2068,7 @@ describe('State Machine handler tests', function () {
2090
2068
  seq: 2,
2091
2069
  messageType: 'OFFER_REQUEST'
2092
2070
  };
2093
- _context38.next = 24;
2071
+ _context37.next = 24;
2094
2072
  return call.sendMediaStateMachineEvt(dummyEvent);
2095
2073
  case 24:
2096
2074
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -2140,7 +2118,7 @@ describe('State Machine handler tests', function () {
2140
2118
  };
2141
2119
  call.sendCallStateMachineEvt(dummyEvent);
2142
2120
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
2143
- _context38.next = 50;
2121
+ _context37.next = 50;
2144
2122
  return call.sendMediaStateMachineEvt(dummyEvent);
2145
2123
  case 50:
2146
2124
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2149,7 +2127,7 @@ describe('State Machine handler tests', function () {
2149
2127
  seq: 3,
2150
2128
  messageType: 'ANSWER'
2151
2129
  };
2152
- _context38.next = 55;
2130
+ _context37.next = 55;
2153
2131
  return call.sendMediaStateMachineEvt(dummyEvent);
2154
2132
  case 55:
2155
2133
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2166,7 +2144,7 @@ describe('State Machine handler tests', function () {
2166
2144
  }
2167
2145
  };
2168
2146
  call.sendMediaStateMachineEvt(dummyEvent);
2169
- _context38.next = 62;
2147
+ _context37.next = 62;
2170
2148
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2171
2149
  case 62:
2172
2150
  expect(call['receivedRoapOKSeq']).toBe(3);
@@ -2182,14 +2160,14 @@ describe('State Machine handler tests', function () {
2182
2160
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2183
2161
  case 70:
2184
2162
  case "end":
2185
- return _context38.stop();
2163
+ return _context37.stop();
2186
2164
  }
2187
- }, _callee38);
2165
+ }, _callee37);
2188
2166
  })));
2189
- it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2167
+ it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
2190
2168
  var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
2191
- return _regenerator.default.wrap(function _callee39$(_context39) {
2192
- while (1) switch (_context39.prev = _context39.next) {
2169
+ return _regenerator.default.wrap(function _callee38$(_context38) {
2170
+ while (1) switch (_context38.prev = _context38.next) {
2193
2171
  case 0:
2194
2172
  statusPayload = {
2195
2173
  statusCode: 200,
@@ -2256,14 +2234,14 @@ describe('State Machine handler tests', function () {
2256
2234
  });
2257
2235
  case 33:
2258
2236
  case "end":
2259
- return _context39.stop();
2237
+ return _context38.stop();
2260
2238
  }
2261
- }, _callee39);
2239
+ }, _callee38);
2262
2240
  })));
2263
- it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2241
+ it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2264
2242
  var emitSpy, deleteSpy;
2265
- return _regenerator.default.wrap(function _callee40$(_context40) {
2266
- while (1) switch (_context40.prev = _context40.next) {
2243
+ return _regenerator.default.wrap(function _callee39$(_context39) {
2244
+ while (1) switch (_context39.prev = _context39.next) {
2267
2245
  case 0:
2268
2246
  emitSpy = jest.spyOn(call, 'emit');
2269
2247
  deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
@@ -2272,7 +2250,7 @@ describe('State Machine handler tests', function () {
2272
2250
  call.sendCallStateMachineEvt({
2273
2251
  type: 'E_RECV_CALL_DISCONNECT'
2274
2252
  });
2275
- _context40.next = 5;
2253
+ _context39.next = 5;
2276
2254
  return (0, _testUtil.flushPromises)(1);
2277
2255
  case 5:
2278
2256
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
@@ -2280,9 +2258,9 @@ describe('State Machine handler tests', function () {
2280
2258
  expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
2281
2259
  case 8:
2282
2260
  case "end":
2283
- return _context40.stop();
2261
+ return _context39.stop();
2284
2262
  }
2285
- }, _callee40);
2263
+ }, _callee39);
2286
2264
  })));
2287
2265
  describe('Call event timers tests', function () {
2288
2266
  var callManager;
@@ -2293,10 +2271,10 @@ describe('State Machine handler tests', function () {
2293
2271
  afterEach(function () {
2294
2272
  jest.clearAllTimers();
2295
2273
  });
2296
- it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2274
+ it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2297
2275
  var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
2298
- return _regenerator.default.wrap(function _callee41$(_context41) {
2299
- while (1) switch (_context41.prev = _context41.next) {
2276
+ return _regenerator.default.wrap(function _callee40$(_context40) {
2277
+ while (1) switch (_context40.prev = _context40.next) {
2300
2278
  case 0:
2301
2279
  statusPayload = {
2302
2280
  statusCode: 200,
@@ -2313,7 +2291,7 @@ describe('State Machine handler tests', function () {
2313
2291
  webex.request.mockReturnValue(statusPayload);
2314
2292
 
2315
2293
  // handleOutgoingCallSetup is asynchronous
2316
- _context41.next = 9;
2294
+ _context40.next = 9;
2317
2295
  return call.sendCallStateMachineEvt(dummyEvent);
2318
2296
  case 9:
2319
2297
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2356,14 +2334,14 @@ describe('State Machine handler tests', function () {
2356
2334
  expect(callManager.callCollection).toStrictEqual({});
2357
2335
  case 32:
2358
2336
  case "end":
2359
- return _context41.stop();
2337
+ return _context40.stop();
2360
2338
  }
2361
- }, _callee41);
2339
+ }, _callee40);
2362
2340
  })));
2363
- it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
2341
+ it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2364
2342
  var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
2365
- return _regenerator.default.wrap(function _callee42$(_context42) {
2366
- while (1) switch (_context42.prev = _context42.next) {
2343
+ return _regenerator.default.wrap(function _callee41$(_context41) {
2344
+ while (1) switch (_context41.prev = _context41.next) {
2367
2345
  case 0:
2368
2346
  statusPayload = {
2369
2347
  statusCode: 200,
@@ -2382,7 +2360,7 @@ describe('State Machine handler tests', function () {
2382
2360
  expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
2383
2361
 
2384
2362
  // handleOutgoingCallSetup is asynchronous
2385
- _context42.next = 11;
2363
+ _context41.next = 11;
2386
2364
  return call.sendCallStateMachineEvt(dummyEvent);
2387
2365
  case 11:
2388
2366
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2394,9 +2372,9 @@ describe('State Machine handler tests', function () {
2394
2372
  expect(callManager.callCollection).toStrictEqual({});
2395
2373
  case 18:
2396
2374
  case "end":
2397
- return _context42.stop();
2375
+ return _context41.stop();
2398
2376
  }
2399
- }, _callee42);
2377
+ }, _callee41);
2400
2378
  })));
2401
2379
  });
2402
2380
  });
@@ -2456,10 +2434,10 @@ describe('Supplementary Services tests', function () {
2456
2434
  beforeEach(function () {
2457
2435
  call.removeAllListeners();
2458
2436
  });
2459
- it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
2437
+ it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
2460
2438
  var responsePayload, warnSpy, roapEvent;
2461
- return _regenerator.default.wrap(function _callee44$(_context44) {
2462
- while (1) switch (_context44.prev = _context44.next) {
2439
+ return _regenerator.default.wrap(function _callee43$(_context43) {
2440
+ while (1) switch (_context43.prev = _context43.next) {
2463
2441
  case 0:
2464
2442
  expect.assertions(7);
2465
2443
  responsePayload = {
@@ -2472,25 +2450,25 @@ describe('Supplementary Services tests', function () {
2472
2450
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2473
2451
  call['held'] = false;
2474
2452
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2475
- var _ref44 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(correlationId) {
2476
- return _regenerator.default.wrap(function _callee43$(_context43) {
2477
- while (1) switch (_context43.prev = _context43.next) {
2453
+ var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(correlationId) {
2454
+ return _regenerator.default.wrap(function _callee42$(_context42) {
2455
+ while (1) switch (_context42.prev = _context42.next) {
2478
2456
  case 0:
2479
2457
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2480
2458
  case 1:
2481
2459
  case "end":
2482
- return _context43.stop();
2460
+ return _context42.stop();
2483
2461
  }
2484
- }, _callee43);
2462
+ }, _callee42);
2485
2463
  }));
2486
2464
  return function (_x) {
2487
- return _ref44.apply(this, arguments);
2465
+ return _ref43.apply(this, arguments);
2488
2466
  };
2489
2467
  }());
2490
- _context44.next = 10;
2468
+ _context43.next = 10;
2491
2469
  return call.doHoldResume();
2492
2470
  case 10:
2493
- _context44.next = 12;
2471
+ _context43.next = 12;
2494
2472
  return (0, _testUtil.flushPromises)(2);
2495
2473
  case 12:
2496
2474
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2506,11 +2484,11 @@ describe('Supplementary Services tests', function () {
2506
2484
  call['handleIncomingRoapOffer']({}, dummyEvent);
2507
2485
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2508
2486
  roapEvent.data.type = 'ANSWER';
2509
- _context44.next = 20;
2487
+ _context43.next = 20;
2510
2488
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2511
2489
  case 20:
2512
2490
  roapEvent.data.type = 'OK';
2513
- _context44.next = 23;
2491
+ _context43.next = 23;
2514
2492
  return call['handleRoapEstablished']({}, dummyEvent);
2515
2493
  case 23:
2516
2494
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2525,14 +2503,14 @@ describe('Supplementary Services tests', function () {
2525
2503
  });
2526
2504
  case 28:
2527
2505
  case "end":
2528
- return _context44.stop();
2506
+ return _context43.stop();
2529
2507
  }
2530
- }, _callee44);
2508
+ }, _callee43);
2531
2509
  })));
2532
- it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
2510
+ it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
2533
2511
  var responsePayload, warnSpy, roapEvent;
2534
- return _regenerator.default.wrap(function _callee46$(_context46) {
2535
- while (1) switch (_context46.prev = _context46.next) {
2512
+ return _regenerator.default.wrap(function _callee45$(_context45) {
2513
+ while (1) switch (_context45.prev = _context45.next) {
2536
2514
  case 0:
2537
2515
  expect.assertions(8);
2538
2516
  responsePayload = {
@@ -2545,26 +2523,26 @@ describe('Supplementary Services tests', function () {
2545
2523
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2546
2524
  call['held'] = false;
2547
2525
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2548
- var _ref46 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
2549
- return _regenerator.default.wrap(function _callee45$(_context45) {
2550
- while (1) switch (_context45.prev = _context45.next) {
2526
+ var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(correlationId) {
2527
+ return _regenerator.default.wrap(function _callee44$(_context44) {
2528
+ while (1) switch (_context44.prev = _context44.next) {
2551
2529
  case 0:
2552
2530
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2553
2531
  case 1:
2554
2532
  case "end":
2555
- return _context45.stop();
2533
+ return _context44.stop();
2556
2534
  }
2557
- }, _callee45);
2535
+ }, _callee44);
2558
2536
  }));
2559
2537
  return function (_x2) {
2560
- return _ref46.apply(this, arguments);
2538
+ return _ref45.apply(this, arguments);
2561
2539
  };
2562
2540
  }());
2563
2541
  call.doHoldResume();
2564
- _context46.next = 11;
2542
+ _context45.next = 11;
2565
2543
  return _promise.default.resolve();
2566
2544
  case 11:
2567
- _context46.next = 13;
2545
+ _context45.next = 13;
2568
2546
  return _promise.default.resolve();
2569
2547
  case 13:
2570
2548
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2580,11 +2558,11 @@ describe('Supplementary Services tests', function () {
2580
2558
  call['handleIncomingRoapOffer']({}, dummyEvent);
2581
2559
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2582
2560
  roapEvent.data.type = 'ANSWER';
2583
- _context46.next = 22;
2561
+ _context45.next = 22;
2584
2562
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2585
2563
  case 22:
2586
2564
  roapEvent.data.type = 'OK';
2587
- _context46.next = 25;
2565
+ _context45.next = 25;
2588
2566
  return call['handleRoapEstablished']({}, dummyEvent);
2589
2567
  case 25:
2590
2568
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2599,14 +2577,14 @@ describe('Supplementary Services tests', function () {
2599
2577
  });
2600
2578
  case 30:
2601
2579
  case "end":
2602
- return _context46.stop();
2580
+ return _context45.stop();
2603
2581
  }
2604
- }, _callee46);
2582
+ }, _callee45);
2605
2583
  })));
2606
- it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
2584
+ it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
2607
2585
  var responsePayload;
2608
- return _regenerator.default.wrap(function _callee48$(_context48) {
2609
- while (1) switch (_context48.prev = _context48.next) {
2586
+ return _regenerator.default.wrap(function _callee47$(_context47) {
2587
+ while (1) switch (_context47.prev = _context47.next) {
2610
2588
  case 0:
2611
2589
  expect.assertions(4);
2612
2590
  responsePayload = {
@@ -2616,26 +2594,26 @@ describe('Supplementary Services tests', function () {
2616
2594
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2617
2595
  call['held'] = false;
2618
2596
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2619
- var _ref48 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(errObj) {
2620
- return _regenerator.default.wrap(function _callee47$(_context47) {
2621
- while (1) switch (_context47.prev = _context47.next) {
2597
+ var _ref47 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(errObj) {
2598
+ return _regenerator.default.wrap(function _callee46$(_context46) {
2599
+ while (1) switch (_context46.prev = _context46.next) {
2622
2600
  case 0:
2623
2601
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2624
2602
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2625
2603
  case 2:
2626
2604
  case "end":
2627
- return _context47.stop();
2605
+ return _context46.stop();
2628
2606
  }
2629
- }, _callee47);
2607
+ }, _callee46);
2630
2608
  }));
2631
2609
  return function (_x3) {
2632
- return _ref48.apply(this, arguments);
2610
+ return _ref47.apply(this, arguments);
2633
2611
  };
2634
2612
  }());
2635
- _context48.next = 7;
2613
+ _context47.next = 7;
2636
2614
  return call.doHoldResume();
2637
2615
  case 7:
2638
- _context48.next = 9;
2616
+ _context47.next = 9;
2639
2617
  return (0, _testUtil.flushPromises)(2);
2640
2618
  case 9:
2641
2619
  expect(call.isHeld()).toStrictEqual(false);
@@ -2645,14 +2623,14 @@ describe('Supplementary Services tests', function () {
2645
2623
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2646
2624
  case 11:
2647
2625
  case "end":
2648
- return _context48.stop();
2626
+ return _context47.stop();
2649
2627
  }
2650
- }, _callee48);
2628
+ }, _callee47);
2651
2629
  })));
2652
- it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
2630
+ it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
2653
2631
  var responsePayload, rejectPayload, roapEvent;
2654
- return _regenerator.default.wrap(function _callee50$(_context50) {
2655
- while (1) switch (_context50.prev = _context50.next) {
2632
+ return _regenerator.default.wrap(function _callee49$(_context49) {
2633
+ while (1) switch (_context49.prev = _context49.next) {
2656
2634
  case 0:
2657
2635
  expect.assertions(5);
2658
2636
  responsePayload = {
@@ -2666,24 +2644,24 @@ describe('Supplementary Services tests', function () {
2666
2644
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2667
2645
  call['held'] = false;
2668
2646
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2669
- var _ref50 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
2670
- return _regenerator.default.wrap(function _callee49$(_context49) {
2671
- while (1) switch (_context49.prev = _context49.next) {
2647
+ var _ref49 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
2648
+ return _regenerator.default.wrap(function _callee48$(_context48) {
2649
+ while (1) switch (_context48.prev = _context48.next) {
2672
2650
  case 0:
2673
2651
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2674
2652
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2675
2653
  case 2:
2676
2654
  case "end":
2677
- return _context49.stop();
2655
+ return _context48.stop();
2678
2656
  }
2679
- }, _callee49);
2657
+ }, _callee48);
2680
2658
  }));
2681
2659
  return function (_x4) {
2682
- return _ref50.apply(this, arguments);
2660
+ return _ref49.apply(this, arguments);
2683
2661
  };
2684
2662
  }());
2685
2663
  call.doHoldResume();
2686
- _context50.next = 9;
2664
+ _context49.next = 9;
2687
2665
  return (0, _testUtil.flushPromises)(2);
2688
2666
  case 9:
2689
2667
  /* the Call State should transition to S_CALL_ESTABLISHED
@@ -2693,7 +2671,7 @@ describe('Supplementary Services tests', function () {
2693
2671
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2694
2672
  /* We are intentionally failing the ROAP ANSWER */
2695
2673
  roapEvent.data.type = 'ANSWER';
2696
- _context50.next = 15;
2674
+ _context49.next = 15;
2697
2675
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2698
2676
  case 15:
2699
2677
  expect(call.isHeld()).toStrictEqual(false);
@@ -2701,14 +2679,14 @@ describe('Supplementary Services tests', function () {
2701
2679
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2702
2680
  case 17:
2703
2681
  case "end":
2704
- return _context50.stop();
2682
+ return _context49.stop();
2705
2683
  }
2706
- }, _callee50);
2684
+ }, _callee49);
2707
2685
  })));
2708
- it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
2686
+ it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
2709
2687
  var responsePayload, warnSpy, roapEvent;
2710
- return _regenerator.default.wrap(function _callee51$(_context51) {
2711
- while (1) switch (_context51.prev = _context51.next) {
2688
+ return _regenerator.default.wrap(function _callee50$(_context50) {
2689
+ while (1) switch (_context50.prev = _context50.next) {
2712
2690
  case 0:
2713
2691
  responsePayload = {
2714
2692
  statusCode: 200,
@@ -2719,10 +2697,10 @@ describe('Supplementary Services tests', function () {
2719
2697
  jest.spyOn(global, 'clearTimeout');
2720
2698
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2721
2699
  call['held'] = false;
2722
- _context51.next = 8;
2700
+ _context50.next = 8;
2723
2701
  return call.doHoldResume();
2724
2702
  case 8:
2725
- _context51.next = 10;
2703
+ _context50.next = 10;
2726
2704
  return (0, _testUtil.flushPromises)(2);
2727
2705
  case 10:
2728
2706
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2737,19 +2715,19 @@ describe('Supplementary Services tests', function () {
2737
2715
  call['handleIncomingRoapOffer']({}, dummyEvent);
2738
2716
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2739
2717
  roapEvent.data.type = 'ANSWER';
2740
- _context51.next = 17;
2718
+ _context50.next = 17;
2741
2719
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2742
2720
  case 17:
2743
2721
  jest.spyOn(webex, 'request').mockRejectedValue({
2744
2722
  statusCode: 403
2745
2723
  });
2746
2724
  roapEvent.data.type = 'OK';
2747
- _context51.next = 21;
2725
+ _context50.next = 21;
2748
2726
  return call['handleRoapEstablished']({}, dummyEvent);
2749
2727
  case 21:
2750
2728
  /* this is for coverage */
2751
2729
  call['callStateMachine'].state.value = 'S_CALL_HOLD';
2752
- _context51.next = 24;
2730
+ _context50.next = 24;
2753
2731
  return call['handleRoapEstablished']({}, dummyEvent);
2754
2732
  case 24:
2755
2733
  expect(call.isHeld()).toStrictEqual(false);
@@ -2761,14 +2739,14 @@ describe('Supplementary Services tests', function () {
2761
2739
  });
2762
2740
  case 27:
2763
2741
  case "end":
2764
- return _context51.stop();
2742
+ return _context50.stop();
2765
2743
  }
2766
- }, _callee51);
2744
+ }, _callee50);
2767
2745
  })));
2768
- it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
2746
+ it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
2769
2747
  var responsePayload, warnSpy, roapEvent;
2770
- return _regenerator.default.wrap(function _callee52$(_context52) {
2771
- while (1) switch (_context52.prev = _context52.next) {
2748
+ return _regenerator.default.wrap(function _callee51$(_context51) {
2749
+ while (1) switch (_context51.prev = _context51.next) {
2772
2750
  case 0:
2773
2751
  responsePayload = {
2774
2752
  statusCode: 200,
@@ -2779,10 +2757,10 @@ describe('Supplementary Services tests', function () {
2779
2757
  jest.spyOn(global, 'clearTimeout');
2780
2758
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2781
2759
  call['held'] = true;
2782
- _context52.next = 8;
2760
+ _context51.next = 8;
2783
2761
  return call.doHoldResume();
2784
2762
  case 8:
2785
- _context52.next = 10;
2763
+ _context51.next = 10;
2786
2764
  return (0, _testUtil.flushPromises)(2);
2787
2765
  case 10:
2788
2766
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2797,14 +2775,14 @@ describe('Supplementary Services tests', function () {
2797
2775
  call['handleIncomingRoapOffer']({}, dummyEvent);
2798
2776
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2799
2777
  roapEvent.data.type = 'ANSWER';
2800
- _context52.next = 17;
2778
+ _context51.next = 17;
2801
2779
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2802
2780
  case 17:
2803
2781
  jest.spyOn(webex, 'request').mockRejectedValue({
2804
2782
  statusCode: 403
2805
2783
  });
2806
2784
  roapEvent.data.type = 'OK';
2807
- _context52.next = 21;
2785
+ _context51.next = 21;
2808
2786
  return call['handleRoapEstablished']({}, dummyEvent);
2809
2787
  case 21:
2810
2788
  expect(call.isHeld()).toStrictEqual(true);
@@ -2816,14 +2794,14 @@ describe('Supplementary Services tests', function () {
2816
2794
  });
2817
2795
  case 24:
2818
2796
  case "end":
2819
- return _context52.stop();
2797
+ return _context51.stop();
2820
2798
  }
2821
- }, _callee52);
2799
+ }, _callee51);
2822
2800
  })));
2823
- it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
2801
+ it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
2824
2802
  var responsePayload, roapEvent;
2825
- return _regenerator.default.wrap(function _callee54$(_context54) {
2826
- while (1) switch (_context54.prev = _context54.next) {
2803
+ return _regenerator.default.wrap(function _callee53$(_context53) {
2804
+ while (1) switch (_context53.prev = _context53.next) {
2827
2805
  case 0:
2828
2806
  expect.assertions(5);
2829
2807
  responsePayload = {
@@ -2833,25 +2811,25 @@ describe('Supplementary Services tests', function () {
2833
2811
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2834
2812
  call['held'] = false;
2835
2813
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2836
- var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(errObj) {
2837
- return _regenerator.default.wrap(function _callee53$(_context53) {
2838
- while (1) switch (_context53.prev = _context53.next) {
2814
+ var _ref53 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
2815
+ return _regenerator.default.wrap(function _callee52$(_context52) {
2816
+ while (1) switch (_context52.prev = _context52.next) {
2839
2817
  case 0:
2840
2818
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2841
2819
  expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
2842
2820
  case 2:
2843
2821
  case "end":
2844
- return _context53.stop();
2822
+ return _context52.stop();
2845
2823
  }
2846
- }, _callee53);
2824
+ }, _callee52);
2847
2825
  }));
2848
2826
  return function (_x5) {
2849
- return _ref54.apply(this, arguments);
2827
+ return _ref53.apply(this, arguments);
2850
2828
  };
2851
2829
  }());
2852
2830
  jest.runAllTimers();
2853
2831
  call.doHoldResume();
2854
- _context54.next = 9;
2832
+ _context53.next = 9;
2855
2833
  return (0, _testUtil.flushPromises)(2);
2856
2834
  case 9:
2857
2835
  /* At this point, the Call State should be S_CALL_HOLD
@@ -2864,11 +2842,11 @@ describe('Supplementary Services tests', function () {
2864
2842
  call['handleIncomingRoapOffer']({}, dummyEvent);
2865
2843
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2866
2844
  roapEvent.data.type = 'ANSWER';
2867
- _context54.next = 15;
2845
+ _context53.next = 15;
2868
2846
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2869
2847
  case 15:
2870
2848
  roapEvent.data.type = 'OK';
2871
- _context54.next = 18;
2849
+ _context53.next = 18;
2872
2850
  return call['handleRoapEstablished']({}, dummyEvent);
2873
2851
  case 18:
2874
2852
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2880,14 +2858,14 @@ describe('Supplementary Services tests', function () {
2880
2858
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2881
2859
  case 21:
2882
2860
  case "end":
2883
- return _context54.stop();
2861
+ return _context53.stop();
2884
2862
  }
2885
- }, _callee54);
2863
+ }, _callee53);
2886
2864
  })));
2887
- it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
2865
+ it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
2888
2866
  var responsePayload, warnSpy, roapEvent;
2889
- return _regenerator.default.wrap(function _callee56$(_context56) {
2890
- while (1) switch (_context56.prev = _context56.next) {
2867
+ return _regenerator.default.wrap(function _callee55$(_context55) {
2868
+ while (1) switch (_context55.prev = _context55.next) {
2891
2869
  case 0:
2892
2870
  expect.assertions(7);
2893
2871
  responsePayload = {
@@ -2900,25 +2878,25 @@ describe('Supplementary Services tests', function () {
2900
2878
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2901
2879
  call['held'] = true;
2902
2880
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
2903
- var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(correlationId) {
2904
- return _regenerator.default.wrap(function _callee55$(_context55) {
2905
- while (1) switch (_context55.prev = _context55.next) {
2881
+ var _ref55 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(correlationId) {
2882
+ return _regenerator.default.wrap(function _callee54$(_context54) {
2883
+ while (1) switch (_context54.prev = _context54.next) {
2906
2884
  case 0:
2907
2885
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2908
2886
  case 1:
2909
2887
  case "end":
2910
- return _context55.stop();
2888
+ return _context54.stop();
2911
2889
  }
2912
- }, _callee55);
2890
+ }, _callee54);
2913
2891
  }));
2914
2892
  return function (_x6) {
2915
- return _ref56.apply(this, arguments);
2893
+ return _ref55.apply(this, arguments);
2916
2894
  };
2917
2895
  }());
2918
- _context56.next = 10;
2896
+ _context55.next = 10;
2919
2897
  return call.doHoldResume();
2920
2898
  case 10:
2921
- _context56.next = 12;
2899
+ _context55.next = 12;
2922
2900
  return (0, _testUtil.flushPromises)(2);
2923
2901
  case 12:
2924
2902
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2934,11 +2912,11 @@ describe('Supplementary Services tests', function () {
2934
2912
  call['handleIncomingRoapOffer']({}, dummyEvent);
2935
2913
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2936
2914
  roapEvent.data.type = 'ANSWER';
2937
- _context56.next = 20;
2915
+ _context55.next = 20;
2938
2916
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2939
2917
  case 20:
2940
2918
  roapEvent.data.type = 'OK';
2941
- _context56.next = 23;
2919
+ _context55.next = 23;
2942
2920
  return call['handleRoapEstablished']({}, dummyEvent);
2943
2921
  case 23:
2944
2922
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2953,14 +2931,14 @@ describe('Supplementary Services tests', function () {
2953
2931
  });
2954
2932
  case 28:
2955
2933
  case "end":
2956
- return _context56.stop();
2934
+ return _context55.stop();
2957
2935
  }
2958
- }, _callee56);
2936
+ }, _callee55);
2959
2937
  })));
2960
- it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
2938
+ it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
2961
2939
  var responsePayload, warnSpy, roapEvent;
2962
- return _regenerator.default.wrap(function _callee58$(_context58) {
2963
- while (1) switch (_context58.prev = _context58.next) {
2940
+ return _regenerator.default.wrap(function _callee57$(_context57) {
2941
+ while (1) switch (_context57.prev = _context57.next) {
2964
2942
  case 0:
2965
2943
  expect.assertions(7);
2966
2944
  responsePayload = {
@@ -2973,26 +2951,26 @@ describe('Supplementary Services tests', function () {
2973
2951
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2974
2952
  call['held'] = true;
2975
2953
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
2976
- var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(correlationId) {
2977
- return _regenerator.default.wrap(function _callee57$(_context57) {
2978
- while (1) switch (_context57.prev = _context57.next) {
2954
+ var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
2955
+ return _regenerator.default.wrap(function _callee56$(_context56) {
2956
+ while (1) switch (_context56.prev = _context56.next) {
2979
2957
  case 0:
2980
2958
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2981
2959
  case 1:
2982
2960
  case "end":
2983
- return _context57.stop();
2961
+ return _context56.stop();
2984
2962
  }
2985
- }, _callee57);
2963
+ }, _callee56);
2986
2964
  }));
2987
2965
  return function (_x7) {
2988
- return _ref58.apply(this, arguments);
2966
+ return _ref57.apply(this, arguments);
2989
2967
  };
2990
2968
  }());
2991
2969
  call.doHoldResume();
2992
- _context58.next = 11;
2970
+ _context57.next = 11;
2993
2971
  return _promise.default.resolve();
2994
2972
  case 11:
2995
- _context58.next = 13;
2973
+ _context57.next = 13;
2996
2974
  return _promise.default.resolve();
2997
2975
  case 13:
2998
2976
  expect(setTimeout).not.toHaveBeenCalled();
@@ -3008,11 +2986,11 @@ describe('Supplementary Services tests', function () {
3008
2986
  call['handleIncomingRoapOffer']({}, dummyEvent);
3009
2987
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3010
2988
  roapEvent.data.type = 'ANSWER';
3011
- _context58.next = 21;
2989
+ _context57.next = 21;
3012
2990
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3013
2991
  case 21:
3014
2992
  roapEvent.data.type = 'OK';
3015
- _context58.next = 24;
2993
+ _context57.next = 24;
3016
2994
  return call['handleRoapEstablished']({}, dummyEvent);
3017
2995
  case 24:
3018
2996
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -3027,14 +3005,14 @@ describe('Supplementary Services tests', function () {
3027
3005
  });
3028
3006
  case 29:
3029
3007
  case "end":
3030
- return _context58.stop();
3008
+ return _context57.stop();
3031
3009
  }
3032
- }, _callee58);
3010
+ }, _callee57);
3033
3011
  })));
3034
- it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
3012
+ it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
3035
3013
  var responsePayload;
3036
- return _regenerator.default.wrap(function _callee60$(_context60) {
3037
- while (1) switch (_context60.prev = _context60.next) {
3014
+ return _regenerator.default.wrap(function _callee59$(_context59) {
3015
+ while (1) switch (_context59.prev = _context59.next) {
3038
3016
  case 0:
3039
3017
  expect.assertions(4);
3040
3018
  responsePayload = {
@@ -3044,26 +3022,26 @@ describe('Supplementary Services tests', function () {
3044
3022
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3045
3023
  call['held'] = true;
3046
3024
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3047
- var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(errObj) {
3048
- return _regenerator.default.wrap(function _callee59$(_context59) {
3049
- while (1) switch (_context59.prev = _context59.next) {
3025
+ var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(errObj) {
3026
+ return _regenerator.default.wrap(function _callee58$(_context58) {
3027
+ while (1) switch (_context58.prev = _context58.next) {
3050
3028
  case 0:
3051
3029
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3052
3030
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3053
3031
  case 2:
3054
3032
  case "end":
3055
- return _context59.stop();
3033
+ return _context58.stop();
3056
3034
  }
3057
- }, _callee59);
3035
+ }, _callee58);
3058
3036
  }));
3059
3037
  return function (_x8) {
3060
- return _ref60.apply(this, arguments);
3038
+ return _ref59.apply(this, arguments);
3061
3039
  };
3062
3040
  }());
3063
- _context60.next = 7;
3041
+ _context59.next = 7;
3064
3042
  return call.doHoldResume();
3065
3043
  case 7:
3066
- _context60.next = 9;
3044
+ _context59.next = 9;
3067
3045
  return (0, _testUtil.flushPromises)(2);
3068
3046
  case 9:
3069
3047
  expect(call.isHeld()).toStrictEqual(true);
@@ -3074,14 +3052,14 @@ describe('Supplementary Services tests', function () {
3074
3052
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3075
3053
  case 11:
3076
3054
  case "end":
3077
- return _context60.stop();
3055
+ return _context59.stop();
3078
3056
  }
3079
- }, _callee60);
3057
+ }, _callee59);
3080
3058
  })));
3081
- it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
3059
+ it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
3082
3060
  var responsePayload, rejectPayload, roapEvent;
3083
- return _regenerator.default.wrap(function _callee62$(_context62) {
3084
- while (1) switch (_context62.prev = _context62.next) {
3061
+ return _regenerator.default.wrap(function _callee61$(_context61) {
3062
+ while (1) switch (_context61.prev = _context61.next) {
3085
3063
  case 0:
3086
3064
  expect.assertions(5);
3087
3065
  responsePayload = {
@@ -3095,24 +3073,24 @@ describe('Supplementary Services tests', function () {
3095
3073
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
3096
3074
  call['held'] = true;
3097
3075
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3098
- var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(errObj) {
3099
- return _regenerator.default.wrap(function _callee61$(_context61) {
3100
- while (1) switch (_context61.prev = _context61.next) {
3076
+ var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(errObj) {
3077
+ return _regenerator.default.wrap(function _callee60$(_context60) {
3078
+ while (1) switch (_context60.prev = _context60.next) {
3101
3079
  case 0:
3102
3080
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3103
3081
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3104
3082
  case 2:
3105
3083
  case "end":
3106
- return _context61.stop();
3084
+ return _context60.stop();
3107
3085
  }
3108
- }, _callee61);
3086
+ }, _callee60);
3109
3087
  }));
3110
3088
  return function (_x9) {
3111
- return _ref62.apply(this, arguments);
3089
+ return _ref61.apply(this, arguments);
3112
3090
  };
3113
3091
  }());
3114
3092
  call.doHoldResume();
3115
- _context62.next = 9;
3093
+ _context61.next = 9;
3116
3094
  return (0, _testUtil.flushPromises)(2);
3117
3095
  case 9:
3118
3096
  /* At this point , the Call State should transition to S_CALL_ESTABLISHED
@@ -3123,7 +3101,7 @@ describe('Supplementary Services tests', function () {
3123
3101
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3124
3102
  /* We are intentionally failing the ROAP ANSWER */
3125
3103
  roapEvent.data.type = 'ANSWER';
3126
- _context62.next = 15;
3104
+ _context61.next = 15;
3127
3105
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3128
3106
  case 15:
3129
3107
  expect(call.isHeld()).toStrictEqual(true);
@@ -3131,14 +3109,14 @@ describe('Supplementary Services tests', function () {
3131
3109
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3132
3110
  case 17:
3133
3111
  case "end":
3134
- return _context62.stop();
3112
+ return _context61.stop();
3135
3113
  }
3136
- }, _callee62);
3114
+ }, _callee61);
3137
3115
  })));
3138
- it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
3116
+ it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
3139
3117
  var responsePayload, roapEvent;
3140
- return _regenerator.default.wrap(function _callee64$(_context64) {
3141
- while (1) switch (_context64.prev = _context64.next) {
3118
+ return _regenerator.default.wrap(function _callee63$(_context63) {
3119
+ while (1) switch (_context63.prev = _context63.next) {
3142
3120
  case 0:
3143
3121
  expect.assertions(5);
3144
3122
  responsePayload = {
@@ -3148,24 +3126,24 @@ describe('Supplementary Services tests', function () {
3148
3126
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
3149
3127
  call['held'] = true;
3150
3128
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3151
- var _ref64 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(errObj) {
3152
- return _regenerator.default.wrap(function _callee63$(_context63) {
3153
- while (1) switch (_context63.prev = _context63.next) {
3129
+ var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
3130
+ return _regenerator.default.wrap(function _callee62$(_context62) {
3131
+ while (1) switch (_context62.prev = _context62.next) {
3154
3132
  case 0:
3155
3133
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
3156
3134
  expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
3157
3135
  case 2:
3158
3136
  case "end":
3159
- return _context63.stop();
3137
+ return _context62.stop();
3160
3138
  }
3161
- }, _callee63);
3139
+ }, _callee62);
3162
3140
  }));
3163
3141
  return function (_x0) {
3164
- return _ref64.apply(this, arguments);
3142
+ return _ref63.apply(this, arguments);
3165
3143
  };
3166
3144
  }());
3167
3145
  call.doHoldResume();
3168
- _context64.next = 8;
3146
+ _context63.next = 8;
3169
3147
  return (0, _testUtil.flushPromises)(2);
3170
3148
  case 8:
3171
3149
  /* At this point ,the Call State should be S_CALL_RESUME
@@ -3178,11 +3156,11 @@ describe('Supplementary Services tests', function () {
3178
3156
  call['handleIncomingRoapOffer']({}, dummyEvent);
3179
3157
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3180
3158
  roapEvent.data.type = 'ANSWER';
3181
- _context64.next = 14;
3159
+ _context63.next = 14;
3182
3160
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3183
3161
  case 14:
3184
3162
  roapEvent.data.type = 'OK';
3185
- _context64.next = 17;
3163
+ _context63.next = 17;
3186
3164
  return call['handleRoapEstablished']({}, dummyEvent);
3187
3165
  case 17:
3188
3166
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -3192,9 +3170,9 @@ describe('Supplementary Services tests', function () {
3192
3170
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3193
3171
  case 20:
3194
3172
  case "end":
3195
- return _context64.stop();
3173
+ return _context63.stop();
3196
3174
  }
3197
- }, _callee64);
3175
+ }, _callee63);
3198
3176
  })));
3199
3177
  });
3200
3178
  describe('Call transfer tests', function () {
@@ -3227,10 +3205,10 @@ describe('Supplementary Services tests', function () {
3227
3205
  secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
3228
3206
  secondCall['held'] = false;
3229
3207
  });
3230
- it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
3208
+ it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
3231
3209
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3232
- return _regenerator.default.wrap(function _callee67$(_context67) {
3233
- while (1) switch (_context67.prev = _context67.next) {
3210
+ return _regenerator.default.wrap(function _callee66$(_context66) {
3211
+ while (1) switch (_context66.prev = _context66.next) {
3234
3212
  case 0:
3235
3213
  expect.assertions(12); // Updated to match actual assertion count
3236
3214
  responsePayload = {
@@ -3242,41 +3220,41 @@ describe('Supplementary Services tests', function () {
3242
3220
  infoSpy = jest.spyOn(_Logger.default, 'info');
3243
3221
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3244
3222
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3245
- var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(correlationId) {
3246
- return _regenerator.default.wrap(function _callee65$(_context65) {
3247
- while (1) switch (_context65.prev = _context65.next) {
3223
+ var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(correlationId) {
3224
+ return _regenerator.default.wrap(function _callee64$(_context64) {
3225
+ while (1) switch (_context64.prev = _context64.next) {
3248
3226
  case 0:
3249
3227
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3250
3228
  case 1:
3251
3229
  case "end":
3252
- return _context65.stop();
3230
+ return _context64.stop();
3253
3231
  }
3254
- }, _callee65);
3232
+ }, _callee64);
3255
3233
  }));
3256
3234
  return function (_x1) {
3257
- return _ref66.apply(this, arguments);
3235
+ return _ref65.apply(this, arguments);
3258
3236
  };
3259
3237
  }());
3260
3238
  secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3261
- var _ref67 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(correlationId) {
3262
- return _regenerator.default.wrap(function _callee66$(_context66) {
3263
- while (1) switch (_context66.prev = _context66.next) {
3239
+ var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(correlationId) {
3240
+ return _regenerator.default.wrap(function _callee65$(_context65) {
3241
+ while (1) switch (_context65.prev = _context65.next) {
3264
3242
  case 0:
3265
3243
  expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
3266
3244
  case 1:
3267
3245
  case "end":
3268
- return _context66.stop();
3246
+ return _context65.stop();
3269
3247
  }
3270
- }, _callee66);
3248
+ }, _callee65);
3271
3249
  }));
3272
3250
  return function (_x10) {
3273
- return _ref67.apply(this, arguments);
3251
+ return _ref66.apply(this, arguments);
3274
3252
  };
3275
3253
  }());
3276
- _context67.next = 10;
3254
+ _context66.next = 10;
3277
3255
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3278
3256
  case 10:
3279
- _context67.next = 12;
3257
+ _context66.next = 12;
3280
3258
  return (0, _testUtil.flushPromises)(2);
3281
3259
  case 12:
3282
3260
  expect(requestSpy).toBeCalled();
@@ -3299,14 +3277,14 @@ describe('Supplementary Services tests', function () {
3299
3277
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3300
3278
  case 24:
3301
3279
  case "end":
3302
- return _context67.stop();
3280
+ return _context66.stop();
3303
3281
  }
3304
- }, _callee67);
3282
+ }, _callee66);
3305
3283
  })));
3306
- it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
3284
+ it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
3307
3285
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3308
- return _regenerator.default.wrap(function _callee69$(_context69) {
3309
- while (1) switch (_context69.prev = _context69.next) {
3286
+ return _regenerator.default.wrap(function _callee68$(_context68) {
3287
+ while (1) switch (_context68.prev = _context68.next) {
3310
3288
  case 0:
3311
3289
  expect.assertions(10); // Updated to match actual assertion count
3312
3290
  responsePayload = {
@@ -3318,25 +3296,25 @@ describe('Supplementary Services tests', function () {
3318
3296
  infoSpy = jest.spyOn(_Logger.default, 'info');
3319
3297
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3320
3298
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3321
- var _ref69 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
3322
- return _regenerator.default.wrap(function _callee68$(_context68) {
3323
- while (1) switch (_context68.prev = _context68.next) {
3299
+ var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
3300
+ return _regenerator.default.wrap(function _callee67$(_context67) {
3301
+ while (1) switch (_context67.prev = _context67.next) {
3324
3302
  case 0:
3325
3303
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3326
3304
  case 1:
3327
3305
  case "end":
3328
- return _context68.stop();
3306
+ return _context67.stop();
3329
3307
  }
3330
- }, _callee68);
3308
+ }, _callee67);
3331
3309
  }));
3332
3310
  return function (_x11) {
3333
- return _ref69.apply(this, arguments);
3311
+ return _ref68.apply(this, arguments);
3334
3312
  };
3335
3313
  }());
3336
- _context69.next = 9;
3314
+ _context68.next = 9;
3337
3315
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3338
3316
  case 9:
3339
- _context69.next = 11;
3317
+ _context68.next = 11;
3340
3318
  return (0, _testUtil.flushPromises)(2);
3341
3319
  case 11:
3342
3320
  expect(requestSpy).toBeCalled();
@@ -3355,14 +3333,14 @@ describe('Supplementary Services tests', function () {
3355
3333
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3356
3334
  case 21:
3357
3335
  case "end":
3358
- return _context69.stop();
3336
+ return _context68.stop();
3359
3337
  }
3360
- }, _callee69);
3338
+ }, _callee68);
3361
3339
  })));
3362
- it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
3340
+ it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
3363
3341
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3364
- return _regenerator.default.wrap(function _callee70$(_context70) {
3365
- while (1) switch (_context70.prev = _context70.next) {
3342
+ return _regenerator.default.wrap(function _callee69$(_context69) {
3343
+ while (1) switch (_context69.prev = _context69.next) {
3366
3344
  case 0:
3367
3345
  responsePayload = {
3368
3346
  statusCode: 403,
@@ -3373,10 +3351,10 @@ describe('Supplementary Services tests', function () {
3373
3351
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3374
3352
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3375
3353
  call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
3376
- _context70.next = 8;
3354
+ _context69.next = 8;
3377
3355
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3378
3356
  case 8:
3379
- _context70.next = 10;
3357
+ _context69.next = 10;
3380
3358
  return (0, _testUtil.flushPromises)(1);
3381
3359
  case 10:
3382
3360
  expect(requestSpy).toBeCalled();
@@ -3397,14 +3375,14 @@ describe('Supplementary Services tests', function () {
3397
3375
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3398
3376
  case 18:
3399
3377
  case "end":
3400
- return _context70.stop();
3378
+ return _context69.stop();
3401
3379
  }
3402
- }, _callee70);
3380
+ }, _callee69);
3403
3381
  })));
3404
- it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
3382
+ it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
3405
3383
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3406
- return _regenerator.default.wrap(function _callee71$(_context71) {
3407
- while (1) switch (_context71.prev = _context71.next) {
3384
+ return _regenerator.default.wrap(function _callee70$(_context70) {
3385
+ while (1) switch (_context70.prev = _context70.next) {
3408
3386
  case 0:
3409
3387
  responsePayload = {
3410
3388
  statusCode: 403,
@@ -3414,10 +3392,10 @@ describe('Supplementary Services tests', function () {
3414
3392
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3415
3393
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3416
3394
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3417
- _context71.next = 7;
3395
+ _context70.next = 7;
3418
3396
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3419
3397
  case 7:
3420
- _context71.next = 9;
3398
+ _context70.next = 9;
3421
3399
  return (0, _testUtil.flushPromises)(2);
3422
3400
  case 9:
3423
3401
  expect(requestSpy).toBeCalled();
@@ -3438,18 +3416,18 @@ describe('Supplementary Services tests', function () {
3438
3416
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3439
3417
  case 18:
3440
3418
  case "end":
3441
- return _context71.stop();
3419
+ return _context70.stop();
3442
3420
  }
3443
- }, _callee71);
3421
+ }, _callee70);
3444
3422
  })));
3445
- it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3423
+ it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
3446
3424
  var requestSpy, warnSpy;
3447
- return _regenerator.default.wrap(function _callee72$(_context72) {
3448
- while (1) switch (_context72.prev = _context72.next) {
3425
+ return _regenerator.default.wrap(function _callee71$(_context71) {
3426
+ while (1) switch (_context71.prev = _context71.next) {
3449
3427
  case 0:
3450
3428
  requestSpy = jest.spyOn(webex, 'request');
3451
3429
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3452
- _context72.next = 4;
3430
+ _context71.next = 4;
3453
3431
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
3454
3432
  case 4:
3455
3433
  /* We should be in CALL_ESTABLISHED state */
@@ -3461,18 +3439,18 @@ describe('Supplementary Services tests', function () {
3461
3439
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3462
3440
  case 10:
3463
3441
  case "end":
3464
- return _context72.stop();
3442
+ return _context71.stop();
3465
3443
  }
3466
- }, _callee72);
3444
+ }, _callee71);
3467
3445
  })));
3468
- it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
3446
+ it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3469
3447
  var requestSpy, warnSpy;
3470
- return _regenerator.default.wrap(function _callee73$(_context73) {
3471
- while (1) switch (_context73.prev = _context73.next) {
3448
+ return _regenerator.default.wrap(function _callee72$(_context72) {
3449
+ while (1) switch (_context72.prev = _context72.next) {
3472
3450
  case 0:
3473
3451
  requestSpy = jest.spyOn(webex, 'request');
3474
3452
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3475
- _context73.next = 4;
3453
+ _context72.next = 4;
3476
3454
  return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
3477
3455
  case 4:
3478
3456
  /* We should be in CALL_ESTABLISHED state */
@@ -3484,9 +3462,9 @@ describe('Supplementary Services tests', function () {
3484
3462
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3485
3463
  case 10:
3486
3464
  case "end":
3487
- return _context73.stop();
3465
+ return _context72.stop();
3488
3466
  }
3489
- }, _callee73);
3467
+ }, _callee72);
3490
3468
  })));
3491
3469
  });
3492
3470
  });