@webex/calling 3.11.0-webex-services-ready.1 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallHistory/CallHistory.js +68 -51
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +115 -18
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +121 -6
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +9 -8
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +423 -384
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +4 -2
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/registration/register.js +16 -0
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +28 -17
- package/dist/module/CallingClient/CallingClient.js +43 -1
- package/dist/module/CallingClient/calling/call.js +3 -2
- package/dist/module/CallingClient/constants.js +2 -0
- package/dist/module/CallingClient/registration/register.js +8 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +2 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +2 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +2 -1
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +2 -1
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +4 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -12,7 +12,7 @@ var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/n
|
|
|
12
12
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
13
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
14
14
|
var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
15
|
-
var
|
|
15
|
+
var _mediaHelpers = require("@webex/media-helpers");
|
|
16
16
|
var _types = require("../../Errors/types");
|
|
17
17
|
var _Utils = _interopRequireWildcard(require("../../common/Utils"));
|
|
18
18
|
var Utils = _Utils;
|
|
@@ -463,8 +463,8 @@ describe('Call Tests', function () {
|
|
|
463
463
|
bnrMetricSpy.mockClear();
|
|
464
464
|
/* Invoking the callback function to trigger EffectAdded event to simulate adding effect to the stream */
|
|
465
465
|
onStreamSpy.mock.calls[1][1](mockEffect);
|
|
466
|
-
expect(onEffectSpy).toBeCalledWith(
|
|
467
|
-
expect(onEffectSpy).toBeCalledWith(
|
|
466
|
+
expect(onEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Enabled, expect.any(Function));
|
|
467
|
+
expect(onEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
468
468
|
|
|
469
469
|
/* Send Enabled event on the effect, update track and send metrics for BNR disabled */
|
|
470
470
|
onStreamSpy.mock.calls[0][1](mockTrack);
|
|
@@ -494,8 +494,8 @@ describe('Call Tests', function () {
|
|
|
494
494
|
expect(offStreamSpy).toBeCalledTimes(2);
|
|
495
495
|
expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
|
|
496
496
|
expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
497
|
-
expect(offEffectSpy).toBeCalledWith(
|
|
498
|
-
expect(offEffectSpy).toBeCalledWith(
|
|
497
|
+
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Enabled, expect.any(Function));
|
|
498
|
+
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
499
499
|
case 2:
|
|
500
500
|
case "end":
|
|
501
501
|
return _context9.stop();
|
|
@@ -879,7 +879,9 @@ describe('State Machine handler tests', function () {
|
|
|
879
879
|
_context14.next = 2;
|
|
880
880
|
return _promise.default.resolve();
|
|
881
881
|
case 2:
|
|
882
|
-
|
|
882
|
+
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
883
|
+
// and once in handleCallKeepaliveError when clearing timer due to error
|
|
884
|
+
expect(clearInterval).toHaveBeenCalledTimes(2);
|
|
883
885
|
expect(funcSpy).toBeCalledTimes(1);
|
|
884
886
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
885
887
|
case 3:
|
|
@@ -913,7 +915,9 @@ describe('State Machine handler tests', function () {
|
|
|
913
915
|
_context15.next = 1;
|
|
914
916
|
return (0, _testUtil.flushPromises)(2);
|
|
915
917
|
case 1:
|
|
916
|
-
|
|
918
|
+
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
919
|
+
// and once in handleCallKeepaliveError when clearing timer due to error
|
|
920
|
+
expect(clearInterval).toHaveBeenCalledTimes(2);
|
|
917
921
|
expect(funcSpy).toBeCalledTimes(1);
|
|
918
922
|
case 2:
|
|
919
923
|
case "end":
|
|
@@ -960,10 +964,45 @@ describe('State Machine handler tests', function () {
|
|
|
960
964
|
}
|
|
961
965
|
}, _callee16);
|
|
962
966
|
})));
|
|
963
|
-
it('
|
|
964
|
-
var
|
|
967
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
968
|
+
var firstTimer, secondTimer;
|
|
965
969
|
return _regenerator.default.wrap(function (_context17) {
|
|
966
970
|
while (1) switch (_context17.prev = _context17.next) {
|
|
971
|
+
case 0:
|
|
972
|
+
jest.spyOn(global, 'setInterval');
|
|
973
|
+
jest.spyOn(global, 'clearInterval');
|
|
974
|
+
|
|
975
|
+
// Setup the first keepalive interval
|
|
976
|
+
call['handleCallEstablished']({});
|
|
977
|
+
|
|
978
|
+
// At this point, scheduleCallKeepaliveInterval was called once
|
|
979
|
+
// It should have called clearInterval once (at the start) and setInterval once
|
|
980
|
+
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
981
|
+
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
982
|
+
firstTimer = call['sessionTimer'];
|
|
983
|
+
expect(firstTimer).toBeDefined();
|
|
984
|
+
|
|
985
|
+
// Manually call scheduleCallKeepaliveInterval again to simulate a retry scenario
|
|
986
|
+
call['scheduleCallKeepaliveInterval']();
|
|
987
|
+
|
|
988
|
+
// clearInterval should have been called again to clear the previous timer
|
|
989
|
+
expect(clearInterval).toHaveBeenCalledTimes(2);
|
|
990
|
+
// A new interval should have been created
|
|
991
|
+
expect(setInterval).toHaveBeenCalledTimes(2);
|
|
992
|
+
|
|
993
|
+
// The sessionTimer should be different (new timer)
|
|
994
|
+
secondTimer = call['sessionTimer'];
|
|
995
|
+
expect(secondTimer).toBeDefined();
|
|
996
|
+
case 1:
|
|
997
|
+
case "end":
|
|
998
|
+
return _context17.stop();
|
|
999
|
+
}
|
|
1000
|
+
}, _callee17);
|
|
1001
|
+
})));
|
|
1002
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
1003
|
+
var errorPayload, warnSpy, postStatusSpy;
|
|
1004
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1005
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
967
1006
|
case 0:
|
|
968
1007
|
errorPayload = {
|
|
969
1008
|
statusCode: 500,
|
|
@@ -982,25 +1021,25 @@ describe('State Machine handler tests', function () {
|
|
|
982
1021
|
|
|
983
1022
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
984
1023
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
985
|
-
|
|
1024
|
+
_context18.next = 1;
|
|
986
1025
|
return (0, _testUtil.flushPromises)(2);
|
|
987
1026
|
case 1:
|
|
988
1027
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
989
1028
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
990
1029
|
jest.advanceTimersByTime(1000);
|
|
991
|
-
|
|
1030
|
+
_context18.next = 2;
|
|
992
1031
|
return (0, _testUtil.flushPromises)(2);
|
|
993
1032
|
case 2:
|
|
994
1033
|
jest.advanceTimersByTime(1000);
|
|
995
|
-
|
|
1034
|
+
_context18.next = 3;
|
|
996
1035
|
return (0, _testUtil.flushPromises)(2);
|
|
997
1036
|
case 3:
|
|
998
1037
|
jest.advanceTimersByTime(1000);
|
|
999
|
-
|
|
1038
|
+
_context18.next = 4;
|
|
1000
1039
|
return (0, _testUtil.flushPromises)(2);
|
|
1001
1040
|
case 4:
|
|
1002
1041
|
jest.advanceTimersByTime(1000);
|
|
1003
|
-
|
|
1042
|
+
_context18.next = 5;
|
|
1004
1043
|
return (0, _testUtil.flushPromises)(2);
|
|
1005
1044
|
case 5:
|
|
1006
1045
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1012,14 +1051,14 @@ describe('State Machine handler tests', function () {
|
|
|
1012
1051
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1013
1052
|
case 6:
|
|
1014
1053
|
case "end":
|
|
1015
|
-
return
|
|
1054
|
+
return _context18.stop();
|
|
1016
1055
|
}
|
|
1017
|
-
},
|
|
1056
|
+
}, _callee18);
|
|
1018
1057
|
})));
|
|
1019
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1058
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1020
1059
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1021
|
-
return _regenerator.default.wrap(function (
|
|
1022
|
-
while (1) switch (
|
|
1060
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1061
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1023
1062
|
case 0:
|
|
1024
1063
|
statusPayload = {
|
|
1025
1064
|
statusCode: 200,
|
|
@@ -1075,14 +1114,14 @@ describe('State Machine handler tests', function () {
|
|
|
1075
1114
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1076
1115
|
case 1:
|
|
1077
1116
|
case "end":
|
|
1078
|
-
return
|
|
1117
|
+
return _context19.stop();
|
|
1079
1118
|
}
|
|
1080
|
-
},
|
|
1119
|
+
}, _callee19);
|
|
1081
1120
|
})));
|
|
1082
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1121
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1083
1122
|
var statusPayload, dummyEvent;
|
|
1084
|
-
return _regenerator.default.wrap(function (
|
|
1085
|
-
while (1) switch (
|
|
1123
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1124
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1086
1125
|
case 0:
|
|
1087
1126
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1088
1127
|
statusPayload = {
|
|
@@ -1100,7 +1139,7 @@ describe('State Machine handler tests', function () {
|
|
|
1100
1139
|
webex.request.mockReturnValue(statusPayload);
|
|
1101
1140
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1102
1141
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1103
|
-
|
|
1142
|
+
_context20.next = 1;
|
|
1104
1143
|
return call['handleOutgoingCallConnect']({
|
|
1105
1144
|
type: 'E_SEND_CALL_CONNECT'
|
|
1106
1145
|
});
|
|
@@ -1114,14 +1153,14 @@ describe('State Machine handler tests', function () {
|
|
|
1114
1153
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1115
1154
|
case 2:
|
|
1116
1155
|
case "end":
|
|
1117
|
-
return
|
|
1156
|
+
return _context20.stop();
|
|
1118
1157
|
}
|
|
1119
|
-
},
|
|
1158
|
+
}, _callee20);
|
|
1120
1159
|
})));
|
|
1121
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1160
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1122
1161
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1123
|
-
return _regenerator.default.wrap(function (
|
|
1124
|
-
while (1) switch (
|
|
1162
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1163
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1125
1164
|
case 0:
|
|
1126
1165
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1127
1166
|
statusPayload = {
|
|
@@ -1215,14 +1254,14 @@ describe('State Machine handler tests', function () {
|
|
|
1215
1254
|
expect(call.earlyMedia).not.toBe(true);
|
|
1216
1255
|
case 1:
|
|
1217
1256
|
case "end":
|
|
1218
|
-
return
|
|
1257
|
+
return _context21.stop();
|
|
1219
1258
|
}
|
|
1220
|
-
},
|
|
1259
|
+
}, _callee21);
|
|
1221
1260
|
})));
|
|
1222
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1261
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1223
1262
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1224
|
-
return _regenerator.default.wrap(function (
|
|
1225
|
-
while (1) switch (
|
|
1263
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1264
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1226
1265
|
case 0:
|
|
1227
1266
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1228
1267
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1249,7 +1288,7 @@ describe('State Machine handler tests', function () {
|
|
|
1249
1288
|
webex.request.mockRejectedValueOnce({
|
|
1250
1289
|
statusCode: 403
|
|
1251
1290
|
}).mockResolvedValue(statusPayload);
|
|
1252
|
-
|
|
1291
|
+
_context22.next = 1;
|
|
1253
1292
|
return call['handleOutgoingCallConnect']({
|
|
1254
1293
|
type: 'E_SEND_CALL_CONNECT'
|
|
1255
1294
|
});
|
|
@@ -1260,14 +1299,14 @@ describe('State Machine handler tests', function () {
|
|
|
1260
1299
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1261
1300
|
case 2:
|
|
1262
1301
|
case "end":
|
|
1263
|
-
return
|
|
1302
|
+
return _context22.stop();
|
|
1264
1303
|
}
|
|
1265
|
-
},
|
|
1304
|
+
}, _callee22);
|
|
1266
1305
|
})));
|
|
1267
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1306
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1268
1307
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1269
|
-
return _regenerator.default.wrap(function (
|
|
1270
|
-
while (1) switch (
|
|
1308
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1309
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1271
1310
|
case 0:
|
|
1272
1311
|
statusPayload = {
|
|
1273
1312
|
statusCode: 200,
|
|
@@ -1343,14 +1382,14 @@ describe('State Machine handler tests', function () {
|
|
|
1343
1382
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1344
1383
|
case 1:
|
|
1345
1384
|
case "end":
|
|
1346
|
-
return
|
|
1385
|
+
return _context23.stop();
|
|
1347
1386
|
}
|
|
1348
|
-
},
|
|
1387
|
+
}, _callee23);
|
|
1349
1388
|
})));
|
|
1350
|
-
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
|
|
1389
|
+
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 _callee24() {
|
|
1351
1390
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1352
|
-
return _regenerator.default.wrap(function (
|
|
1353
|
-
while (1) switch (
|
|
1391
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1392
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1354
1393
|
case 0:
|
|
1355
1394
|
statusPayload = {
|
|
1356
1395
|
statusCode: 200,
|
|
@@ -1418,14 +1457,14 @@ describe('State Machine handler tests', function () {
|
|
|
1418
1457
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1419
1458
|
case 1:
|
|
1420
1459
|
case "end":
|
|
1421
|
-
return
|
|
1460
|
+
return _context24.stop();
|
|
1422
1461
|
}
|
|
1423
|
-
},
|
|
1462
|
+
}, _callee24);
|
|
1424
1463
|
})));
|
|
1425
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1464
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1426
1465
|
var statusPayload, dummyEvent;
|
|
1427
|
-
return _regenerator.default.wrap(function (
|
|
1428
|
-
while (1) switch (
|
|
1466
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1467
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1429
1468
|
case 0:
|
|
1430
1469
|
statusPayload = {
|
|
1431
1470
|
statusCode: 200,
|
|
@@ -1464,14 +1503,14 @@ describe('State Machine handler tests', function () {
|
|
|
1464
1503
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1465
1504
|
case 1:
|
|
1466
1505
|
case "end":
|
|
1467
|
-
return
|
|
1506
|
+
return _context25.stop();
|
|
1468
1507
|
}
|
|
1469
|
-
},
|
|
1508
|
+
}, _callee25);
|
|
1470
1509
|
})));
|
|
1471
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1510
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1472
1511
|
var statusPayload, dummyEvent, errorSpy;
|
|
1473
|
-
return _regenerator.default.wrap(function (
|
|
1474
|
-
while (1) switch (
|
|
1512
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1513
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1475
1514
|
case 0:
|
|
1476
1515
|
statusPayload = {
|
|
1477
1516
|
statusCode: 403,
|
|
@@ -1488,7 +1527,7 @@ describe('State Machine handler tests', function () {
|
|
|
1488
1527
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1489
1528
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1490
1529
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1491
|
-
|
|
1530
|
+
_context26.next = 1;
|
|
1492
1531
|
return (0, _testUtil.flushPromises)(3);
|
|
1493
1532
|
case 1:
|
|
1494
1533
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
@@ -1499,14 +1538,14 @@ describe('State Machine handler tests', function () {
|
|
|
1499
1538
|
});
|
|
1500
1539
|
case 2:
|
|
1501
1540
|
case "end":
|
|
1502
|
-
return
|
|
1541
|
+
return _context26.stop();
|
|
1503
1542
|
}
|
|
1504
|
-
},
|
|
1543
|
+
}, _callee26);
|
|
1505
1544
|
})));
|
|
1506
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1545
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1507
1546
|
var statusPayload, dummyEvent, warnSpy;
|
|
1508
|
-
return _regenerator.default.wrap(function (
|
|
1509
|
-
while (1) switch (
|
|
1547
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1548
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1510
1549
|
case 0:
|
|
1511
1550
|
statusPayload = {
|
|
1512
1551
|
statusCode: 403,
|
|
@@ -1525,10 +1564,10 @@ describe('State Machine handler tests', function () {
|
|
|
1525
1564
|
webex.request.mockRejectedValue(statusPayload);
|
|
1526
1565
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1527
1566
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1528
|
-
|
|
1567
|
+
_context27.next = 1;
|
|
1529
1568
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1530
1569
|
case 1:
|
|
1531
|
-
|
|
1570
|
+
_context27.next = 2;
|
|
1532
1571
|
return (0, _testUtil.flushPromises)(2);
|
|
1533
1572
|
case 2:
|
|
1534
1573
|
expect(call.isConnected()).toBe(false);
|
|
@@ -1544,14 +1583,14 @@ describe('State Machine handler tests', function () {
|
|
|
1544
1583
|
});
|
|
1545
1584
|
case 3:
|
|
1546
1585
|
case "end":
|
|
1547
|
-
return
|
|
1586
|
+
return _context27.stop();
|
|
1548
1587
|
}
|
|
1549
|
-
},
|
|
1588
|
+
}, _callee27);
|
|
1550
1589
|
})));
|
|
1551
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1590
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1552
1591
|
var statusPayload, dummyEvent;
|
|
1553
|
-
return _regenerator.default.wrap(function (
|
|
1554
|
-
while (1) switch (
|
|
1592
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1593
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1555
1594
|
case 0:
|
|
1556
1595
|
statusPayload = {
|
|
1557
1596
|
statusCode: 403,
|
|
@@ -1574,14 +1613,14 @@ describe('State Machine handler tests', function () {
|
|
|
1574
1613
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1575
1614
|
case 1:
|
|
1576
1615
|
case "end":
|
|
1577
|
-
return
|
|
1616
|
+
return _context28.stop();
|
|
1578
1617
|
}
|
|
1579
|
-
},
|
|
1618
|
+
}, _callee28);
|
|
1580
1619
|
})));
|
|
1581
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1620
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1582
1621
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1583
|
-
return _regenerator.default.wrap(function (
|
|
1584
|
-
while (1) switch (
|
|
1622
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1623
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1585
1624
|
case 0:
|
|
1586
1625
|
statusPayload = {
|
|
1587
1626
|
statusCode: 503,
|
|
@@ -1603,7 +1642,7 @@ describe('State Machine handler tests', function () {
|
|
|
1603
1642
|
}
|
|
1604
1643
|
};
|
|
1605
1644
|
call['connected'] = true;
|
|
1606
|
-
|
|
1645
|
+
_context29.next = 1;
|
|
1607
1646
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1608
1647
|
case 1:
|
|
1609
1648
|
jest.advanceTimersByTime(1005);
|
|
@@ -1615,14 +1654,14 @@ describe('State Machine handler tests', function () {
|
|
|
1615
1654
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1616
1655
|
case 2:
|
|
1617
1656
|
case "end":
|
|
1618
|
-
return
|
|
1657
|
+
return _context29.stop();
|
|
1619
1658
|
}
|
|
1620
|
-
},
|
|
1659
|
+
}, _callee29);
|
|
1621
1660
|
})));
|
|
1622
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1661
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1623
1662
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1624
|
-
return _regenerator.default.wrap(function (
|
|
1625
|
-
while (1) switch (
|
|
1663
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1664
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1626
1665
|
case 0:
|
|
1627
1666
|
statusPayload = {
|
|
1628
1667
|
statusCode: 503,
|
|
@@ -1644,7 +1683,7 @@ describe('State Machine handler tests', function () {
|
|
|
1644
1683
|
}
|
|
1645
1684
|
};
|
|
1646
1685
|
call['connected'] = false;
|
|
1647
|
-
|
|
1686
|
+
_context30.next = 1;
|
|
1648
1687
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1649
1688
|
case 1:
|
|
1650
1689
|
jest.advanceTimersByTime(1005);
|
|
@@ -1655,14 +1694,14 @@ describe('State Machine handler tests', function () {
|
|
|
1655
1694
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1656
1695
|
case 2:
|
|
1657
1696
|
case "end":
|
|
1658
|
-
return
|
|
1697
|
+
return _context30.stop();
|
|
1659
1698
|
}
|
|
1660
|
-
},
|
|
1699
|
+
}, _callee30);
|
|
1661
1700
|
})));
|
|
1662
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1701
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1663
1702
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1664
|
-
return _regenerator.default.wrap(function (
|
|
1665
|
-
while (1) switch (
|
|
1703
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1704
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1666
1705
|
case 0:
|
|
1667
1706
|
statusPayload = {
|
|
1668
1707
|
statusCode: 503,
|
|
@@ -1684,7 +1723,7 @@ describe('State Machine handler tests', function () {
|
|
|
1684
1723
|
};
|
|
1685
1724
|
call['connected'] = true;
|
|
1686
1725
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1687
|
-
|
|
1726
|
+
_context31.next = 1;
|
|
1688
1727
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1689
1728
|
case 1:
|
|
1690
1729
|
jest.advanceTimersByTime(1005);
|
|
@@ -1696,14 +1735,14 @@ describe('State Machine handler tests', function () {
|
|
|
1696
1735
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1697
1736
|
case 2:
|
|
1698
1737
|
case "end":
|
|
1699
|
-
return
|
|
1738
|
+
return _context31.stop();
|
|
1700
1739
|
}
|
|
1701
|
-
},
|
|
1740
|
+
}, _callee31);
|
|
1702
1741
|
})));
|
|
1703
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1742
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1704
1743
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1705
|
-
return _regenerator.default.wrap(function (
|
|
1706
|
-
while (1) switch (
|
|
1744
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
1745
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1707
1746
|
case 0:
|
|
1708
1747
|
statusPayload = {
|
|
1709
1748
|
statusCode: 503,
|
|
@@ -1724,7 +1763,7 @@ describe('State Machine handler tests', function () {
|
|
|
1724
1763
|
}
|
|
1725
1764
|
};
|
|
1726
1765
|
call['connected'] = false;
|
|
1727
|
-
|
|
1766
|
+
_context32.next = 1;
|
|
1728
1767
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1729
1768
|
case 1:
|
|
1730
1769
|
jest.advanceTimersByTime(1005);
|
|
@@ -1736,14 +1775,14 @@ describe('State Machine handler tests', function () {
|
|
|
1736
1775
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1737
1776
|
case 2:
|
|
1738
1777
|
case "end":
|
|
1739
|
-
return
|
|
1778
|
+
return _context32.stop();
|
|
1740
1779
|
}
|
|
1741
|
-
},
|
|
1780
|
+
}, _callee32);
|
|
1742
1781
|
})));
|
|
1743
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1782
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1744
1783
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1745
|
-
return _regenerator.default.wrap(function (
|
|
1746
|
-
while (1) switch (
|
|
1784
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
1785
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1747
1786
|
case 0:
|
|
1748
1787
|
statusPayload = {
|
|
1749
1788
|
statusCode: 200,
|
|
@@ -1768,14 +1807,14 @@ describe('State Machine handler tests', function () {
|
|
|
1768
1807
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1769
1808
|
case 1:
|
|
1770
1809
|
case "end":
|
|
1771
|
-
return
|
|
1810
|
+
return _context33.stop();
|
|
1772
1811
|
}
|
|
1773
|
-
},
|
|
1812
|
+
}, _callee33);
|
|
1774
1813
|
})));
|
|
1775
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1814
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1776
1815
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1777
|
-
return _regenerator.default.wrap(function (
|
|
1778
|
-
while (1) switch (
|
|
1816
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
1817
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1779
1818
|
case 0:
|
|
1780
1819
|
statusPayload = {
|
|
1781
1820
|
statusCode: 503,
|
|
@@ -1797,7 +1836,7 @@ describe('State Machine handler tests', function () {
|
|
|
1797
1836
|
};
|
|
1798
1837
|
call['connected'] = true;
|
|
1799
1838
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1800
|
-
|
|
1839
|
+
_context34.next = 1;
|
|
1801
1840
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1802
1841
|
case 1:
|
|
1803
1842
|
jest.advanceTimersByTime(1005);
|
|
@@ -1809,14 +1848,14 @@ describe('State Machine handler tests', function () {
|
|
|
1809
1848
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1810
1849
|
case 2:
|
|
1811
1850
|
case "end":
|
|
1812
|
-
return
|
|
1851
|
+
return _context34.stop();
|
|
1813
1852
|
}
|
|
1814
|
-
},
|
|
1853
|
+
}, _callee34);
|
|
1815
1854
|
})));
|
|
1816
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1855
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1817
1856
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1818
|
-
return _regenerator.default.wrap(function (
|
|
1819
|
-
while (1) switch (
|
|
1857
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
1858
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1820
1859
|
case 0:
|
|
1821
1860
|
statusPayload = {
|
|
1822
1861
|
statusCode: 403,
|
|
@@ -1839,14 +1878,14 @@ describe('State Machine handler tests', function () {
|
|
|
1839
1878
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1840
1879
|
case 1:
|
|
1841
1880
|
case "end":
|
|
1842
|
-
return
|
|
1881
|
+
return _context35.stop();
|
|
1843
1882
|
}
|
|
1844
|
-
},
|
|
1883
|
+
}, _callee35);
|
|
1845
1884
|
})));
|
|
1846
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1885
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1847
1886
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1848
|
-
return _regenerator.default.wrap(function (
|
|
1849
|
-
while (1) switch (
|
|
1887
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
1888
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1850
1889
|
case 0:
|
|
1851
1890
|
statusPayload = {
|
|
1852
1891
|
statusCode: 200,
|
|
@@ -1864,7 +1903,7 @@ describe('State Machine handler tests', function () {
|
|
|
1864
1903
|
}
|
|
1865
1904
|
};
|
|
1866
1905
|
call['connected'] = false;
|
|
1867
|
-
|
|
1906
|
+
_context36.next = 1;
|
|
1868
1907
|
return call['handleRoapError']({}, errorEvent);
|
|
1869
1908
|
case 1:
|
|
1870
1909
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1880,14 +1919,14 @@ describe('State Machine handler tests', function () {
|
|
|
1880
1919
|
});
|
|
1881
1920
|
case 2:
|
|
1882
1921
|
case "end":
|
|
1883
|
-
return
|
|
1922
|
+
return _context36.stop();
|
|
1884
1923
|
}
|
|
1885
|
-
},
|
|
1924
|
+
}, _callee36);
|
|
1886
1925
|
})));
|
|
1887
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1926
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1888
1927
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1889
|
-
return _regenerator.default.wrap(function (
|
|
1890
|
-
while (1) switch (
|
|
1928
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
1929
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1891
1930
|
case 0:
|
|
1892
1931
|
statusPayload = {
|
|
1893
1932
|
statusCode: 403,
|
|
@@ -1925,10 +1964,10 @@ describe('State Machine handler tests', function () {
|
|
|
1925
1964
|
messageType: 'ANSWER'
|
|
1926
1965
|
}
|
|
1927
1966
|
};
|
|
1928
|
-
|
|
1967
|
+
_context37.next = 1;
|
|
1929
1968
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1930
1969
|
case 1:
|
|
1931
|
-
|
|
1970
|
+
_context37.next = 2;
|
|
1932
1971
|
return (0, _testUtil.flushPromises)(2);
|
|
1933
1972
|
case 2:
|
|
1934
1973
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
@@ -1946,14 +1985,14 @@ describe('State Machine handler tests', function () {
|
|
|
1946
1985
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1947
1986
|
case 3:
|
|
1948
1987
|
case "end":
|
|
1949
|
-
return
|
|
1988
|
+
return _context37.stop();
|
|
1950
1989
|
}
|
|
1951
|
-
},
|
|
1990
|
+
}, _callee37);
|
|
1952
1991
|
})));
|
|
1953
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1992
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1954
1993
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1955
|
-
return _regenerator.default.wrap(function (
|
|
1956
|
-
while (1) switch (
|
|
1994
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
1995
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1957
1996
|
case 0:
|
|
1958
1997
|
statusPayload = {
|
|
1959
1998
|
statusCode: 200,
|
|
@@ -1986,7 +2025,7 @@ describe('State Machine handler tests', function () {
|
|
|
1986
2025
|
seq: 1,
|
|
1987
2026
|
messageType: 'ANSWER'
|
|
1988
2027
|
};
|
|
1989
|
-
|
|
2028
|
+
_context38.next = 1;
|
|
1990
2029
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1991
2030
|
case 1:
|
|
1992
2031
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2008,7 +2047,7 @@ describe('State Machine handler tests', function () {
|
|
|
2008
2047
|
seq: 2,
|
|
2009
2048
|
messageType: 'OFFER_REQUEST'
|
|
2010
2049
|
};
|
|
2011
|
-
|
|
2050
|
+
_context38.next = 2;
|
|
2012
2051
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2013
2052
|
case 2:
|
|
2014
2053
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2058,7 +2097,7 @@ describe('State Machine handler tests', function () {
|
|
|
2058
2097
|
};
|
|
2059
2098
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2060
2099
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2061
|
-
|
|
2100
|
+
_context38.next = 3;
|
|
2062
2101
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2063
2102
|
case 3:
|
|
2064
2103
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2067,7 +2106,7 @@ describe('State Machine handler tests', function () {
|
|
|
2067
2106
|
seq: 3,
|
|
2068
2107
|
messageType: 'ANSWER'
|
|
2069
2108
|
};
|
|
2070
|
-
|
|
2109
|
+
_context38.next = 4;
|
|
2071
2110
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2072
2111
|
case 4:
|
|
2073
2112
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2086,7 +2125,7 @@ describe('State Machine handler tests', function () {
|
|
|
2086
2125
|
messageType: 'OK'
|
|
2087
2126
|
}
|
|
2088
2127
|
};
|
|
2089
|
-
|
|
2128
|
+
_context38.next = 5;
|
|
2090
2129
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2091
2130
|
case 5:
|
|
2092
2131
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2101,14 +2140,14 @@ describe('State Machine handler tests', function () {
|
|
|
2101
2140
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2102
2141
|
case 6:
|
|
2103
2142
|
case "end":
|
|
2104
|
-
return
|
|
2143
|
+
return _context38.stop();
|
|
2105
2144
|
}
|
|
2106
|
-
},
|
|
2145
|
+
}, _callee38);
|
|
2107
2146
|
})));
|
|
2108
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2147
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2109
2148
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2110
|
-
return _regenerator.default.wrap(function (
|
|
2111
|
-
while (1) switch (
|
|
2149
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2150
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2112
2151
|
case 0:
|
|
2113
2152
|
mockStatusBody = {
|
|
2114
2153
|
device: {
|
|
@@ -2148,7 +2187,7 @@ describe('State Machine handler tests', function () {
|
|
|
2148
2187
|
seq: 1,
|
|
2149
2188
|
messageType: 'ANSWER'
|
|
2150
2189
|
};
|
|
2151
|
-
|
|
2190
|
+
_context39.next = 1;
|
|
2152
2191
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2153
2192
|
case 1:
|
|
2154
2193
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2170,7 +2209,7 @@ describe('State Machine handler tests', function () {
|
|
|
2170
2209
|
seq: 2,
|
|
2171
2210
|
messageType: 'OFFER_REQUEST'
|
|
2172
2211
|
};
|
|
2173
|
-
|
|
2212
|
+
_context39.next = 2;
|
|
2174
2213
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2175
2214
|
case 2:
|
|
2176
2215
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2220,7 +2259,7 @@ describe('State Machine handler tests', function () {
|
|
|
2220
2259
|
};
|
|
2221
2260
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2222
2261
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2223
|
-
|
|
2262
|
+
_context39.next = 3;
|
|
2224
2263
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2225
2264
|
case 3:
|
|
2226
2265
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2229,7 +2268,7 @@ describe('State Machine handler tests', function () {
|
|
|
2229
2268
|
seq: 3,
|
|
2230
2269
|
messageType: 'ANSWER'
|
|
2231
2270
|
};
|
|
2232
|
-
|
|
2271
|
+
_context39.next = 4;
|
|
2233
2272
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2234
2273
|
case 4:
|
|
2235
2274
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2246,7 +2285,7 @@ describe('State Machine handler tests', function () {
|
|
|
2246
2285
|
}
|
|
2247
2286
|
};
|
|
2248
2287
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2249
|
-
|
|
2288
|
+
_context39.next = 5;
|
|
2250
2289
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2251
2290
|
case 5:
|
|
2252
2291
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2262,14 +2301,14 @@ describe('State Machine handler tests', function () {
|
|
|
2262
2301
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2263
2302
|
case 6:
|
|
2264
2303
|
case "end":
|
|
2265
|
-
return
|
|
2304
|
+
return _context39.stop();
|
|
2266
2305
|
}
|
|
2267
|
-
},
|
|
2306
|
+
}, _callee39);
|
|
2268
2307
|
})));
|
|
2269
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2308
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2270
2309
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2271
|
-
return _regenerator.default.wrap(function (
|
|
2272
|
-
while (1) switch (
|
|
2310
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2311
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2273
2312
|
case 0:
|
|
2274
2313
|
statusPayload = {
|
|
2275
2314
|
statusCode: 200,
|
|
@@ -2336,14 +2375,14 @@ describe('State Machine handler tests', function () {
|
|
|
2336
2375
|
});
|
|
2337
2376
|
case 1:
|
|
2338
2377
|
case "end":
|
|
2339
|
-
return
|
|
2378
|
+
return _context40.stop();
|
|
2340
2379
|
}
|
|
2341
|
-
},
|
|
2380
|
+
}, _callee40);
|
|
2342
2381
|
})));
|
|
2343
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2382
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2344
2383
|
var emitSpy, deleteSpy;
|
|
2345
|
-
return _regenerator.default.wrap(function (
|
|
2346
|
-
while (1) switch (
|
|
2384
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2385
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2347
2386
|
case 0:
|
|
2348
2387
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2349
2388
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2352,7 +2391,7 @@ describe('State Machine handler tests', function () {
|
|
|
2352
2391
|
call.sendCallStateMachineEvt({
|
|
2353
2392
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2354
2393
|
});
|
|
2355
|
-
|
|
2394
|
+
_context41.next = 1;
|
|
2356
2395
|
return (0, _testUtil.flushPromises)(1);
|
|
2357
2396
|
case 1:
|
|
2358
2397
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2360,9 +2399,9 @@ describe('State Machine handler tests', function () {
|
|
|
2360
2399
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2361
2400
|
case 2:
|
|
2362
2401
|
case "end":
|
|
2363
|
-
return
|
|
2402
|
+
return _context41.stop();
|
|
2364
2403
|
}
|
|
2365
|
-
},
|
|
2404
|
+
}, _callee41);
|
|
2366
2405
|
})));
|
|
2367
2406
|
describe('Call event timers tests', function () {
|
|
2368
2407
|
var callManager;
|
|
@@ -2373,10 +2412,10 @@ describe('State Machine handler tests', function () {
|
|
|
2373
2412
|
afterEach(function () {
|
|
2374
2413
|
jest.clearAllTimers();
|
|
2375
2414
|
});
|
|
2376
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2415
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2377
2416
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2378
|
-
return _regenerator.default.wrap(function (
|
|
2379
|
-
while (1) switch (
|
|
2417
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2418
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2380
2419
|
case 0:
|
|
2381
2420
|
statusPayload = {
|
|
2382
2421
|
statusCode: 200,
|
|
@@ -2393,7 +2432,7 @@ describe('State Machine handler tests', function () {
|
|
|
2393
2432
|
webex.request.mockReturnValue(statusPayload);
|
|
2394
2433
|
|
|
2395
2434
|
// handleOutgoingCallSetup is asynchronous
|
|
2396
|
-
|
|
2435
|
+
_context42.next = 1;
|
|
2397
2436
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2398
2437
|
case 1:
|
|
2399
2438
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2436,14 +2475,14 @@ describe('State Machine handler tests', function () {
|
|
|
2436
2475
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2437
2476
|
case 2:
|
|
2438
2477
|
case "end":
|
|
2439
|
-
return
|
|
2478
|
+
return _context42.stop();
|
|
2440
2479
|
}
|
|
2441
|
-
},
|
|
2480
|
+
}, _callee42);
|
|
2442
2481
|
})));
|
|
2443
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2482
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2444
2483
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2445
|
-
return _regenerator.default.wrap(function (
|
|
2446
|
-
while (1) switch (
|
|
2484
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2485
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2447
2486
|
case 0:
|
|
2448
2487
|
statusPayload = {
|
|
2449
2488
|
statusCode: 200,
|
|
@@ -2462,7 +2501,7 @@ describe('State Machine handler tests', function () {
|
|
|
2462
2501
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2463
2502
|
|
|
2464
2503
|
// handleOutgoingCallSetup is asynchronous
|
|
2465
|
-
|
|
2504
|
+
_context43.next = 1;
|
|
2466
2505
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2467
2506
|
case 1:
|
|
2468
2507
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2474,9 +2513,9 @@ describe('State Machine handler tests', function () {
|
|
|
2474
2513
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2475
2514
|
case 2:
|
|
2476
2515
|
case "end":
|
|
2477
|
-
return
|
|
2516
|
+
return _context43.stop();
|
|
2478
2517
|
}
|
|
2479
|
-
},
|
|
2518
|
+
}, _callee43);
|
|
2480
2519
|
})));
|
|
2481
2520
|
});
|
|
2482
2521
|
});
|
|
@@ -2536,10 +2575,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2536
2575
|
beforeEach(function () {
|
|
2537
2576
|
call.removeAllListeners();
|
|
2538
2577
|
});
|
|
2539
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2578
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2540
2579
|
var responsePayload, warnSpy, roapEvent;
|
|
2541
|
-
return _regenerator.default.wrap(function (
|
|
2542
|
-
while (1) switch (
|
|
2580
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2581
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2543
2582
|
case 0:
|
|
2544
2583
|
expect.assertions(7);
|
|
2545
2584
|
responsePayload = {
|
|
@@ -2552,25 +2591,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2552
2591
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2553
2592
|
call['held'] = false;
|
|
2554
2593
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2555
|
-
var
|
|
2556
|
-
return _regenerator.default.wrap(function (
|
|
2557
|
-
while (1) switch (
|
|
2594
|
+
var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(correlationId) {
|
|
2595
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2596
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2558
2597
|
case 0:
|
|
2559
2598
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2560
2599
|
case 1:
|
|
2561
2600
|
case "end":
|
|
2562
|
-
return
|
|
2601
|
+
return _context44.stop();
|
|
2563
2602
|
}
|
|
2564
|
-
},
|
|
2603
|
+
}, _callee44);
|
|
2565
2604
|
}));
|
|
2566
2605
|
return function (_x) {
|
|
2567
|
-
return
|
|
2606
|
+
return _ref45.apply(this, arguments);
|
|
2568
2607
|
};
|
|
2569
2608
|
}());
|
|
2570
|
-
|
|
2609
|
+
_context45.next = 1;
|
|
2571
2610
|
return call.doHoldResume();
|
|
2572
2611
|
case 1:
|
|
2573
|
-
|
|
2612
|
+
_context45.next = 2;
|
|
2574
2613
|
return (0, _testUtil.flushPromises)(2);
|
|
2575
2614
|
case 2:
|
|
2576
2615
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2586,11 +2625,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2586
2625
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2587
2626
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2588
2627
|
roapEvent.data.type = 'ANSWER';
|
|
2589
|
-
|
|
2628
|
+
_context45.next = 3;
|
|
2590
2629
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2591
2630
|
case 3:
|
|
2592
2631
|
roapEvent.data.type = 'OK';
|
|
2593
|
-
|
|
2632
|
+
_context45.next = 4;
|
|
2594
2633
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2595
2634
|
case 4:
|
|
2596
2635
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2605,14 +2644,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2605
2644
|
});
|
|
2606
2645
|
case 5:
|
|
2607
2646
|
case "end":
|
|
2608
|
-
return
|
|
2647
|
+
return _context45.stop();
|
|
2609
2648
|
}
|
|
2610
|
-
},
|
|
2649
|
+
}, _callee45);
|
|
2611
2650
|
})));
|
|
2612
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2651
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2613
2652
|
var responsePayload, warnSpy, roapEvent;
|
|
2614
|
-
return _regenerator.default.wrap(function (
|
|
2615
|
-
while (1) switch (
|
|
2653
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2654
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2616
2655
|
case 0:
|
|
2617
2656
|
expect.assertions(8);
|
|
2618
2657
|
responsePayload = {
|
|
@@ -2625,26 +2664,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2625
2664
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2626
2665
|
call['held'] = false;
|
|
2627
2666
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2628
|
-
var
|
|
2629
|
-
return _regenerator.default.wrap(function (
|
|
2630
|
-
while (1) switch (
|
|
2667
|
+
var _ref47 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(correlationId) {
|
|
2668
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2669
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2631
2670
|
case 0:
|
|
2632
2671
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2633
2672
|
case 1:
|
|
2634
2673
|
case "end":
|
|
2635
|
-
return
|
|
2674
|
+
return _context46.stop();
|
|
2636
2675
|
}
|
|
2637
|
-
},
|
|
2676
|
+
}, _callee46);
|
|
2638
2677
|
}));
|
|
2639
2678
|
return function (_x2) {
|
|
2640
|
-
return
|
|
2679
|
+
return _ref47.apply(this, arguments);
|
|
2641
2680
|
};
|
|
2642
2681
|
}());
|
|
2643
2682
|
call.doHoldResume();
|
|
2644
|
-
|
|
2683
|
+
_context47.next = 1;
|
|
2645
2684
|
return _promise.default.resolve();
|
|
2646
2685
|
case 1:
|
|
2647
|
-
|
|
2686
|
+
_context47.next = 2;
|
|
2648
2687
|
return _promise.default.resolve();
|
|
2649
2688
|
case 2:
|
|
2650
2689
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2660,11 +2699,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2660
2699
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2661
2700
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2662
2701
|
roapEvent.data.type = 'ANSWER';
|
|
2663
|
-
|
|
2702
|
+
_context47.next = 3;
|
|
2664
2703
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2665
2704
|
case 3:
|
|
2666
2705
|
roapEvent.data.type = 'OK';
|
|
2667
|
-
|
|
2706
|
+
_context47.next = 4;
|
|
2668
2707
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2669
2708
|
case 4:
|
|
2670
2709
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2679,14 +2718,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2679
2718
|
});
|
|
2680
2719
|
case 5:
|
|
2681
2720
|
case "end":
|
|
2682
|
-
return
|
|
2721
|
+
return _context47.stop();
|
|
2683
2722
|
}
|
|
2684
|
-
},
|
|
2723
|
+
}, _callee47);
|
|
2685
2724
|
})));
|
|
2686
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2725
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2687
2726
|
var responsePayload;
|
|
2688
|
-
return _regenerator.default.wrap(function (
|
|
2689
|
-
while (1) switch (
|
|
2727
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
2728
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2690
2729
|
case 0:
|
|
2691
2730
|
expect.assertions(4);
|
|
2692
2731
|
responsePayload = {
|
|
@@ -2696,26 +2735,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2696
2735
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2697
2736
|
call['held'] = false;
|
|
2698
2737
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2699
|
-
var
|
|
2700
|
-
return _regenerator.default.wrap(function (
|
|
2701
|
-
while (1) switch (
|
|
2738
|
+
var _ref49 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
|
|
2739
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2740
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2702
2741
|
case 0:
|
|
2703
2742
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2704
2743
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2705
2744
|
case 1:
|
|
2706
2745
|
case "end":
|
|
2707
|
-
return
|
|
2746
|
+
return _context48.stop();
|
|
2708
2747
|
}
|
|
2709
|
-
},
|
|
2748
|
+
}, _callee48);
|
|
2710
2749
|
}));
|
|
2711
2750
|
return function (_x3) {
|
|
2712
|
-
return
|
|
2751
|
+
return _ref49.apply(this, arguments);
|
|
2713
2752
|
};
|
|
2714
2753
|
}());
|
|
2715
|
-
|
|
2754
|
+
_context49.next = 1;
|
|
2716
2755
|
return call.doHoldResume();
|
|
2717
2756
|
case 1:
|
|
2718
|
-
|
|
2757
|
+
_context49.next = 2;
|
|
2719
2758
|
return (0, _testUtil.flushPromises)(2);
|
|
2720
2759
|
case 2:
|
|
2721
2760
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2725,14 +2764,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2725
2764
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2726
2765
|
case 3:
|
|
2727
2766
|
case "end":
|
|
2728
|
-
return
|
|
2767
|
+
return _context49.stop();
|
|
2729
2768
|
}
|
|
2730
|
-
},
|
|
2769
|
+
}, _callee49);
|
|
2731
2770
|
})));
|
|
2732
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2771
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2733
2772
|
var responsePayload, rejectPayload, roapEvent;
|
|
2734
|
-
return _regenerator.default.wrap(function (
|
|
2735
|
-
while (1) switch (
|
|
2773
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
2774
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2736
2775
|
case 0:
|
|
2737
2776
|
expect.assertions(5);
|
|
2738
2777
|
responsePayload = {
|
|
@@ -2746,24 +2785,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2746
2785
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2747
2786
|
call['held'] = false;
|
|
2748
2787
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2749
|
-
var
|
|
2750
|
-
return _regenerator.default.wrap(function (
|
|
2751
|
-
while (1) switch (
|
|
2788
|
+
var _ref51 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(errObj) {
|
|
2789
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
2790
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2752
2791
|
case 0:
|
|
2753
2792
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2754
2793
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2755
2794
|
case 1:
|
|
2756
2795
|
case "end":
|
|
2757
|
-
return
|
|
2796
|
+
return _context50.stop();
|
|
2758
2797
|
}
|
|
2759
|
-
},
|
|
2798
|
+
}, _callee50);
|
|
2760
2799
|
}));
|
|
2761
2800
|
return function (_x4) {
|
|
2762
|
-
return
|
|
2801
|
+
return _ref51.apply(this, arguments);
|
|
2763
2802
|
};
|
|
2764
2803
|
}());
|
|
2765
2804
|
call.doHoldResume();
|
|
2766
|
-
|
|
2805
|
+
_context51.next = 1;
|
|
2767
2806
|
return (0, _testUtil.flushPromises)(2);
|
|
2768
2807
|
case 1:
|
|
2769
2808
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2773,7 +2812,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2773
2812
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2774
2813
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2775
2814
|
roapEvent.data.type = 'ANSWER';
|
|
2776
|
-
|
|
2815
|
+
_context51.next = 2;
|
|
2777
2816
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2778
2817
|
case 2:
|
|
2779
2818
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2781,14 +2820,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2781
2820
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2782
2821
|
case 3:
|
|
2783
2822
|
case "end":
|
|
2784
|
-
return
|
|
2823
|
+
return _context51.stop();
|
|
2785
2824
|
}
|
|
2786
|
-
},
|
|
2825
|
+
}, _callee51);
|
|
2787
2826
|
})));
|
|
2788
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2827
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2789
2828
|
var responsePayload, warnSpy, roapEvent;
|
|
2790
|
-
return _regenerator.default.wrap(function (
|
|
2791
|
-
while (1) switch (
|
|
2829
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
2830
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2792
2831
|
case 0:
|
|
2793
2832
|
responsePayload = {
|
|
2794
2833
|
statusCode: 200,
|
|
@@ -2799,10 +2838,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2799
2838
|
jest.spyOn(global, 'clearTimeout');
|
|
2800
2839
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2801
2840
|
call['held'] = false;
|
|
2802
|
-
|
|
2841
|
+
_context52.next = 1;
|
|
2803
2842
|
return call.doHoldResume();
|
|
2804
2843
|
case 1:
|
|
2805
|
-
|
|
2844
|
+
_context52.next = 2;
|
|
2806
2845
|
return (0, _testUtil.flushPromises)(2);
|
|
2807
2846
|
case 2:
|
|
2808
2847
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2817,19 +2856,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2817
2856
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2818
2857
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2819
2858
|
roapEvent.data.type = 'ANSWER';
|
|
2820
|
-
|
|
2859
|
+
_context52.next = 3;
|
|
2821
2860
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2822
2861
|
case 3:
|
|
2823
2862
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2824
2863
|
statusCode: 403
|
|
2825
2864
|
});
|
|
2826
2865
|
roapEvent.data.type = 'OK';
|
|
2827
|
-
|
|
2866
|
+
_context52.next = 4;
|
|
2828
2867
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2829
2868
|
case 4:
|
|
2830
2869
|
/* this is for coverage */
|
|
2831
2870
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2832
|
-
|
|
2871
|
+
_context52.next = 5;
|
|
2833
2872
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2834
2873
|
case 5:
|
|
2835
2874
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2841,14 +2880,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2841
2880
|
});
|
|
2842
2881
|
case 6:
|
|
2843
2882
|
case "end":
|
|
2844
|
-
return
|
|
2883
|
+
return _context52.stop();
|
|
2845
2884
|
}
|
|
2846
|
-
},
|
|
2885
|
+
}, _callee52);
|
|
2847
2886
|
})));
|
|
2848
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2887
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2849
2888
|
var responsePayload, warnSpy, roapEvent;
|
|
2850
|
-
return _regenerator.default.wrap(function (
|
|
2851
|
-
while (1) switch (
|
|
2889
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
2890
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2852
2891
|
case 0:
|
|
2853
2892
|
responsePayload = {
|
|
2854
2893
|
statusCode: 200,
|
|
@@ -2859,10 +2898,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2859
2898
|
jest.spyOn(global, 'clearTimeout');
|
|
2860
2899
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2861
2900
|
call['held'] = true;
|
|
2862
|
-
|
|
2901
|
+
_context53.next = 1;
|
|
2863
2902
|
return call.doHoldResume();
|
|
2864
2903
|
case 1:
|
|
2865
|
-
|
|
2904
|
+
_context53.next = 2;
|
|
2866
2905
|
return (0, _testUtil.flushPromises)(2);
|
|
2867
2906
|
case 2:
|
|
2868
2907
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2877,14 +2916,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2877
2916
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2878
2917
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2879
2918
|
roapEvent.data.type = 'ANSWER';
|
|
2880
|
-
|
|
2919
|
+
_context53.next = 3;
|
|
2881
2920
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2882
2921
|
case 3:
|
|
2883
2922
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2884
2923
|
statusCode: 403
|
|
2885
2924
|
});
|
|
2886
2925
|
roapEvent.data.type = 'OK';
|
|
2887
|
-
|
|
2926
|
+
_context53.next = 4;
|
|
2888
2927
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2889
2928
|
case 4:
|
|
2890
2929
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2896,14 +2935,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2896
2935
|
});
|
|
2897
2936
|
case 5:
|
|
2898
2937
|
case "end":
|
|
2899
|
-
return
|
|
2938
|
+
return _context53.stop();
|
|
2900
2939
|
}
|
|
2901
|
-
},
|
|
2940
|
+
}, _callee53);
|
|
2902
2941
|
})));
|
|
2903
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2942
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2904
2943
|
var responsePayload, roapEvent;
|
|
2905
|
-
return _regenerator.default.wrap(function (
|
|
2906
|
-
while (1) switch (
|
|
2944
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
2945
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2907
2946
|
case 0:
|
|
2908
2947
|
expect.assertions(5);
|
|
2909
2948
|
responsePayload = {
|
|
@@ -2913,25 +2952,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2913
2952
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2914
2953
|
call['held'] = false;
|
|
2915
2954
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2916
|
-
var
|
|
2917
|
-
return _regenerator.default.wrap(function (
|
|
2918
|
-
while (1) switch (
|
|
2955
|
+
var _ref55 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
|
|
2956
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
2957
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2919
2958
|
case 0:
|
|
2920
2959
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2921
2960
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2922
2961
|
case 1:
|
|
2923
2962
|
case "end":
|
|
2924
|
-
return
|
|
2963
|
+
return _context54.stop();
|
|
2925
2964
|
}
|
|
2926
|
-
},
|
|
2965
|
+
}, _callee54);
|
|
2927
2966
|
}));
|
|
2928
2967
|
return function (_x5) {
|
|
2929
|
-
return
|
|
2968
|
+
return _ref55.apply(this, arguments);
|
|
2930
2969
|
};
|
|
2931
2970
|
}());
|
|
2932
2971
|
jest.runAllTimers();
|
|
2933
2972
|
call.doHoldResume();
|
|
2934
|
-
|
|
2973
|
+
_context55.next = 1;
|
|
2935
2974
|
return (0, _testUtil.flushPromises)(2);
|
|
2936
2975
|
case 1:
|
|
2937
2976
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2944,11 +2983,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2944
2983
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2945
2984
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2946
2985
|
roapEvent.data.type = 'ANSWER';
|
|
2947
|
-
|
|
2986
|
+
_context55.next = 2;
|
|
2948
2987
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2949
2988
|
case 2:
|
|
2950
2989
|
roapEvent.data.type = 'OK';
|
|
2951
|
-
|
|
2990
|
+
_context55.next = 3;
|
|
2952
2991
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2953
2992
|
case 3:
|
|
2954
2993
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2960,14 +2999,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2960
2999
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2961
3000
|
case 4:
|
|
2962
3001
|
case "end":
|
|
2963
|
-
return
|
|
3002
|
+
return _context55.stop();
|
|
2964
3003
|
}
|
|
2965
|
-
},
|
|
3004
|
+
}, _callee55);
|
|
2966
3005
|
})));
|
|
2967
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3006
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2968
3007
|
var responsePayload, warnSpy, roapEvent;
|
|
2969
|
-
return _regenerator.default.wrap(function (
|
|
2970
|
-
while (1) switch (
|
|
3008
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3009
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2971
3010
|
case 0:
|
|
2972
3011
|
expect.assertions(7);
|
|
2973
3012
|
responsePayload = {
|
|
@@ -2980,25 +3019,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2980
3019
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2981
3020
|
call['held'] = true;
|
|
2982
3021
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2983
|
-
var
|
|
2984
|
-
return _regenerator.default.wrap(function (
|
|
2985
|
-
while (1) switch (
|
|
3022
|
+
var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
|
|
3023
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3024
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2986
3025
|
case 0:
|
|
2987
3026
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2988
3027
|
case 1:
|
|
2989
3028
|
case "end":
|
|
2990
|
-
return
|
|
3029
|
+
return _context56.stop();
|
|
2991
3030
|
}
|
|
2992
|
-
},
|
|
3031
|
+
}, _callee56);
|
|
2993
3032
|
}));
|
|
2994
3033
|
return function (_x6) {
|
|
2995
|
-
return
|
|
3034
|
+
return _ref57.apply(this, arguments);
|
|
2996
3035
|
};
|
|
2997
3036
|
}());
|
|
2998
|
-
|
|
3037
|
+
_context57.next = 1;
|
|
2999
3038
|
return call.doHoldResume();
|
|
3000
3039
|
case 1:
|
|
3001
|
-
|
|
3040
|
+
_context57.next = 2;
|
|
3002
3041
|
return (0, _testUtil.flushPromises)(2);
|
|
3003
3042
|
case 2:
|
|
3004
3043
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3014,11 +3053,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3014
3053
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3015
3054
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3016
3055
|
roapEvent.data.type = 'ANSWER';
|
|
3017
|
-
|
|
3056
|
+
_context57.next = 3;
|
|
3018
3057
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3019
3058
|
case 3:
|
|
3020
3059
|
roapEvent.data.type = 'OK';
|
|
3021
|
-
|
|
3060
|
+
_context57.next = 4;
|
|
3022
3061
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3023
3062
|
case 4:
|
|
3024
3063
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3033,14 +3072,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3033
3072
|
});
|
|
3034
3073
|
case 5:
|
|
3035
3074
|
case "end":
|
|
3036
|
-
return
|
|
3075
|
+
return _context57.stop();
|
|
3037
3076
|
}
|
|
3038
|
-
},
|
|
3077
|
+
}, _callee57);
|
|
3039
3078
|
})));
|
|
3040
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3079
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
3041
3080
|
var responsePayload, warnSpy, roapEvent;
|
|
3042
|
-
return _regenerator.default.wrap(function (
|
|
3043
|
-
while (1) switch (
|
|
3081
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3082
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3044
3083
|
case 0:
|
|
3045
3084
|
expect.assertions(7);
|
|
3046
3085
|
responsePayload = {
|
|
@@ -3053,26 +3092,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3053
3092
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3054
3093
|
call['held'] = true;
|
|
3055
3094
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3056
|
-
var
|
|
3057
|
-
return _regenerator.default.wrap(function (
|
|
3058
|
-
while (1) switch (
|
|
3095
|
+
var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(correlationId) {
|
|
3096
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3097
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
3059
3098
|
case 0:
|
|
3060
3099
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3061
3100
|
case 1:
|
|
3062
3101
|
case "end":
|
|
3063
|
-
return
|
|
3102
|
+
return _context58.stop();
|
|
3064
3103
|
}
|
|
3065
|
-
},
|
|
3104
|
+
}, _callee58);
|
|
3066
3105
|
}));
|
|
3067
3106
|
return function (_x7) {
|
|
3068
|
-
return
|
|
3107
|
+
return _ref59.apply(this, arguments);
|
|
3069
3108
|
};
|
|
3070
3109
|
}());
|
|
3071
3110
|
call.doHoldResume();
|
|
3072
|
-
|
|
3111
|
+
_context59.next = 1;
|
|
3073
3112
|
return _promise.default.resolve();
|
|
3074
3113
|
case 1:
|
|
3075
|
-
|
|
3114
|
+
_context59.next = 2;
|
|
3076
3115
|
return _promise.default.resolve();
|
|
3077
3116
|
case 2:
|
|
3078
3117
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3088,11 +3127,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3088
3127
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3089
3128
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3090
3129
|
roapEvent.data.type = 'ANSWER';
|
|
3091
|
-
|
|
3130
|
+
_context59.next = 3;
|
|
3092
3131
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3093
3132
|
case 3:
|
|
3094
3133
|
roapEvent.data.type = 'OK';
|
|
3095
|
-
|
|
3134
|
+
_context59.next = 4;
|
|
3096
3135
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3097
3136
|
case 4:
|
|
3098
3137
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3107,14 +3146,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3107
3146
|
});
|
|
3108
3147
|
case 5:
|
|
3109
3148
|
case "end":
|
|
3110
|
-
return
|
|
3149
|
+
return _context59.stop();
|
|
3111
3150
|
}
|
|
3112
|
-
},
|
|
3151
|
+
}, _callee59);
|
|
3113
3152
|
})));
|
|
3114
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3153
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
3115
3154
|
var responsePayload;
|
|
3116
|
-
return _regenerator.default.wrap(function (
|
|
3117
|
-
while (1) switch (
|
|
3155
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3156
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3118
3157
|
case 0:
|
|
3119
3158
|
expect.assertions(4);
|
|
3120
3159
|
responsePayload = {
|
|
@@ -3124,26 +3163,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3124
3163
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3125
3164
|
call['held'] = true;
|
|
3126
3165
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3127
|
-
var
|
|
3128
|
-
return _regenerator.default.wrap(function (
|
|
3129
|
-
while (1) switch (
|
|
3166
|
+
var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(errObj) {
|
|
3167
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3168
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3130
3169
|
case 0:
|
|
3131
3170
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3132
3171
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3133
3172
|
case 1:
|
|
3134
3173
|
case "end":
|
|
3135
|
-
return
|
|
3174
|
+
return _context60.stop();
|
|
3136
3175
|
}
|
|
3137
|
-
},
|
|
3176
|
+
}, _callee60);
|
|
3138
3177
|
}));
|
|
3139
3178
|
return function (_x8) {
|
|
3140
|
-
return
|
|
3179
|
+
return _ref61.apply(this, arguments);
|
|
3141
3180
|
};
|
|
3142
3181
|
}());
|
|
3143
|
-
|
|
3182
|
+
_context61.next = 1;
|
|
3144
3183
|
return call.doHoldResume();
|
|
3145
3184
|
case 1:
|
|
3146
|
-
|
|
3185
|
+
_context61.next = 2;
|
|
3147
3186
|
return (0, _testUtil.flushPromises)(2);
|
|
3148
3187
|
case 2:
|
|
3149
3188
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3154,14 +3193,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3154
3193
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3155
3194
|
case 3:
|
|
3156
3195
|
case "end":
|
|
3157
|
-
return
|
|
3196
|
+
return _context61.stop();
|
|
3158
3197
|
}
|
|
3159
|
-
},
|
|
3198
|
+
}, _callee61);
|
|
3160
3199
|
})));
|
|
3161
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3200
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
3162
3201
|
var responsePayload, rejectPayload, roapEvent;
|
|
3163
|
-
return _regenerator.default.wrap(function (
|
|
3164
|
-
while (1) switch (
|
|
3202
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3203
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3165
3204
|
case 0:
|
|
3166
3205
|
expect.assertions(5);
|
|
3167
3206
|
responsePayload = {
|
|
@@ -3175,24 +3214,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3175
3214
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3176
3215
|
call['held'] = true;
|
|
3177
3216
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3178
|
-
var
|
|
3179
|
-
return _regenerator.default.wrap(function (
|
|
3180
|
-
while (1) switch (
|
|
3217
|
+
var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
|
|
3218
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3219
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3181
3220
|
case 0:
|
|
3182
3221
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3183
3222
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3184
3223
|
case 1:
|
|
3185
3224
|
case "end":
|
|
3186
|
-
return
|
|
3225
|
+
return _context62.stop();
|
|
3187
3226
|
}
|
|
3188
|
-
},
|
|
3227
|
+
}, _callee62);
|
|
3189
3228
|
}));
|
|
3190
3229
|
return function (_x9) {
|
|
3191
|
-
return
|
|
3230
|
+
return _ref63.apply(this, arguments);
|
|
3192
3231
|
};
|
|
3193
3232
|
}());
|
|
3194
3233
|
call.doHoldResume();
|
|
3195
|
-
|
|
3234
|
+
_context63.next = 1;
|
|
3196
3235
|
return (0, _testUtil.flushPromises)(2);
|
|
3197
3236
|
case 1:
|
|
3198
3237
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3203,7 +3242,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3203
3242
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3204
3243
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3205
3244
|
roapEvent.data.type = 'ANSWER';
|
|
3206
|
-
|
|
3245
|
+
_context63.next = 2;
|
|
3207
3246
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3208
3247
|
case 2:
|
|
3209
3248
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3211,14 +3250,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3211
3250
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3212
3251
|
case 3:
|
|
3213
3252
|
case "end":
|
|
3214
|
-
return
|
|
3253
|
+
return _context63.stop();
|
|
3215
3254
|
}
|
|
3216
|
-
},
|
|
3255
|
+
}, _callee63);
|
|
3217
3256
|
})));
|
|
3218
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3257
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3219
3258
|
var responsePayload, roapEvent;
|
|
3220
|
-
return _regenerator.default.wrap(function (
|
|
3221
|
-
while (1) switch (
|
|
3259
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3260
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3222
3261
|
case 0:
|
|
3223
3262
|
expect.assertions(5);
|
|
3224
3263
|
responsePayload = {
|
|
@@ -3228,24 +3267,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3228
3267
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3229
3268
|
call['held'] = true;
|
|
3230
3269
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3231
|
-
var
|
|
3232
|
-
return _regenerator.default.wrap(function (
|
|
3233
|
-
while (1) switch (
|
|
3270
|
+
var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(errObj) {
|
|
3271
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3272
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3234
3273
|
case 0:
|
|
3235
3274
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3236
3275
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3237
3276
|
case 1:
|
|
3238
3277
|
case "end":
|
|
3239
|
-
return
|
|
3278
|
+
return _context64.stop();
|
|
3240
3279
|
}
|
|
3241
|
-
},
|
|
3280
|
+
}, _callee64);
|
|
3242
3281
|
}));
|
|
3243
3282
|
return function (_x0) {
|
|
3244
|
-
return
|
|
3283
|
+
return _ref65.apply(this, arguments);
|
|
3245
3284
|
};
|
|
3246
3285
|
}());
|
|
3247
3286
|
call.doHoldResume();
|
|
3248
|
-
|
|
3287
|
+
_context65.next = 1;
|
|
3249
3288
|
return (0, _testUtil.flushPromises)(2);
|
|
3250
3289
|
case 1:
|
|
3251
3290
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3258,11 +3297,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3258
3297
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3259
3298
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3260
3299
|
roapEvent.data.type = 'ANSWER';
|
|
3261
|
-
|
|
3300
|
+
_context65.next = 2;
|
|
3262
3301
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3263
3302
|
case 2:
|
|
3264
3303
|
roapEvent.data.type = 'OK';
|
|
3265
|
-
|
|
3304
|
+
_context65.next = 3;
|
|
3266
3305
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3267
3306
|
case 3:
|
|
3268
3307
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3272,9 +3311,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3272
3311
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3273
3312
|
case 4:
|
|
3274
3313
|
case "end":
|
|
3275
|
-
return
|
|
3314
|
+
return _context65.stop();
|
|
3276
3315
|
}
|
|
3277
|
-
},
|
|
3316
|
+
}, _callee65);
|
|
3278
3317
|
})));
|
|
3279
3318
|
});
|
|
3280
3319
|
describe('Call transfer tests', function () {
|
|
@@ -3307,10 +3346,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3307
3346
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3308
3347
|
secondCall['held'] = false;
|
|
3309
3348
|
});
|
|
3310
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3349
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
|
|
3311
3350
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3312
|
-
return _regenerator.default.wrap(function (
|
|
3313
|
-
while (1) switch (
|
|
3351
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3352
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3314
3353
|
case 0:
|
|
3315
3354
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3316
3355
|
responsePayload = {
|
|
@@ -3322,41 +3361,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3322
3361
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3323
3362
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3324
3363
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3325
|
-
var
|
|
3326
|
-
return _regenerator.default.wrap(function (
|
|
3327
|
-
while (1) switch (
|
|
3364
|
+
var _ref67 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(correlationId) {
|
|
3365
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3366
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3328
3367
|
case 0:
|
|
3329
3368
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3330
3369
|
case 1:
|
|
3331
3370
|
case "end":
|
|
3332
|
-
return
|
|
3371
|
+
return _context66.stop();
|
|
3333
3372
|
}
|
|
3334
|
-
},
|
|
3373
|
+
}, _callee66);
|
|
3335
3374
|
}));
|
|
3336
3375
|
return function (_x1) {
|
|
3337
|
-
return
|
|
3376
|
+
return _ref67.apply(this, arguments);
|
|
3338
3377
|
};
|
|
3339
3378
|
}());
|
|
3340
3379
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3341
|
-
var
|
|
3342
|
-
return _regenerator.default.wrap(function (
|
|
3343
|
-
while (1) switch (
|
|
3380
|
+
var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
|
|
3381
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3382
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3344
3383
|
case 0:
|
|
3345
3384
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3346
3385
|
case 1:
|
|
3347
3386
|
case "end":
|
|
3348
|
-
return
|
|
3387
|
+
return _context67.stop();
|
|
3349
3388
|
}
|
|
3350
|
-
},
|
|
3389
|
+
}, _callee67);
|
|
3351
3390
|
}));
|
|
3352
3391
|
return function (_x10) {
|
|
3353
|
-
return
|
|
3392
|
+
return _ref68.apply(this, arguments);
|
|
3354
3393
|
};
|
|
3355
3394
|
}());
|
|
3356
|
-
|
|
3395
|
+
_context68.next = 1;
|
|
3357
3396
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3358
3397
|
case 1:
|
|
3359
|
-
|
|
3398
|
+
_context68.next = 2;
|
|
3360
3399
|
return (0, _testUtil.flushPromises)(2);
|
|
3361
3400
|
case 2:
|
|
3362
3401
|
expect(requestSpy).toBeCalled();
|
|
@@ -3379,14 +3418,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3379
3418
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3380
3419
|
case 3:
|
|
3381
3420
|
case "end":
|
|
3382
|
-
return
|
|
3421
|
+
return _context68.stop();
|
|
3383
3422
|
}
|
|
3384
|
-
},
|
|
3423
|
+
}, _callee68);
|
|
3385
3424
|
})));
|
|
3386
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3425
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
|
|
3387
3426
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3388
|
-
return _regenerator.default.wrap(function (
|
|
3389
|
-
while (1) switch (
|
|
3427
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3428
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3390
3429
|
case 0:
|
|
3391
3430
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3392
3431
|
responsePayload = {
|
|
@@ -3398,25 +3437,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3398
3437
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3399
3438
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3400
3439
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3401
|
-
var
|
|
3402
|
-
return _regenerator.default.wrap(function (
|
|
3403
|
-
while (1) switch (
|
|
3440
|
+
var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
|
|
3441
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3442
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3404
3443
|
case 0:
|
|
3405
3444
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3406
3445
|
case 1:
|
|
3407
3446
|
case "end":
|
|
3408
|
-
return
|
|
3447
|
+
return _context69.stop();
|
|
3409
3448
|
}
|
|
3410
|
-
},
|
|
3449
|
+
}, _callee69);
|
|
3411
3450
|
}));
|
|
3412
3451
|
return function (_x11) {
|
|
3413
|
-
return
|
|
3452
|
+
return _ref70.apply(this, arguments);
|
|
3414
3453
|
};
|
|
3415
3454
|
}());
|
|
3416
|
-
|
|
3455
|
+
_context70.next = 1;
|
|
3417
3456
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3418
3457
|
case 1:
|
|
3419
|
-
|
|
3458
|
+
_context70.next = 2;
|
|
3420
3459
|
return (0, _testUtil.flushPromises)(2);
|
|
3421
3460
|
case 2:
|
|
3422
3461
|
expect(requestSpy).toBeCalled();
|
|
@@ -3435,14 +3474,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3435
3474
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3436
3475
|
case 3:
|
|
3437
3476
|
case "end":
|
|
3438
|
-
return
|
|
3477
|
+
return _context70.stop();
|
|
3439
3478
|
}
|
|
3440
|
-
},
|
|
3479
|
+
}, _callee70);
|
|
3441
3480
|
})));
|
|
3442
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3481
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
|
|
3443
3482
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3444
|
-
return _regenerator.default.wrap(function (
|
|
3445
|
-
while (1) switch (
|
|
3483
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3484
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3446
3485
|
case 0:
|
|
3447
3486
|
responsePayload = {
|
|
3448
3487
|
statusCode: 403,
|
|
@@ -3453,10 +3492,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3453
3492
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3454
3493
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3455
3494
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3456
|
-
|
|
3495
|
+
_context71.next = 1;
|
|
3457
3496
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3458
3497
|
case 1:
|
|
3459
|
-
|
|
3498
|
+
_context71.next = 2;
|
|
3460
3499
|
return (0, _testUtil.flushPromises)(1);
|
|
3461
3500
|
case 2:
|
|
3462
3501
|
expect(requestSpy).toBeCalled();
|
|
@@ -3477,14 +3516,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3477
3516
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3478
3517
|
case 3:
|
|
3479
3518
|
case "end":
|
|
3480
|
-
return
|
|
3519
|
+
return _context71.stop();
|
|
3481
3520
|
}
|
|
3482
|
-
},
|
|
3521
|
+
}, _callee71);
|
|
3483
3522
|
})));
|
|
3484
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3523
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3485
3524
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3486
|
-
return _regenerator.default.wrap(function (
|
|
3487
|
-
while (1) switch (
|
|
3525
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3526
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3488
3527
|
case 0:
|
|
3489
3528
|
responsePayload = {
|
|
3490
3529
|
statusCode: 403,
|
|
@@ -3494,10 +3533,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3494
3533
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3495
3534
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3496
3535
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3497
|
-
|
|
3536
|
+
_context72.next = 1;
|
|
3498
3537
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3499
3538
|
case 1:
|
|
3500
|
-
|
|
3539
|
+
_context72.next = 2;
|
|
3501
3540
|
return (0, _testUtil.flushPromises)(2);
|
|
3502
3541
|
case 2:
|
|
3503
3542
|
expect(requestSpy).toBeCalled();
|
|
@@ -3518,18 +3557,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3518
3557
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3519
3558
|
case 3:
|
|
3520
3559
|
case "end":
|
|
3521
|
-
return
|
|
3560
|
+
return _context72.stop();
|
|
3522
3561
|
}
|
|
3523
|
-
},
|
|
3562
|
+
}, _callee72);
|
|
3524
3563
|
})));
|
|
3525
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3564
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3526
3565
|
var requestSpy, warnSpy;
|
|
3527
|
-
return _regenerator.default.wrap(function (
|
|
3528
|
-
while (1) switch (
|
|
3566
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3567
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3529
3568
|
case 0:
|
|
3530
3569
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3531
3570
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3532
|
-
|
|
3571
|
+
_context73.next = 1;
|
|
3533
3572
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3534
3573
|
case 1:
|
|
3535
3574
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3541,18 +3580,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3541
3580
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3542
3581
|
case 2:
|
|
3543
3582
|
case "end":
|
|
3544
|
-
return
|
|
3583
|
+
return _context73.stop();
|
|
3545
3584
|
}
|
|
3546
|
-
},
|
|
3585
|
+
}, _callee73);
|
|
3547
3586
|
})));
|
|
3548
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3587
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3549
3588
|
var requestSpy, warnSpy;
|
|
3550
|
-
return _regenerator.default.wrap(function (
|
|
3551
|
-
while (1) switch (
|
|
3589
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3590
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3552
3591
|
case 0:
|
|
3553
3592
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3554
3593
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3555
|
-
|
|
3594
|
+
_context74.next = 1;
|
|
3556
3595
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3557
3596
|
case 1:
|
|
3558
3597
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3564,9 +3603,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3564
3603
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3565
3604
|
case 2:
|
|
3566
3605
|
case "end":
|
|
3567
|
-
return
|
|
3606
|
+
return _context74.stop();
|
|
3568
3607
|
}
|
|
3569
|
-
},
|
|
3608
|
+
}, _callee74);
|
|
3570
3609
|
})));
|
|
3571
3610
|
});
|
|
3572
3611
|
});
|