@webex/calling 3.10.0-next.10 → 3.10.0-next.11

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.
@@ -853,10 +853,43 @@ describe('State Machine handler tests', function () {
853
853
  }
854
854
  }, _callee13);
855
855
  })));
856
- it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
857
- var statusPayload, funcSpy;
856
+ it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
857
+ var statusPayload, emitSpy, funcSpy;
858
858
  return _regenerator.default.wrap(function _callee14$(_context14) {
859
859
  while (1) switch (_context14.prev = _context14.next) {
860
+ case 0:
861
+ expect.assertions(4);
862
+ statusPayload = {
863
+ statusCode: 401
864
+ };
865
+ webex.request.mockReturnValue(statusPayload);
866
+ jest.spyOn(global, 'clearInterval');
867
+ emitSpy = jest.spyOn(call, 'emit');
868
+ call.on(_types2.CALL_EVENT_KEYS.CALL_ERROR, function (errObj) {
869
+ expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TOKEN_ERROR);
870
+ });
871
+ funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
872
+ call['handleCallEstablished']({});
873
+ jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
874
+ _context14.next = 11;
875
+ return _promise.default.resolve();
876
+ case 11:
877
+ _context14.next = 13;
878
+ return _promise.default.resolve();
879
+ case 13:
880
+ expect(clearInterval).toHaveBeenCalledTimes(1);
881
+ expect(funcSpy).toBeCalledTimes(1);
882
+ expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
883
+ case 16:
884
+ case "end":
885
+ return _context14.stop();
886
+ }
887
+ }, _callee14);
888
+ })));
889
+ it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
890
+ var statusPayload, funcSpy;
891
+ return _regenerator.default.wrap(function _callee15$(_context15) {
892
+ while (1) switch (_context15.prev = _context15.next) {
860
893
  case 0:
861
894
  expect.assertions(4);
862
895
  statusPayload = {
@@ -880,24 +913,134 @@ describe('State Machine handler tests', function () {
880
913
  /* This is to flush all the promises from the Promise queue so that
881
914
  * Jest.fakeTimers can advance time and also clear the promise Queue
882
915
  */
883
- _context14.next = 11;
916
+ _context15.next = 11;
884
917
  return _promise.default.resolve();
885
918
  case 11:
886
- _context14.next = 13;
919
+ _context15.next = 13;
887
920
  return _promise.default.resolve();
888
921
  case 13:
889
922
  expect(clearInterval).toHaveBeenCalledTimes(2); // check this
890
923
  expect(funcSpy).toBeCalledTimes(1);
891
924
  case 15:
892
925
  case "end":
893
- return _context14.stop();
926
+ return _context15.stop();
894
927
  }
895
- }, _callee14);
928
+ }, _callee15);
929
+ })));
930
+ 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;
932
+ return _regenerator.default.wrap(function _callee16$(_context16) {
933
+ while (1) switch (_context16.prev = _context16.next) {
934
+ case 0:
935
+ errorPayload = {
936
+ statusCode: 500,
937
+ headers: {
938
+ 'retry-after': 1
939
+ }
940
+ };
941
+ okPayload = {
942
+ statusCode: 200,
943
+ body: {}
944
+ };
945
+ sendEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
946
+ postStatusSpy = jest.spyOn(call, 'postStatus').mockRejectedValueOnce(errorPayload).mockResolvedValueOnce(okPayload);
947
+ if (call['sessionTimer'] === undefined) {
948
+ call['handleCallEstablished']({});
949
+ }
950
+ jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
951
+ _context16.next = 8;
952
+ return _promise.default.resolve();
953
+ case 8:
954
+ _context16.next = 10;
955
+ return _promise.default.resolve();
956
+ case 10:
957
+ expect(postStatusSpy).toHaveBeenCalledTimes(1);
958
+ expect(sendEvtSpy).toHaveBeenCalledWith({
959
+ type: 'E_CALL_ESTABLISHED'
960
+ });
961
+ case 12:
962
+ case "end":
963
+ return _context16.stop();
964
+ }
965
+ }, _callee16);
896
966
  })));
897
- it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
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) {
971
+ 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
+ errorPayload = {
993
+ statusCode: 500,
994
+ headers: {
995
+ 'retry-after': 1
996
+ }
997
+ };
998
+ jest.spyOn(global, 'clearInterval');
999
+ warnSpy = jest.spyOn(_Logger.default, 'warn');
1000
+ postStatusSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(errorPayload); // Put the call in the S_CALL_ESTABLISHED state and set it as connected
1001
+ call['callStateMachine'].state.value = 'S_CALL_ESTABLISHED';
1002
+ call['connected'] = true;
1003
+
1004
+ // Call handleCallEstablished which will setup interval
1005
+ call['handleCallEstablished']({});
1006
+
1007
+ // Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
1008
+ 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)
1013
+ // Need to do this separately to allow state machine to process and create new intervals
1014
+ jest.advanceTimersByTime(1000);
1015
+ _context18.next = 14;
1016
+ return resolvePromise();
1017
+ case 14:
1018
+ jest.advanceTimersByTime(1000);
1019
+ _context18.next = 17;
1020
+ return resolvePromise();
1021
+ case 17:
1022
+ jest.advanceTimersByTime(1000);
1023
+ _context18.next = 20;
1024
+ return resolvePromise();
1025
+ case 20:
1026
+ // 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()), {
1028
+ file: 'call',
1029
+ method: 'handleCallEstablished'
1030
+ });
1031
+ expect(postStatusSpy).toHaveBeenCalledTimes(4);
1032
+ expect(call['callKeepaliveRetryCount']).toBe(0);
1033
+ expect(call['sessionTimer']).toBeUndefined();
1034
+ case 24:
1035
+ case "end":
1036
+ return _context18.stop();
1037
+ }
1038
+ }, _callee18);
1039
+ })));
1040
+ it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
898
1041
  var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
899
- return _regenerator.default.wrap(function _callee15$(_context15) {
900
- while (1) switch (_context15.prev = _context15.next) {
1042
+ return _regenerator.default.wrap(function _callee19$(_context19) {
1043
+ while (1) switch (_context19.prev = _context19.next) {
901
1044
  case 0:
902
1045
  statusPayload = {
903
1046
  statusCode: 200,
@@ -953,14 +1096,14 @@ describe('State Machine handler tests', function () {
953
1096
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
954
1097
  case 27:
955
1098
  case "end":
956
- return _context15.stop();
1099
+ return _context19.stop();
957
1100
  }
958
- }, _callee15);
1101
+ }, _callee19);
959
1102
  })));
960
- it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
1103
+ it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
961
1104
  var statusPayload, dummyEvent;
962
- return _regenerator.default.wrap(function _callee16$(_context16) {
963
- while (1) switch (_context16.prev = _context16.next) {
1105
+ return _regenerator.default.wrap(function _callee20$(_context20) {
1106
+ while (1) switch (_context20.prev = _context20.next) {
964
1107
  case 0:
965
1108
  call['direction'] = _types3.CallDirection.INBOUND;
966
1109
  statusPayload = {
@@ -978,7 +1121,7 @@ describe('State Machine handler tests', function () {
978
1121
  webex.request.mockReturnValue(statusPayload);
979
1122
  call.sendCallStateMachineEvt(dummyEvent);
980
1123
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
981
- _context16.next = 8;
1124
+ _context20.next = 8;
982
1125
  return call['handleOutgoingCallConnect']({
983
1126
  type: 'E_SEND_CALL_CONNECT'
984
1127
  });
@@ -992,14 +1135,14 @@ describe('State Machine handler tests', function () {
992
1135
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
993
1136
  case 12:
994
1137
  case "end":
995
- return _context16.stop();
1138
+ return _context20.stop();
996
1139
  }
997
- }, _callee16);
1140
+ }, _callee20);
998
1141
  })));
999
- it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
1142
+ it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1000
1143
  var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
1001
- return _regenerator.default.wrap(function _callee17$(_context17) {
1002
- while (1) switch (_context17.prev = _context17.next) {
1144
+ return _regenerator.default.wrap(function _callee21$(_context21) {
1145
+ while (1) switch (_context21.prev = _context21.next) {
1003
1146
  case 0:
1004
1147
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1005
1148
  errorSpy = jest.spyOn(_Logger.default, 'error');
@@ -1026,7 +1169,7 @@ describe('State Machine handler tests', function () {
1026
1169
  webex.request.mockRejectedValueOnce({
1027
1170
  statusCode: 403
1028
1171
  }).mockResolvedValue(statusPayload);
1029
- _context17.next = 13;
1172
+ _context21.next = 13;
1030
1173
  return call['handleOutgoingCallConnect']({
1031
1174
  type: 'E_SEND_CALL_CONNECT'
1032
1175
  });
@@ -1037,14 +1180,14 @@ describe('State Machine handler tests', function () {
1037
1180
  expect(errorSpy).toBeCalledTimes(1);
1038
1181
  case 17:
1039
1182
  case "end":
1040
- return _context17.stop();
1183
+ return _context21.stop();
1041
1184
  }
1042
- }, _callee17);
1185
+ }, _callee21);
1043
1186
  })));
1044
- it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
1187
+ it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1045
1188
  var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
1046
- return _regenerator.default.wrap(function _callee18$(_context18) {
1047
- while (1) switch (_context18.prev = _context18.next) {
1189
+ return _regenerator.default.wrap(function _callee22$(_context22) {
1190
+ while (1) switch (_context22.prev = _context22.next) {
1048
1191
  case 0:
1049
1192
  statusPayload = {
1050
1193
  statusCode: 200,
@@ -1120,14 +1263,14 @@ describe('State Machine handler tests', function () {
1120
1263
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1121
1264
  case 42:
1122
1265
  case "end":
1123
- return _context18.stop();
1266
+ return _context22.stop();
1124
1267
  }
1125
- }, _callee18);
1268
+ }, _callee22);
1126
1269
  })));
1127
- 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 _callee19() {
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() {
1128
1271
  var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
1129
- return _regenerator.default.wrap(function _callee19$(_context19) {
1130
- while (1) switch (_context19.prev = _context19.next) {
1272
+ return _regenerator.default.wrap(function _callee23$(_context23) {
1273
+ while (1) switch (_context23.prev = _context23.next) {
1131
1274
  case 0:
1132
1275
  statusPayload = {
1133
1276
  statusCode: 200,
@@ -1195,14 +1338,14 @@ describe('State Machine handler tests', function () {
1195
1338
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1196
1339
  case 25:
1197
1340
  case "end":
1198
- return _context19.stop();
1341
+ return _context23.stop();
1199
1342
  }
1200
- }, _callee19);
1343
+ }, _callee23);
1201
1344
  })));
1202
- it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1345
+ it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1203
1346
  var statusPayload, dummyEvent;
1204
- return _regenerator.default.wrap(function _callee20$(_context20) {
1205
- while (1) switch (_context20.prev = _context20.next) {
1347
+ return _regenerator.default.wrap(function _callee24$(_context24) {
1348
+ while (1) switch (_context24.prev = _context24.next) {
1206
1349
  case 0:
1207
1350
  statusPayload = {
1208
1351
  statusCode: 200,
@@ -1241,14 +1384,14 @@ describe('State Machine handler tests', function () {
1241
1384
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1242
1385
  case 17:
1243
1386
  case "end":
1244
- return _context20.stop();
1387
+ return _context24.stop();
1245
1388
  }
1246
- }, _callee20);
1389
+ }, _callee24);
1247
1390
  })));
1248
- it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1391
+ it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1249
1392
  var statusPayload, dummyEvent, errorSpy;
1250
- return _regenerator.default.wrap(function _callee21$(_context21) {
1251
- while (1) switch (_context21.prev = _context21.next) {
1393
+ return _regenerator.default.wrap(function _callee25$(_context25) {
1394
+ while (1) switch (_context25.prev = _context25.next) {
1252
1395
  case 0:
1253
1396
  statusPayload = {
1254
1397
  statusCode: 403,
@@ -1265,7 +1408,7 @@ describe('State Machine handler tests', function () {
1265
1408
  webex.request.mockRejectedValueOnce(statusPayload);
1266
1409
  errorSpy = jest.spyOn(_Logger.default, 'error');
1267
1410
  call.sendCallStateMachineEvt(dummyEvent);
1268
- _context21.next = 7;
1411
+ _context25.next = 7;
1269
1412
  return (0, _testUtil.flushPromises)(3);
1270
1413
  case 7:
1271
1414
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
@@ -1276,14 +1419,14 @@ describe('State Machine handler tests', function () {
1276
1419
  });
1277
1420
  case 10:
1278
1421
  case "end":
1279
- return _context21.stop();
1422
+ return _context25.stop();
1280
1423
  }
1281
- }, _callee21);
1424
+ }, _callee25);
1282
1425
  })));
1283
- it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1426
+ it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1284
1427
  var statusPayload, dummyEvent, warnSpy;
1285
- return _regenerator.default.wrap(function _callee22$(_context22) {
1286
- while (1) switch (_context22.prev = _context22.next) {
1428
+ return _regenerator.default.wrap(function _callee26$(_context26) {
1429
+ while (1) switch (_context26.prev = _context26.next) {
1287
1430
  case 0:
1288
1431
  statusPayload = {
1289
1432
  statusCode: 403,
@@ -1302,10 +1445,10 @@ describe('State Machine handler tests', function () {
1302
1445
  webex.request.mockRejectedValue(statusPayload);
1303
1446
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1304
1447
  jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
1305
- _context22.next = 10;
1448
+ _context26.next = 10;
1306
1449
  return call['handleRoapEstablished']({}, dummyEvent);
1307
1450
  case 10:
1308
- _context22.next = 12;
1451
+ _context26.next = 12;
1309
1452
  return (0, _testUtil.flushPromises)(2);
1310
1453
  case 12:
1311
1454
  expect(call.isConnected()).toBe(false);
@@ -1321,14 +1464,14 @@ describe('State Machine handler tests', function () {
1321
1464
  });
1322
1465
  case 17:
1323
1466
  case "end":
1324
- return _context22.stop();
1467
+ return _context26.stop();
1325
1468
  }
1326
- }, _callee22);
1469
+ }, _callee26);
1327
1470
  })));
1328
- it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1471
+ it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1329
1472
  var statusPayload, dummyEvent;
1330
- return _regenerator.default.wrap(function _callee23$(_context23) {
1331
- while (1) switch (_context23.prev = _context23.next) {
1473
+ return _regenerator.default.wrap(function _callee27$(_context27) {
1474
+ while (1) switch (_context27.prev = _context27.next) {
1332
1475
  case 0:
1333
1476
  statusPayload = {
1334
1477
  statusCode: 403,
@@ -1351,14 +1494,14 @@ describe('State Machine handler tests', function () {
1351
1494
  expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
1352
1495
  case 8:
1353
1496
  case "end":
1354
- return _context23.stop();
1497
+ return _context27.stop();
1355
1498
  }
1356
- }, _callee23);
1499
+ }, _callee27);
1357
1500
  })));
1358
- it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1501
+ it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1359
1502
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1360
- return _regenerator.default.wrap(function _callee24$(_context24) {
1361
- while (1) switch (_context24.prev = _context24.next) {
1503
+ return _regenerator.default.wrap(function _callee28$(_context28) {
1504
+ while (1) switch (_context28.prev = _context28.next) {
1362
1505
  case 0:
1363
1506
  statusPayload = {
1364
1507
  statusCode: 503,
@@ -1380,7 +1523,7 @@ describe('State Machine handler tests', function () {
1380
1523
  }
1381
1524
  };
1382
1525
  call['connected'] = true;
1383
- _context24.next = 8;
1526
+ _context28.next = 8;
1384
1527
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1385
1528
  case 8:
1386
1529
  jest.advanceTimersByTime(1005);
@@ -1392,14 +1535,14 @@ describe('State Machine handler tests', function () {
1392
1535
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1393
1536
  case 13:
1394
1537
  case "end":
1395
- return _context24.stop();
1538
+ return _context28.stop();
1396
1539
  }
1397
- }, _callee24);
1540
+ }, _callee28);
1398
1541
  })));
1399
- it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1542
+ it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1400
1543
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1401
- return _regenerator.default.wrap(function _callee25$(_context25) {
1402
- while (1) switch (_context25.prev = _context25.next) {
1544
+ return _regenerator.default.wrap(function _callee29$(_context29) {
1545
+ while (1) switch (_context29.prev = _context29.next) {
1403
1546
  case 0:
1404
1547
  statusPayload = {
1405
1548
  statusCode: 503,
@@ -1421,7 +1564,7 @@ describe('State Machine handler tests', function () {
1421
1564
  }
1422
1565
  };
1423
1566
  call['connected'] = false;
1424
- _context25.next = 8;
1567
+ _context29.next = 8;
1425
1568
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1426
1569
  case 8:
1427
1570
  jest.advanceTimersByTime(1005);
@@ -1432,14 +1575,14 @@ describe('State Machine handler tests', function () {
1432
1575
  expect(stateMachineSpy).not.toBeCalled();
1433
1576
  case 12:
1434
1577
  case "end":
1435
- return _context25.stop();
1578
+ return _context29.stop();
1436
1579
  }
1437
- }, _callee25);
1580
+ }, _callee29);
1438
1581
  })));
1439
- it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1582
+ it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1440
1583
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1441
- return _regenerator.default.wrap(function _callee26$(_context26) {
1442
- while (1) switch (_context26.prev = _context26.next) {
1584
+ return _regenerator.default.wrap(function _callee30$(_context30) {
1585
+ while (1) switch (_context30.prev = _context30.next) {
1443
1586
  case 0:
1444
1587
  statusPayload = {
1445
1588
  statusCode: 503,
@@ -1461,7 +1604,7 @@ describe('State Machine handler tests', function () {
1461
1604
  };
1462
1605
  call['connected'] = true;
1463
1606
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
1464
- _context26.next = 9;
1607
+ _context30.next = 9;
1465
1608
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1466
1609
  case 9:
1467
1610
  jest.advanceTimersByTime(1005);
@@ -1473,14 +1616,14 @@ describe('State Machine handler tests', function () {
1473
1616
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1474
1617
  case 14:
1475
1618
  case "end":
1476
- return _context26.stop();
1619
+ return _context30.stop();
1477
1620
  }
1478
- }, _callee26);
1621
+ }, _callee30);
1479
1622
  })));
1480
- it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1623
+ it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1481
1624
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1482
- return _regenerator.default.wrap(function _callee27$(_context27) {
1483
- while (1) switch (_context27.prev = _context27.next) {
1625
+ return _regenerator.default.wrap(function _callee31$(_context31) {
1626
+ while (1) switch (_context31.prev = _context31.next) {
1484
1627
  case 0:
1485
1628
  statusPayload = {
1486
1629
  statusCode: 503,
@@ -1501,7 +1644,7 @@ describe('State Machine handler tests', function () {
1501
1644
  }
1502
1645
  };
1503
1646
  call['connected'] = false;
1504
- _context27.next = 8;
1647
+ _context31.next = 8;
1505
1648
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1506
1649
  case 8:
1507
1650
  jest.advanceTimersByTime(1005);
@@ -1513,14 +1656,14 @@ describe('State Machine handler tests', function () {
1513
1656
  expect(stateMachineSpy).not.toBeCalled();
1514
1657
  case 13:
1515
1658
  case "end":
1516
- return _context27.stop();
1659
+ return _context31.stop();
1517
1660
  }
1518
- }, _callee27);
1661
+ }, _callee31);
1519
1662
  })));
1520
- it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1663
+ it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1521
1664
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1522
- return _regenerator.default.wrap(function _callee28$(_context28) {
1523
- while (1) switch (_context28.prev = _context28.next) {
1665
+ return _regenerator.default.wrap(function _callee32$(_context32) {
1666
+ while (1) switch (_context32.prev = _context32.next) {
1524
1667
  case 0:
1525
1668
  statusPayload = {
1526
1669
  statusCode: 200,
@@ -1545,14 +1688,14 @@ describe('State Machine handler tests', function () {
1545
1688
  expect(stateMachineSpy).not.toHaveBeenCalled();
1546
1689
  case 11:
1547
1690
  case "end":
1548
- return _context28.stop();
1691
+ return _context32.stop();
1549
1692
  }
1550
- }, _callee28);
1693
+ }, _callee32);
1551
1694
  })));
1552
- it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1695
+ it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1553
1696
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1554
- return _regenerator.default.wrap(function _callee29$(_context29) {
1555
- while (1) switch (_context29.prev = _context29.next) {
1697
+ return _regenerator.default.wrap(function _callee33$(_context33) {
1698
+ while (1) switch (_context33.prev = _context33.next) {
1556
1699
  case 0:
1557
1700
  statusPayload = {
1558
1701
  statusCode: 503,
@@ -1574,7 +1717,7 @@ describe('State Machine handler tests', function () {
1574
1717
  };
1575
1718
  call['connected'] = true;
1576
1719
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1577
- _context29.next = 9;
1720
+ _context33.next = 9;
1578
1721
  return call['handleRoapEstablished']({}, dummyEvent);
1579
1722
  case 9:
1580
1723
  jest.advanceTimersByTime(1005);
@@ -1586,14 +1729,14 @@ describe('State Machine handler tests', function () {
1586
1729
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1587
1730
  case 14:
1588
1731
  case "end":
1589
- return _context29.stop();
1732
+ return _context33.stop();
1590
1733
  }
1591
- }, _callee29);
1734
+ }, _callee33);
1592
1735
  })));
1593
- it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1736
+ it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1594
1737
  var statusPayload, stateMachineSpy, funcSpy, errorEvent;
1595
- return _regenerator.default.wrap(function _callee30$(_context30) {
1596
- while (1) switch (_context30.prev = _context30.next) {
1738
+ return _regenerator.default.wrap(function _callee34$(_context34) {
1739
+ while (1) switch (_context34.prev = _context34.next) {
1597
1740
  case 0:
1598
1741
  statusPayload = {
1599
1742
  statusCode: 403,
@@ -1616,14 +1759,14 @@ describe('State Machine handler tests', function () {
1616
1759
  expect(stateMachineSpy).not.toHaveBeenCalled();
1617
1760
  case 9:
1618
1761
  case "end":
1619
- return _context30.stop();
1762
+ return _context34.stop();
1620
1763
  }
1621
- }, _callee30);
1764
+ }, _callee34);
1622
1765
  })));
1623
- it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1766
+ it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1624
1767
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1625
- return _regenerator.default.wrap(function _callee31$(_context31) {
1626
- while (1) switch (_context31.prev = _context31.next) {
1768
+ return _regenerator.default.wrap(function _callee35$(_context35) {
1769
+ while (1) switch (_context35.prev = _context35.next) {
1627
1770
  case 0:
1628
1771
  statusPayload = {
1629
1772
  statusCode: 200,
@@ -1641,7 +1784,7 @@ describe('State Machine handler tests', function () {
1641
1784
  }
1642
1785
  };
1643
1786
  call['connected'] = false;
1644
- _context31.next = 8;
1787
+ _context35.next = 8;
1645
1788
  return call['handleRoapError']({}, errorEvent);
1646
1789
  case 8:
1647
1790
  expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
@@ -1657,14 +1800,14 @@ describe('State Machine handler tests', function () {
1657
1800
  });
1658
1801
  case 11:
1659
1802
  case "end":
1660
- return _context31.stop();
1803
+ return _context35.stop();
1661
1804
  }
1662
- }, _callee31);
1805
+ }, _callee35);
1663
1806
  })));
1664
- it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1807
+ it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1665
1808
  var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
1666
- return _regenerator.default.wrap(function _callee32$(_context32) {
1667
- while (1) switch (_context32.prev = _context32.next) {
1809
+ return _regenerator.default.wrap(function _callee36$(_context36) {
1810
+ while (1) switch (_context36.prev = _context36.next) {
1668
1811
  case 0:
1669
1812
  statusPayload = {
1670
1813
  statusCode: 403,
@@ -1702,10 +1845,10 @@ describe('State Machine handler tests', function () {
1702
1845
  messageType: 'ANSWER'
1703
1846
  }
1704
1847
  };
1705
- _context32.next = 15;
1848
+ _context36.next = 15;
1706
1849
  return call.sendMediaStateMachineEvt(answerEvent);
1707
1850
  case 15:
1708
- _context32.next = 17;
1851
+ _context36.next = 17;
1709
1852
  return (0, _testUtil.flushPromises)(2);
1710
1853
  case 17:
1711
1854
  expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
@@ -1723,14 +1866,14 @@ describe('State Machine handler tests', function () {
1723
1866
  expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
1724
1867
  case 22:
1725
1868
  case "end":
1726
- return _context32.stop();
1869
+ return _context36.stop();
1727
1870
  }
1728
- }, _callee32);
1871
+ }, _callee36);
1729
1872
  })));
1730
- it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1873
+ it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
1731
1874
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1732
- return _regenerator.default.wrap(function _callee33$(_context33) {
1733
- while (1) switch (_context33.prev = _context33.next) {
1875
+ return _regenerator.default.wrap(function _callee37$(_context37) {
1876
+ while (1) switch (_context37.prev = _context37.next) {
1734
1877
  case 0:
1735
1878
  statusPayload = {
1736
1879
  statusCode: 200,
@@ -1763,7 +1906,7 @@ describe('State Machine handler tests', function () {
1763
1906
  seq: 1,
1764
1907
  messageType: 'ANSWER'
1765
1908
  };
1766
- _context33.next = 17;
1909
+ _context37.next = 17;
1767
1910
  return call.sendMediaStateMachineEvt(dummyEvent);
1768
1911
  case 17:
1769
1912
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1785,7 +1928,7 @@ describe('State Machine handler tests', function () {
1785
1928
  seq: 2,
1786
1929
  messageType: 'OFFER_REQUEST'
1787
1930
  };
1788
- _context33.next = 23;
1931
+ _context37.next = 23;
1789
1932
  return call.sendMediaStateMachineEvt(dummyEvent);
1790
1933
  case 23:
1791
1934
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1835,7 +1978,7 @@ describe('State Machine handler tests', function () {
1835
1978
  };
1836
1979
  call.sendCallStateMachineEvt(dummyEvent);
1837
1980
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
1838
- _context33.next = 49;
1981
+ _context37.next = 49;
1839
1982
  return call.sendMediaStateMachineEvt(dummyEvent);
1840
1983
  case 49:
1841
1984
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1844,7 +1987,7 @@ describe('State Machine handler tests', function () {
1844
1987
  seq: 3,
1845
1988
  messageType: 'ANSWER'
1846
1989
  };
1847
- _context33.next = 54;
1990
+ _context37.next = 54;
1848
1991
  return call.sendMediaStateMachineEvt(dummyEvent);
1849
1992
  case 54:
1850
1993
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1863,7 +2006,7 @@ describe('State Machine handler tests', function () {
1863
2006
  messageType: 'OK'
1864
2007
  }
1865
2008
  };
1866
- _context33.next = 63;
2009
+ _context37.next = 63;
1867
2010
  return call.sendMediaStateMachineEvt(dummyOkEvent);
1868
2011
  case 63:
1869
2012
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
@@ -1878,14 +2021,14 @@ describe('State Machine handler tests', function () {
1878
2021
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
1879
2022
  case 70:
1880
2023
  case "end":
1881
- return _context33.stop();
2024
+ return _context37.stop();
1882
2025
  }
1883
- }, _callee33);
2026
+ }, _callee37);
1884
2027
  })));
1885
- it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
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() {
1886
2029
  var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1887
- return _regenerator.default.wrap(function _callee34$(_context34) {
1888
- while (1) switch (_context34.prev = _context34.next) {
2030
+ return _regenerator.default.wrap(function _callee38$(_context38) {
2031
+ while (1) switch (_context38.prev = _context38.next) {
1889
2032
  case 0:
1890
2033
  mockStatusBody = {
1891
2034
  device: {
@@ -1925,7 +2068,7 @@ describe('State Machine handler tests', function () {
1925
2068
  seq: 1,
1926
2069
  messageType: 'ANSWER'
1927
2070
  };
1928
- _context34.next = 18;
2071
+ _context38.next = 18;
1929
2072
  return call.sendMediaStateMachineEvt(dummyEvent);
1930
2073
  case 18:
1931
2074
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1947,7 +2090,7 @@ describe('State Machine handler tests', function () {
1947
2090
  seq: 2,
1948
2091
  messageType: 'OFFER_REQUEST'
1949
2092
  };
1950
- _context34.next = 24;
2093
+ _context38.next = 24;
1951
2094
  return call.sendMediaStateMachineEvt(dummyEvent);
1952
2095
  case 24:
1953
2096
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1997,7 +2140,7 @@ describe('State Machine handler tests', function () {
1997
2140
  };
1998
2141
  call.sendCallStateMachineEvt(dummyEvent);
1999
2142
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
2000
- _context34.next = 50;
2143
+ _context38.next = 50;
2001
2144
  return call.sendMediaStateMachineEvt(dummyEvent);
2002
2145
  case 50:
2003
2146
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2006,7 +2149,7 @@ describe('State Machine handler tests', function () {
2006
2149
  seq: 3,
2007
2150
  messageType: 'ANSWER'
2008
2151
  };
2009
- _context34.next = 55;
2152
+ _context38.next = 55;
2010
2153
  return call.sendMediaStateMachineEvt(dummyEvent);
2011
2154
  case 55:
2012
2155
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2023,7 +2166,7 @@ describe('State Machine handler tests', function () {
2023
2166
  }
2024
2167
  };
2025
2168
  call.sendMediaStateMachineEvt(dummyEvent);
2026
- _context34.next = 62;
2169
+ _context38.next = 62;
2027
2170
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2028
2171
  case 62:
2029
2172
  expect(call['receivedRoapOKSeq']).toBe(3);
@@ -2039,14 +2182,14 @@ describe('State Machine handler tests', function () {
2039
2182
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2040
2183
  case 70:
2041
2184
  case "end":
2042
- return _context34.stop();
2185
+ return _context38.stop();
2043
2186
  }
2044
- }, _callee34);
2187
+ }, _callee38);
2045
2188
  })));
2046
- it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
2189
+ it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2047
2190
  var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
2048
- return _regenerator.default.wrap(function _callee35$(_context35) {
2049
- while (1) switch (_context35.prev = _context35.next) {
2191
+ return _regenerator.default.wrap(function _callee39$(_context39) {
2192
+ while (1) switch (_context39.prev = _context39.next) {
2050
2193
  case 0:
2051
2194
  statusPayload = {
2052
2195
  statusCode: 200,
@@ -2113,14 +2256,14 @@ describe('State Machine handler tests', function () {
2113
2256
  });
2114
2257
  case 33:
2115
2258
  case "end":
2116
- return _context35.stop();
2259
+ return _context39.stop();
2117
2260
  }
2118
- }, _callee35);
2261
+ }, _callee39);
2119
2262
  })));
2120
- it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
2263
+ it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2121
2264
  var emitSpy, deleteSpy;
2122
- return _regenerator.default.wrap(function _callee36$(_context36) {
2123
- while (1) switch (_context36.prev = _context36.next) {
2265
+ return _regenerator.default.wrap(function _callee40$(_context40) {
2266
+ while (1) switch (_context40.prev = _context40.next) {
2124
2267
  case 0:
2125
2268
  emitSpy = jest.spyOn(call, 'emit');
2126
2269
  deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
@@ -2129,7 +2272,7 @@ describe('State Machine handler tests', function () {
2129
2272
  call.sendCallStateMachineEvt({
2130
2273
  type: 'E_RECV_CALL_DISCONNECT'
2131
2274
  });
2132
- _context36.next = 5;
2275
+ _context40.next = 5;
2133
2276
  return (0, _testUtil.flushPromises)(1);
2134
2277
  case 5:
2135
2278
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
@@ -2137,9 +2280,9 @@ describe('State Machine handler tests', function () {
2137
2280
  expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
2138
2281
  case 8:
2139
2282
  case "end":
2140
- return _context36.stop();
2283
+ return _context40.stop();
2141
2284
  }
2142
- }, _callee36);
2285
+ }, _callee40);
2143
2286
  })));
2144
2287
  describe('Call event timers tests', function () {
2145
2288
  var callManager;
@@ -2150,10 +2293,10 @@ describe('State Machine handler tests', function () {
2150
2293
  afterEach(function () {
2151
2294
  jest.clearAllTimers();
2152
2295
  });
2153
- it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
2296
+ it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2154
2297
  var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
2155
- return _regenerator.default.wrap(function _callee37$(_context37) {
2156
- while (1) switch (_context37.prev = _context37.next) {
2298
+ return _regenerator.default.wrap(function _callee41$(_context41) {
2299
+ while (1) switch (_context41.prev = _context41.next) {
2157
2300
  case 0:
2158
2301
  statusPayload = {
2159
2302
  statusCode: 200,
@@ -2170,7 +2313,7 @@ describe('State Machine handler tests', function () {
2170
2313
  webex.request.mockReturnValue(statusPayload);
2171
2314
 
2172
2315
  // handleOutgoingCallSetup is asynchronous
2173
- _context37.next = 9;
2316
+ _context41.next = 9;
2174
2317
  return call.sendCallStateMachineEvt(dummyEvent);
2175
2318
  case 9:
2176
2319
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2213,14 +2356,14 @@ describe('State Machine handler tests', function () {
2213
2356
  expect(callManager.callCollection).toStrictEqual({});
2214
2357
  case 32:
2215
2358
  case "end":
2216
- return _context37.stop();
2359
+ return _context41.stop();
2217
2360
  }
2218
- }, _callee37);
2361
+ }, _callee41);
2219
2362
  })));
2220
- it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
2363
+ it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
2221
2364
  var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
2222
- return _regenerator.default.wrap(function _callee38$(_context38) {
2223
- while (1) switch (_context38.prev = _context38.next) {
2365
+ return _regenerator.default.wrap(function _callee42$(_context42) {
2366
+ while (1) switch (_context42.prev = _context42.next) {
2224
2367
  case 0:
2225
2368
  statusPayload = {
2226
2369
  statusCode: 200,
@@ -2239,7 +2382,7 @@ describe('State Machine handler tests', function () {
2239
2382
  expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
2240
2383
 
2241
2384
  // handleOutgoingCallSetup is asynchronous
2242
- _context38.next = 11;
2385
+ _context42.next = 11;
2243
2386
  return call.sendCallStateMachineEvt(dummyEvent);
2244
2387
  case 11:
2245
2388
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2251,9 +2394,9 @@ describe('State Machine handler tests', function () {
2251
2394
  expect(callManager.callCollection).toStrictEqual({});
2252
2395
  case 18:
2253
2396
  case "end":
2254
- return _context38.stop();
2397
+ return _context42.stop();
2255
2398
  }
2256
- }, _callee38);
2399
+ }, _callee42);
2257
2400
  })));
2258
2401
  });
2259
2402
  });
@@ -2313,10 +2456,10 @@ describe('Supplementary Services tests', function () {
2313
2456
  beforeEach(function () {
2314
2457
  call.removeAllListeners();
2315
2458
  });
2316
- it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2459
+ it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
2317
2460
  var responsePayload, warnSpy, roapEvent;
2318
- return _regenerator.default.wrap(function _callee40$(_context40) {
2319
- while (1) switch (_context40.prev = _context40.next) {
2461
+ return _regenerator.default.wrap(function _callee44$(_context44) {
2462
+ while (1) switch (_context44.prev = _context44.next) {
2320
2463
  case 0:
2321
2464
  expect.assertions(7);
2322
2465
  responsePayload = {
@@ -2329,25 +2472,25 @@ describe('Supplementary Services tests', function () {
2329
2472
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2330
2473
  call['held'] = false;
2331
2474
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2332
- var _ref40 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(correlationId) {
2333
- return _regenerator.default.wrap(function _callee39$(_context39) {
2334
- while (1) switch (_context39.prev = _context39.next) {
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) {
2335
2478
  case 0:
2336
2479
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2337
2480
  case 1:
2338
2481
  case "end":
2339
- return _context39.stop();
2482
+ return _context43.stop();
2340
2483
  }
2341
- }, _callee39);
2484
+ }, _callee43);
2342
2485
  }));
2343
2486
  return function (_x) {
2344
- return _ref40.apply(this, arguments);
2487
+ return _ref44.apply(this, arguments);
2345
2488
  };
2346
2489
  }());
2347
- _context40.next = 10;
2490
+ _context44.next = 10;
2348
2491
  return call.doHoldResume();
2349
2492
  case 10:
2350
- _context40.next = 12;
2493
+ _context44.next = 12;
2351
2494
  return (0, _testUtil.flushPromises)(2);
2352
2495
  case 12:
2353
2496
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2363,11 +2506,11 @@ describe('Supplementary Services tests', function () {
2363
2506
  call['handleIncomingRoapOffer']({}, dummyEvent);
2364
2507
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2365
2508
  roapEvent.data.type = 'ANSWER';
2366
- _context40.next = 20;
2509
+ _context44.next = 20;
2367
2510
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2368
2511
  case 20:
2369
2512
  roapEvent.data.type = 'OK';
2370
- _context40.next = 23;
2513
+ _context44.next = 23;
2371
2514
  return call['handleRoapEstablished']({}, dummyEvent);
2372
2515
  case 23:
2373
2516
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2382,14 +2525,14 @@ describe('Supplementary Services tests', function () {
2382
2525
  });
2383
2526
  case 28:
2384
2527
  case "end":
2385
- return _context40.stop();
2528
+ return _context44.stop();
2386
2529
  }
2387
- }, _callee40);
2530
+ }, _callee44);
2388
2531
  })));
2389
- it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
2532
+ it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
2390
2533
  var responsePayload, warnSpy, roapEvent;
2391
- return _regenerator.default.wrap(function _callee42$(_context42) {
2392
- while (1) switch (_context42.prev = _context42.next) {
2534
+ return _regenerator.default.wrap(function _callee46$(_context46) {
2535
+ while (1) switch (_context46.prev = _context46.next) {
2393
2536
  case 0:
2394
2537
  expect.assertions(8);
2395
2538
  responsePayload = {
@@ -2402,26 +2545,26 @@ describe('Supplementary Services tests', function () {
2402
2545
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2403
2546
  call['held'] = false;
2404
2547
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2405
- var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(correlationId) {
2406
- return _regenerator.default.wrap(function _callee41$(_context41) {
2407
- while (1) switch (_context41.prev = _context41.next) {
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) {
2408
2551
  case 0:
2409
2552
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2410
2553
  case 1:
2411
2554
  case "end":
2412
- return _context41.stop();
2555
+ return _context45.stop();
2413
2556
  }
2414
- }, _callee41);
2557
+ }, _callee45);
2415
2558
  }));
2416
2559
  return function (_x2) {
2417
- return _ref42.apply(this, arguments);
2560
+ return _ref46.apply(this, arguments);
2418
2561
  };
2419
2562
  }());
2420
2563
  call.doHoldResume();
2421
- _context42.next = 11;
2564
+ _context46.next = 11;
2422
2565
  return _promise.default.resolve();
2423
2566
  case 11:
2424
- _context42.next = 13;
2567
+ _context46.next = 13;
2425
2568
  return _promise.default.resolve();
2426
2569
  case 13:
2427
2570
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2437,11 +2580,11 @@ describe('Supplementary Services tests', function () {
2437
2580
  call['handleIncomingRoapOffer']({}, dummyEvent);
2438
2581
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2439
2582
  roapEvent.data.type = 'ANSWER';
2440
- _context42.next = 22;
2583
+ _context46.next = 22;
2441
2584
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2442
2585
  case 22:
2443
2586
  roapEvent.data.type = 'OK';
2444
- _context42.next = 25;
2587
+ _context46.next = 25;
2445
2588
  return call['handleRoapEstablished']({}, dummyEvent);
2446
2589
  case 25:
2447
2590
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2456,14 +2599,14 @@ describe('Supplementary Services tests', function () {
2456
2599
  });
2457
2600
  case 30:
2458
2601
  case "end":
2459
- return _context42.stop();
2602
+ return _context46.stop();
2460
2603
  }
2461
- }, _callee42);
2604
+ }, _callee46);
2462
2605
  })));
2463
- it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
2606
+ it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
2464
2607
  var responsePayload;
2465
- return _regenerator.default.wrap(function _callee44$(_context44) {
2466
- while (1) switch (_context44.prev = _context44.next) {
2608
+ return _regenerator.default.wrap(function _callee48$(_context48) {
2609
+ while (1) switch (_context48.prev = _context48.next) {
2467
2610
  case 0:
2468
2611
  expect.assertions(4);
2469
2612
  responsePayload = {
@@ -2473,26 +2616,26 @@ describe('Supplementary Services tests', function () {
2473
2616
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2474
2617
  call['held'] = false;
2475
2618
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2476
- var _ref44 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(errObj) {
2477
- return _regenerator.default.wrap(function _callee43$(_context43) {
2478
- while (1) switch (_context43.prev = _context43.next) {
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) {
2479
2622
  case 0:
2480
2623
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2481
2624
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2482
2625
  case 2:
2483
2626
  case "end":
2484
- return _context43.stop();
2627
+ return _context47.stop();
2485
2628
  }
2486
- }, _callee43);
2629
+ }, _callee47);
2487
2630
  }));
2488
2631
  return function (_x3) {
2489
- return _ref44.apply(this, arguments);
2632
+ return _ref48.apply(this, arguments);
2490
2633
  };
2491
2634
  }());
2492
- _context44.next = 7;
2635
+ _context48.next = 7;
2493
2636
  return call.doHoldResume();
2494
2637
  case 7:
2495
- _context44.next = 9;
2638
+ _context48.next = 9;
2496
2639
  return (0, _testUtil.flushPromises)(2);
2497
2640
  case 9:
2498
2641
  expect(call.isHeld()).toStrictEqual(false);
@@ -2502,14 +2645,14 @@ describe('Supplementary Services tests', function () {
2502
2645
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2503
2646
  case 11:
2504
2647
  case "end":
2505
- return _context44.stop();
2648
+ return _context48.stop();
2506
2649
  }
2507
- }, _callee44);
2650
+ }, _callee48);
2508
2651
  })));
2509
- it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
2652
+ it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
2510
2653
  var responsePayload, rejectPayload, roapEvent;
2511
- return _regenerator.default.wrap(function _callee46$(_context46) {
2512
- while (1) switch (_context46.prev = _context46.next) {
2654
+ return _regenerator.default.wrap(function _callee50$(_context50) {
2655
+ while (1) switch (_context50.prev = _context50.next) {
2513
2656
  case 0:
2514
2657
  expect.assertions(5);
2515
2658
  responsePayload = {
@@ -2523,24 +2666,24 @@ describe('Supplementary Services tests', function () {
2523
2666
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2524
2667
  call['held'] = false;
2525
2668
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2526
- var _ref46 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(errObj) {
2527
- return _regenerator.default.wrap(function _callee45$(_context45) {
2528
- while (1) switch (_context45.prev = _context45.next) {
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) {
2529
2672
  case 0:
2530
2673
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2531
2674
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2532
2675
  case 2:
2533
2676
  case "end":
2534
- return _context45.stop();
2677
+ return _context49.stop();
2535
2678
  }
2536
- }, _callee45);
2679
+ }, _callee49);
2537
2680
  }));
2538
2681
  return function (_x4) {
2539
- return _ref46.apply(this, arguments);
2682
+ return _ref50.apply(this, arguments);
2540
2683
  };
2541
2684
  }());
2542
2685
  call.doHoldResume();
2543
- _context46.next = 9;
2686
+ _context50.next = 9;
2544
2687
  return (0, _testUtil.flushPromises)(2);
2545
2688
  case 9:
2546
2689
  /* the Call State should transition to S_CALL_ESTABLISHED
@@ -2550,7 +2693,7 @@ describe('Supplementary Services tests', function () {
2550
2693
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2551
2694
  /* We are intentionally failing the ROAP ANSWER */
2552
2695
  roapEvent.data.type = 'ANSWER';
2553
- _context46.next = 15;
2696
+ _context50.next = 15;
2554
2697
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2555
2698
  case 15:
2556
2699
  expect(call.isHeld()).toStrictEqual(false);
@@ -2558,14 +2701,14 @@ describe('Supplementary Services tests', function () {
2558
2701
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2559
2702
  case 17:
2560
2703
  case "end":
2561
- return _context46.stop();
2704
+ return _context50.stop();
2562
2705
  }
2563
- }, _callee46);
2706
+ }, _callee50);
2564
2707
  })));
2565
- it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
2708
+ it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
2566
2709
  var responsePayload, warnSpy, roapEvent;
2567
- return _regenerator.default.wrap(function _callee47$(_context47) {
2568
- while (1) switch (_context47.prev = _context47.next) {
2710
+ return _regenerator.default.wrap(function _callee51$(_context51) {
2711
+ while (1) switch (_context51.prev = _context51.next) {
2569
2712
  case 0:
2570
2713
  responsePayload = {
2571
2714
  statusCode: 200,
@@ -2576,10 +2719,10 @@ describe('Supplementary Services tests', function () {
2576
2719
  jest.spyOn(global, 'clearTimeout');
2577
2720
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2578
2721
  call['held'] = false;
2579
- _context47.next = 8;
2722
+ _context51.next = 8;
2580
2723
  return call.doHoldResume();
2581
2724
  case 8:
2582
- _context47.next = 10;
2725
+ _context51.next = 10;
2583
2726
  return (0, _testUtil.flushPromises)(2);
2584
2727
  case 10:
2585
2728
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2594,19 +2737,19 @@ describe('Supplementary Services tests', function () {
2594
2737
  call['handleIncomingRoapOffer']({}, dummyEvent);
2595
2738
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2596
2739
  roapEvent.data.type = 'ANSWER';
2597
- _context47.next = 17;
2740
+ _context51.next = 17;
2598
2741
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2599
2742
  case 17:
2600
2743
  jest.spyOn(webex, 'request').mockRejectedValue({
2601
2744
  statusCode: 403
2602
2745
  });
2603
2746
  roapEvent.data.type = 'OK';
2604
- _context47.next = 21;
2747
+ _context51.next = 21;
2605
2748
  return call['handleRoapEstablished']({}, dummyEvent);
2606
2749
  case 21:
2607
2750
  /* this is for coverage */
2608
2751
  call['callStateMachine'].state.value = 'S_CALL_HOLD';
2609
- _context47.next = 24;
2752
+ _context51.next = 24;
2610
2753
  return call['handleRoapEstablished']({}, dummyEvent);
2611
2754
  case 24:
2612
2755
  expect(call.isHeld()).toStrictEqual(false);
@@ -2618,14 +2761,14 @@ describe('Supplementary Services tests', function () {
2618
2761
  });
2619
2762
  case 27:
2620
2763
  case "end":
2621
- return _context47.stop();
2764
+ return _context51.stop();
2622
2765
  }
2623
- }, _callee47);
2766
+ }, _callee51);
2624
2767
  })));
2625
- it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
2768
+ it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
2626
2769
  var responsePayload, warnSpy, roapEvent;
2627
- return _regenerator.default.wrap(function _callee48$(_context48) {
2628
- while (1) switch (_context48.prev = _context48.next) {
2770
+ return _regenerator.default.wrap(function _callee52$(_context52) {
2771
+ while (1) switch (_context52.prev = _context52.next) {
2629
2772
  case 0:
2630
2773
  responsePayload = {
2631
2774
  statusCode: 200,
@@ -2636,10 +2779,10 @@ describe('Supplementary Services tests', function () {
2636
2779
  jest.spyOn(global, 'clearTimeout');
2637
2780
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2638
2781
  call['held'] = true;
2639
- _context48.next = 8;
2782
+ _context52.next = 8;
2640
2783
  return call.doHoldResume();
2641
2784
  case 8:
2642
- _context48.next = 10;
2785
+ _context52.next = 10;
2643
2786
  return (0, _testUtil.flushPromises)(2);
2644
2787
  case 10:
2645
2788
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2654,14 +2797,14 @@ describe('Supplementary Services tests', function () {
2654
2797
  call['handleIncomingRoapOffer']({}, dummyEvent);
2655
2798
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2656
2799
  roapEvent.data.type = 'ANSWER';
2657
- _context48.next = 17;
2800
+ _context52.next = 17;
2658
2801
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2659
2802
  case 17:
2660
2803
  jest.spyOn(webex, 'request').mockRejectedValue({
2661
2804
  statusCode: 403
2662
2805
  });
2663
2806
  roapEvent.data.type = 'OK';
2664
- _context48.next = 21;
2807
+ _context52.next = 21;
2665
2808
  return call['handleRoapEstablished']({}, dummyEvent);
2666
2809
  case 21:
2667
2810
  expect(call.isHeld()).toStrictEqual(true);
@@ -2673,14 +2816,14 @@ describe('Supplementary Services tests', function () {
2673
2816
  });
2674
2817
  case 24:
2675
2818
  case "end":
2676
- return _context48.stop();
2819
+ return _context52.stop();
2677
2820
  }
2678
- }, _callee48);
2821
+ }, _callee52);
2679
2822
  })));
2680
- it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
2823
+ it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
2681
2824
  var responsePayload, roapEvent;
2682
- return _regenerator.default.wrap(function _callee50$(_context50) {
2683
- while (1) switch (_context50.prev = _context50.next) {
2825
+ return _regenerator.default.wrap(function _callee54$(_context54) {
2826
+ while (1) switch (_context54.prev = _context54.next) {
2684
2827
  case 0:
2685
2828
  expect.assertions(5);
2686
2829
  responsePayload = {
@@ -2690,25 +2833,25 @@ describe('Supplementary Services tests', function () {
2690
2833
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2691
2834
  call['held'] = false;
2692
2835
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2693
- var _ref50 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
2694
- return _regenerator.default.wrap(function _callee49$(_context49) {
2695
- while (1) switch (_context49.prev = _context49.next) {
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) {
2696
2839
  case 0:
2697
2840
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2698
2841
  expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
2699
2842
  case 2:
2700
2843
  case "end":
2701
- return _context49.stop();
2844
+ return _context53.stop();
2702
2845
  }
2703
- }, _callee49);
2846
+ }, _callee53);
2704
2847
  }));
2705
2848
  return function (_x5) {
2706
- return _ref50.apply(this, arguments);
2849
+ return _ref54.apply(this, arguments);
2707
2850
  };
2708
2851
  }());
2709
2852
  jest.runAllTimers();
2710
2853
  call.doHoldResume();
2711
- _context50.next = 9;
2854
+ _context54.next = 9;
2712
2855
  return (0, _testUtil.flushPromises)(2);
2713
2856
  case 9:
2714
2857
  /* At this point, the Call State should be S_CALL_HOLD
@@ -2721,11 +2864,11 @@ describe('Supplementary Services tests', function () {
2721
2864
  call['handleIncomingRoapOffer']({}, dummyEvent);
2722
2865
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2723
2866
  roapEvent.data.type = 'ANSWER';
2724
- _context50.next = 15;
2867
+ _context54.next = 15;
2725
2868
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2726
2869
  case 15:
2727
2870
  roapEvent.data.type = 'OK';
2728
- _context50.next = 18;
2871
+ _context54.next = 18;
2729
2872
  return call['handleRoapEstablished']({}, dummyEvent);
2730
2873
  case 18:
2731
2874
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2737,14 +2880,14 @@ describe('Supplementary Services tests', function () {
2737
2880
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2738
2881
  case 21:
2739
2882
  case "end":
2740
- return _context50.stop();
2883
+ return _context54.stop();
2741
2884
  }
2742
- }, _callee50);
2885
+ }, _callee54);
2743
2886
  })));
2744
- it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
2887
+ it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
2745
2888
  var responsePayload, warnSpy, roapEvent;
2746
- return _regenerator.default.wrap(function _callee52$(_context52) {
2747
- while (1) switch (_context52.prev = _context52.next) {
2889
+ return _regenerator.default.wrap(function _callee56$(_context56) {
2890
+ while (1) switch (_context56.prev = _context56.next) {
2748
2891
  case 0:
2749
2892
  expect.assertions(7);
2750
2893
  responsePayload = {
@@ -2757,25 +2900,25 @@ describe('Supplementary Services tests', function () {
2757
2900
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2758
2901
  call['held'] = true;
2759
2902
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
2760
- var _ref52 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(correlationId) {
2761
- return _regenerator.default.wrap(function _callee51$(_context51) {
2762
- while (1) switch (_context51.prev = _context51.next) {
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) {
2763
2906
  case 0:
2764
2907
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2765
2908
  case 1:
2766
2909
  case "end":
2767
- return _context51.stop();
2910
+ return _context55.stop();
2768
2911
  }
2769
- }, _callee51);
2912
+ }, _callee55);
2770
2913
  }));
2771
2914
  return function (_x6) {
2772
- return _ref52.apply(this, arguments);
2915
+ return _ref56.apply(this, arguments);
2773
2916
  };
2774
2917
  }());
2775
- _context52.next = 10;
2918
+ _context56.next = 10;
2776
2919
  return call.doHoldResume();
2777
2920
  case 10:
2778
- _context52.next = 12;
2921
+ _context56.next = 12;
2779
2922
  return (0, _testUtil.flushPromises)(2);
2780
2923
  case 12:
2781
2924
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2791,11 +2934,11 @@ describe('Supplementary Services tests', function () {
2791
2934
  call['handleIncomingRoapOffer']({}, dummyEvent);
2792
2935
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2793
2936
  roapEvent.data.type = 'ANSWER';
2794
- _context52.next = 20;
2937
+ _context56.next = 20;
2795
2938
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2796
2939
  case 20:
2797
2940
  roapEvent.data.type = 'OK';
2798
- _context52.next = 23;
2941
+ _context56.next = 23;
2799
2942
  return call['handleRoapEstablished']({}, dummyEvent);
2800
2943
  case 23:
2801
2944
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2810,14 +2953,14 @@ describe('Supplementary Services tests', function () {
2810
2953
  });
2811
2954
  case 28:
2812
2955
  case "end":
2813
- return _context52.stop();
2956
+ return _context56.stop();
2814
2957
  }
2815
- }, _callee52);
2958
+ }, _callee56);
2816
2959
  })));
2817
- it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
2960
+ it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
2818
2961
  var responsePayload, warnSpy, roapEvent;
2819
- return _regenerator.default.wrap(function _callee54$(_context54) {
2820
- while (1) switch (_context54.prev = _context54.next) {
2962
+ return _regenerator.default.wrap(function _callee58$(_context58) {
2963
+ while (1) switch (_context58.prev = _context58.next) {
2821
2964
  case 0:
2822
2965
  expect.assertions(7);
2823
2966
  responsePayload = {
@@ -2830,26 +2973,26 @@ describe('Supplementary Services tests', function () {
2830
2973
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2831
2974
  call['held'] = true;
2832
2975
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
2833
- var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(correlationId) {
2834
- return _regenerator.default.wrap(function _callee53$(_context53) {
2835
- while (1) switch (_context53.prev = _context53.next) {
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) {
2836
2979
  case 0:
2837
2980
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2838
2981
  case 1:
2839
2982
  case "end":
2840
- return _context53.stop();
2983
+ return _context57.stop();
2841
2984
  }
2842
- }, _callee53);
2985
+ }, _callee57);
2843
2986
  }));
2844
2987
  return function (_x7) {
2845
- return _ref54.apply(this, arguments);
2988
+ return _ref58.apply(this, arguments);
2846
2989
  };
2847
2990
  }());
2848
2991
  call.doHoldResume();
2849
- _context54.next = 11;
2992
+ _context58.next = 11;
2850
2993
  return _promise.default.resolve();
2851
2994
  case 11:
2852
- _context54.next = 13;
2995
+ _context58.next = 13;
2853
2996
  return _promise.default.resolve();
2854
2997
  case 13:
2855
2998
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2865,11 +3008,11 @@ describe('Supplementary Services tests', function () {
2865
3008
  call['handleIncomingRoapOffer']({}, dummyEvent);
2866
3009
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2867
3010
  roapEvent.data.type = 'ANSWER';
2868
- _context54.next = 21;
3011
+ _context58.next = 21;
2869
3012
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2870
3013
  case 21:
2871
3014
  roapEvent.data.type = 'OK';
2872
- _context54.next = 24;
3015
+ _context58.next = 24;
2873
3016
  return call['handleRoapEstablished']({}, dummyEvent);
2874
3017
  case 24:
2875
3018
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2884,14 +3027,14 @@ describe('Supplementary Services tests', function () {
2884
3027
  });
2885
3028
  case 29:
2886
3029
  case "end":
2887
- return _context54.stop();
3030
+ return _context58.stop();
2888
3031
  }
2889
- }, _callee54);
3032
+ }, _callee58);
2890
3033
  })));
2891
- it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
3034
+ it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
2892
3035
  var responsePayload;
2893
- return _regenerator.default.wrap(function _callee56$(_context56) {
2894
- while (1) switch (_context56.prev = _context56.next) {
3036
+ return _regenerator.default.wrap(function _callee60$(_context60) {
3037
+ while (1) switch (_context60.prev = _context60.next) {
2895
3038
  case 0:
2896
3039
  expect.assertions(4);
2897
3040
  responsePayload = {
@@ -2901,26 +3044,26 @@ describe('Supplementary Services tests', function () {
2901
3044
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2902
3045
  call['held'] = true;
2903
3046
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
2904
- var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(errObj) {
2905
- return _regenerator.default.wrap(function _callee55$(_context55) {
2906
- while (1) switch (_context55.prev = _context55.next) {
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) {
2907
3050
  case 0:
2908
3051
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2909
3052
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2910
3053
  case 2:
2911
3054
  case "end":
2912
- return _context55.stop();
3055
+ return _context59.stop();
2913
3056
  }
2914
- }, _callee55);
3057
+ }, _callee59);
2915
3058
  }));
2916
3059
  return function (_x8) {
2917
- return _ref56.apply(this, arguments);
3060
+ return _ref60.apply(this, arguments);
2918
3061
  };
2919
3062
  }());
2920
- _context56.next = 7;
3063
+ _context60.next = 7;
2921
3064
  return call.doHoldResume();
2922
3065
  case 7:
2923
- _context56.next = 9;
3066
+ _context60.next = 9;
2924
3067
  return (0, _testUtil.flushPromises)(2);
2925
3068
  case 9:
2926
3069
  expect(call.isHeld()).toStrictEqual(true);
@@ -2931,14 +3074,14 @@ describe('Supplementary Services tests', function () {
2931
3074
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2932
3075
  case 11:
2933
3076
  case "end":
2934
- return _context56.stop();
3077
+ return _context60.stop();
2935
3078
  }
2936
- }, _callee56);
3079
+ }, _callee60);
2937
3080
  })));
2938
- it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
3081
+ it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
2939
3082
  var responsePayload, rejectPayload, roapEvent;
2940
- return _regenerator.default.wrap(function _callee58$(_context58) {
2941
- while (1) switch (_context58.prev = _context58.next) {
3083
+ return _regenerator.default.wrap(function _callee62$(_context62) {
3084
+ while (1) switch (_context62.prev = _context62.next) {
2942
3085
  case 0:
2943
3086
  expect.assertions(5);
2944
3087
  responsePayload = {
@@ -2952,24 +3095,24 @@ describe('Supplementary Services tests', function () {
2952
3095
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2953
3096
  call['held'] = true;
2954
3097
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
2955
- var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(errObj) {
2956
- return _regenerator.default.wrap(function _callee57$(_context57) {
2957
- while (1) switch (_context57.prev = _context57.next) {
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) {
2958
3101
  case 0:
2959
3102
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2960
3103
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2961
3104
  case 2:
2962
3105
  case "end":
2963
- return _context57.stop();
3106
+ return _context61.stop();
2964
3107
  }
2965
- }, _callee57);
3108
+ }, _callee61);
2966
3109
  }));
2967
3110
  return function (_x9) {
2968
- return _ref58.apply(this, arguments);
3111
+ return _ref62.apply(this, arguments);
2969
3112
  };
2970
3113
  }());
2971
3114
  call.doHoldResume();
2972
- _context58.next = 9;
3115
+ _context62.next = 9;
2973
3116
  return (0, _testUtil.flushPromises)(2);
2974
3117
  case 9:
2975
3118
  /* At this point , the Call State should transition to S_CALL_ESTABLISHED
@@ -2980,7 +3123,7 @@ describe('Supplementary Services tests', function () {
2980
3123
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2981
3124
  /* We are intentionally failing the ROAP ANSWER */
2982
3125
  roapEvent.data.type = 'ANSWER';
2983
- _context58.next = 15;
3126
+ _context62.next = 15;
2984
3127
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2985
3128
  case 15:
2986
3129
  expect(call.isHeld()).toStrictEqual(true);
@@ -2988,14 +3131,14 @@ describe('Supplementary Services tests', function () {
2988
3131
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2989
3132
  case 17:
2990
3133
  case "end":
2991
- return _context58.stop();
3134
+ return _context62.stop();
2992
3135
  }
2993
- }, _callee58);
3136
+ }, _callee62);
2994
3137
  })));
2995
- it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
3138
+ it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
2996
3139
  var responsePayload, roapEvent;
2997
- return _regenerator.default.wrap(function _callee60$(_context60) {
2998
- while (1) switch (_context60.prev = _context60.next) {
3140
+ return _regenerator.default.wrap(function _callee64$(_context64) {
3141
+ while (1) switch (_context64.prev = _context64.next) {
2999
3142
  case 0:
3000
3143
  expect.assertions(5);
3001
3144
  responsePayload = {
@@ -3005,24 +3148,24 @@ describe('Supplementary Services tests', function () {
3005
3148
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
3006
3149
  call['held'] = true;
3007
3150
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3008
- var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(errObj) {
3009
- return _regenerator.default.wrap(function _callee59$(_context59) {
3010
- while (1) switch (_context59.prev = _context59.next) {
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) {
3011
3154
  case 0:
3012
3155
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
3013
3156
  expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
3014
3157
  case 2:
3015
3158
  case "end":
3016
- return _context59.stop();
3159
+ return _context63.stop();
3017
3160
  }
3018
- }, _callee59);
3161
+ }, _callee63);
3019
3162
  }));
3020
3163
  return function (_x0) {
3021
- return _ref60.apply(this, arguments);
3164
+ return _ref64.apply(this, arguments);
3022
3165
  };
3023
3166
  }());
3024
3167
  call.doHoldResume();
3025
- _context60.next = 8;
3168
+ _context64.next = 8;
3026
3169
  return (0, _testUtil.flushPromises)(2);
3027
3170
  case 8:
3028
3171
  /* At this point ,the Call State should be S_CALL_RESUME
@@ -3035,11 +3178,11 @@ describe('Supplementary Services tests', function () {
3035
3178
  call['handleIncomingRoapOffer']({}, dummyEvent);
3036
3179
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3037
3180
  roapEvent.data.type = 'ANSWER';
3038
- _context60.next = 14;
3181
+ _context64.next = 14;
3039
3182
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3040
3183
  case 14:
3041
3184
  roapEvent.data.type = 'OK';
3042
- _context60.next = 17;
3185
+ _context64.next = 17;
3043
3186
  return call['handleRoapEstablished']({}, dummyEvent);
3044
3187
  case 17:
3045
3188
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -3049,9 +3192,9 @@ describe('Supplementary Services tests', function () {
3049
3192
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3050
3193
  case 20:
3051
3194
  case "end":
3052
- return _context60.stop();
3195
+ return _context64.stop();
3053
3196
  }
3054
- }, _callee60);
3197
+ }, _callee64);
3055
3198
  })));
3056
3199
  });
3057
3200
  describe('Call transfer tests', function () {
@@ -3084,10 +3227,10 @@ describe('Supplementary Services tests', function () {
3084
3227
  secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
3085
3228
  secondCall['held'] = false;
3086
3229
  });
3087
- it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
3230
+ it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
3088
3231
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3089
- return _regenerator.default.wrap(function _callee63$(_context63) {
3090
- while (1) switch (_context63.prev = _context63.next) {
3232
+ return _regenerator.default.wrap(function _callee67$(_context67) {
3233
+ while (1) switch (_context67.prev = _context67.next) {
3091
3234
  case 0:
3092
3235
  expect.assertions(12); // Updated to match actual assertion count
3093
3236
  responsePayload = {
@@ -3099,41 +3242,41 @@ describe('Supplementary Services tests', function () {
3099
3242
  infoSpy = jest.spyOn(_Logger.default, 'info');
3100
3243
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3101
3244
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3102
- var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
3103
- return _regenerator.default.wrap(function _callee61$(_context61) {
3104
- while (1) switch (_context61.prev = _context61.next) {
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) {
3105
3248
  case 0:
3106
3249
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3107
3250
  case 1:
3108
3251
  case "end":
3109
- return _context61.stop();
3252
+ return _context65.stop();
3110
3253
  }
3111
- }, _callee61);
3254
+ }, _callee65);
3112
3255
  }));
3113
3256
  return function (_x1) {
3114
- return _ref62.apply(this, arguments);
3257
+ return _ref66.apply(this, arguments);
3115
3258
  };
3116
3259
  }());
3117
3260
  secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3118
- var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(correlationId) {
3119
- return _regenerator.default.wrap(function _callee62$(_context62) {
3120
- while (1) switch (_context62.prev = _context62.next) {
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) {
3121
3264
  case 0:
3122
3265
  expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
3123
3266
  case 1:
3124
3267
  case "end":
3125
- return _context62.stop();
3268
+ return _context66.stop();
3126
3269
  }
3127
- }, _callee62);
3270
+ }, _callee66);
3128
3271
  }));
3129
3272
  return function (_x10) {
3130
- return _ref63.apply(this, arguments);
3273
+ return _ref67.apply(this, arguments);
3131
3274
  };
3132
3275
  }());
3133
- _context63.next = 10;
3276
+ _context67.next = 10;
3134
3277
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3135
3278
  case 10:
3136
- _context63.next = 12;
3279
+ _context67.next = 12;
3137
3280
  return (0, _testUtil.flushPromises)(2);
3138
3281
  case 12:
3139
3282
  expect(requestSpy).toBeCalled();
@@ -3156,14 +3299,14 @@ describe('Supplementary Services tests', function () {
3156
3299
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3157
3300
  case 24:
3158
3301
  case "end":
3159
- return _context63.stop();
3302
+ return _context67.stop();
3160
3303
  }
3161
- }, _callee63);
3304
+ }, _callee67);
3162
3305
  })));
3163
- it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
3306
+ it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
3164
3307
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3165
- return _regenerator.default.wrap(function _callee65$(_context65) {
3166
- while (1) switch (_context65.prev = _context65.next) {
3308
+ return _regenerator.default.wrap(function _callee69$(_context69) {
3309
+ while (1) switch (_context69.prev = _context69.next) {
3167
3310
  case 0:
3168
3311
  expect.assertions(10); // Updated to match actual assertion count
3169
3312
  responsePayload = {
@@ -3175,25 +3318,25 @@ describe('Supplementary Services tests', function () {
3175
3318
  infoSpy = jest.spyOn(_Logger.default, 'info');
3176
3319
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3177
3320
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3178
- var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(correlationId) {
3179
- return _regenerator.default.wrap(function _callee64$(_context64) {
3180
- while (1) switch (_context64.prev = _context64.next) {
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) {
3181
3324
  case 0:
3182
3325
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3183
3326
  case 1:
3184
3327
  case "end":
3185
- return _context64.stop();
3328
+ return _context68.stop();
3186
3329
  }
3187
- }, _callee64);
3330
+ }, _callee68);
3188
3331
  }));
3189
3332
  return function (_x11) {
3190
- return _ref65.apply(this, arguments);
3333
+ return _ref69.apply(this, arguments);
3191
3334
  };
3192
3335
  }());
3193
- _context65.next = 9;
3336
+ _context69.next = 9;
3194
3337
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3195
3338
  case 9:
3196
- _context65.next = 11;
3339
+ _context69.next = 11;
3197
3340
  return (0, _testUtil.flushPromises)(2);
3198
3341
  case 11:
3199
3342
  expect(requestSpy).toBeCalled();
@@ -3212,14 +3355,14 @@ describe('Supplementary Services tests', function () {
3212
3355
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3213
3356
  case 21:
3214
3357
  case "end":
3215
- return _context65.stop();
3358
+ return _context69.stop();
3216
3359
  }
3217
- }, _callee65);
3360
+ }, _callee69);
3218
3361
  })));
3219
- it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
3362
+ it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
3220
3363
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3221
- return _regenerator.default.wrap(function _callee66$(_context66) {
3222
- while (1) switch (_context66.prev = _context66.next) {
3364
+ return _regenerator.default.wrap(function _callee70$(_context70) {
3365
+ while (1) switch (_context70.prev = _context70.next) {
3223
3366
  case 0:
3224
3367
  responsePayload = {
3225
3368
  statusCode: 403,
@@ -3230,10 +3373,10 @@ describe('Supplementary Services tests', function () {
3230
3373
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3231
3374
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3232
3375
  call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
3233
- _context66.next = 8;
3376
+ _context70.next = 8;
3234
3377
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3235
3378
  case 8:
3236
- _context66.next = 10;
3379
+ _context70.next = 10;
3237
3380
  return (0, _testUtil.flushPromises)(1);
3238
3381
  case 10:
3239
3382
  expect(requestSpy).toBeCalled();
@@ -3254,14 +3397,14 @@ describe('Supplementary Services tests', function () {
3254
3397
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3255
3398
  case 18:
3256
3399
  case "end":
3257
- return _context66.stop();
3400
+ return _context70.stop();
3258
3401
  }
3259
- }, _callee66);
3402
+ }, _callee70);
3260
3403
  })));
3261
- it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
3404
+ it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
3262
3405
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3263
- return _regenerator.default.wrap(function _callee67$(_context67) {
3264
- while (1) switch (_context67.prev = _context67.next) {
3406
+ return _regenerator.default.wrap(function _callee71$(_context71) {
3407
+ while (1) switch (_context71.prev = _context71.next) {
3265
3408
  case 0:
3266
3409
  responsePayload = {
3267
3410
  statusCode: 403,
@@ -3271,10 +3414,10 @@ describe('Supplementary Services tests', function () {
3271
3414
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3272
3415
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3273
3416
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3274
- _context67.next = 7;
3417
+ _context71.next = 7;
3275
3418
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3276
3419
  case 7:
3277
- _context67.next = 9;
3420
+ _context71.next = 9;
3278
3421
  return (0, _testUtil.flushPromises)(2);
3279
3422
  case 9:
3280
3423
  expect(requestSpy).toBeCalled();
@@ -3295,18 +3438,18 @@ describe('Supplementary Services tests', function () {
3295
3438
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3296
3439
  case 18:
3297
3440
  case "end":
3298
- return _context67.stop();
3441
+ return _context71.stop();
3299
3442
  }
3300
- }, _callee67);
3443
+ }, _callee71);
3301
3444
  })));
3302
- it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
3445
+ it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3303
3446
  var requestSpy, warnSpy;
3304
- return _regenerator.default.wrap(function _callee68$(_context68) {
3305
- while (1) switch (_context68.prev = _context68.next) {
3447
+ return _regenerator.default.wrap(function _callee72$(_context72) {
3448
+ while (1) switch (_context72.prev = _context72.next) {
3306
3449
  case 0:
3307
3450
  requestSpy = jest.spyOn(webex, 'request');
3308
3451
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3309
- _context68.next = 4;
3452
+ _context72.next = 4;
3310
3453
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
3311
3454
  case 4:
3312
3455
  /* We should be in CALL_ESTABLISHED state */
@@ -3318,18 +3461,18 @@ describe('Supplementary Services tests', function () {
3318
3461
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3319
3462
  case 10:
3320
3463
  case "end":
3321
- return _context68.stop();
3464
+ return _context72.stop();
3322
3465
  }
3323
- }, _callee68);
3466
+ }, _callee72);
3324
3467
  })));
3325
- it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
3468
+ it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
3326
3469
  var requestSpy, warnSpy;
3327
- return _regenerator.default.wrap(function _callee69$(_context69) {
3328
- while (1) switch (_context69.prev = _context69.next) {
3470
+ return _regenerator.default.wrap(function _callee73$(_context73) {
3471
+ while (1) switch (_context73.prev = _context73.next) {
3329
3472
  case 0:
3330
3473
  requestSpy = jest.spyOn(webex, 'request');
3331
3474
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3332
- _context69.next = 4;
3475
+ _context73.next = 4;
3333
3476
  return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
3334
3477
  case 4:
3335
3478
  /* We should be in CALL_ESTABLISHED state */
@@ -3341,9 +3484,9 @@ describe('Supplementary Services tests', function () {
3341
3484
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3342
3485
  case 10:
3343
3486
  case "end":
3344
- return _context69.stop();
3487
+ return _context73.stop();
3345
3488
  }
3346
- }, _callee69);
3489
+ }, _callee73);
3347
3490
  })));
3348
3491
  });
3349
3492
  });