@webex/calling 3.12.0-next.10 → 3.12.0-next.101
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/CallRecording/CallRecording.js +160 -0
- package/dist/CallRecording/CallRecording.js.map +1 -0
- package/dist/CallRecording/CallRecording.test.js +257 -0
- package/dist/CallRecording/CallRecording.test.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js +577 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +652 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +235 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +50 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +137 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/utils.js +42 -0
- package/dist/CallRecording/utils.js.map +1 -0
- package/dist/CallRecording/utils.test.js +97 -0
- package/dist/CallRecording/utils.test.js.map +1 -0
- package/dist/CallingClient/CallingClient.js +469 -233
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +736 -179
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +635 -455
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +874 -484
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +106 -35
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +140 -0
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +5 -0
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +32 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +8 -1
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +62 -10
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +967 -504
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +936 -59
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js +26 -0
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +41 -104
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +39 -153
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js +1 -1
- package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
- package/dist/CallingClient/types.js +7 -0
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/CallingClient/utils/constants.js +58 -0
- package/dist/CallingClient/utils/constants.js.map +1 -0
- package/dist/CallingClient/utils/index.js +63 -0
- package/dist/CallingClient/utils/index.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js +122 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.js.map +1 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js +221 -0
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js.map +1 -0
- package/dist/CallingClient/utils/request.js +435 -0
- package/dist/CallingClient/utils/request.js.map +1 -0
- package/dist/CallingClient/utils/request.test.js +999 -0
- package/dist/CallingClient/utils/request.test.js.map +1 -0
- package/dist/CallingClient/utils/types.js +7 -0
- package/dist/CallingClient/utils/types.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js +70 -0
- package/dist/CallingClient/utils/wsFeatureFlag.js.map +1 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js +139 -0
- package/dist/CallingClient/utils/wsFeatureFlag.test.js.map +1 -0
- package/dist/Contacts/ContactsClient.js +13 -11
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +3 -8
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js +38 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.js +63 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +357 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +19 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/api.js +56 -0
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +198 -68
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +414 -181
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +10 -5
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +171 -40
- package/dist/index.js.map +1 -1
- package/dist/mobius-socket/config.js +24 -0
- package/dist/mobius-socket/config.js.map +1 -0
- package/dist/mobius-socket/errors.js +143 -0
- package/dist/mobius-socket/errors.js.map +1 -0
- package/dist/mobius-socket/errors.test.js +20 -0
- package/dist/mobius-socket/errors.test.js.map +1 -0
- package/dist/mobius-socket/index.js +57 -0
- package/dist/mobius-socket/index.js.map +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js +492 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.js +849 -0
- package/dist/mobius-socket/mobius-socket.js.map +1 -0
- package/dist/mobius-socket/mobius-socket.test.js +1898 -0
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -0
- package/dist/mobius-socket/socket/constants.js +55 -0
- package/dist/mobius-socket/socket/constants.js.map +1 -0
- package/dist/mobius-socket/socket/index.js +15 -0
- package/dist/mobius-socket/socket/index.js.map +1 -0
- package/dist/mobius-socket/socket/socket-base.js +604 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -0
- package/dist/mobius-socket/socket/socket.js +19 -0
- package/dist/mobius-socket/socket/socket.js.map +1 -0
- package/dist/mobius-socket/socket/socket.shim.js +26 -0
- package/dist/mobius-socket/socket/socket.shim.js.map +1 -0
- package/dist/mobius-socket/socket/types.js +7 -0
- package/dist/mobius-socket/socket/types.js.map +1 -0
- package/dist/mobius-socket/socket.test.js +727 -0
- package/dist/mobius-socket/socket.test.js.map +1 -0
- package/dist/mobius-socket/test/mocha-helpers.js +23 -0
- package/dist/mobius-socket/test/mocha-helpers.js.map +1 -0
- package/dist/mobius-socket/test/promise-tick.js +28 -0
- package/dist/mobius-socket/test/promise-tick.js.map +1 -0
- package/dist/mobius-socket/types.js +7 -0
- package/dist/mobius-socket/types.js.map +1 -0
- package/dist/module/CallRecording/CallRecording.js +56 -0
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +257 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +201 -0
- package/dist/module/CallRecording/constants.js +28 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +137 -20
- package/dist/module/CallingClient/calling/call.js +201 -67
- package/dist/module/CallingClient/calling/callManager.js +51 -11
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +27 -0
- package/dist/module/CallingClient/line/index.js +4 -2
- package/dist/module/CallingClient/registration/register.js +294 -67
- package/dist/module/CallingClient/registration/types.js +5 -1
- package/dist/module/CallingClient/registration/webWorker.js +42 -61
- package/dist/module/CallingClient/registration/webWorkerStr.js +47 -82
- package/dist/module/CallingClient/utils/constants.js +36 -0
- package/dist/module/CallingClient/utils/index.js +5 -0
- package/dist/module/CallingClient/utils/mobiusSocketMapper.js +72 -0
- package/dist/module/CallingClient/utils/request.js +211 -0
- package/dist/module/CallingClient/utils/types.js +1 -0
- package/dist/module/CallingClient/utils/wsFeatureFlag.js +41 -0
- package/dist/module/Contacts/ContactsClient.js +1 -1
- package/dist/module/Errors/types.js +2 -0
- package/dist/module/Events/types.js +23 -0
- package/dist/module/Metrics/index.js +48 -1
- package/dist/module/Metrics/types.js +18 -0
- package/dist/module/api.js +3 -2
- package/dist/module/common/Utils.js +77 -19
- package/dist/module/common/testUtil.js +6 -1
- package/dist/module/common/types.js +3 -0
- package/dist/module/index.js +7 -3
- package/dist/module/mobius-socket/config.js +15 -0
- package/dist/module/mobius-socket/errors.js +58 -0
- package/dist/module/mobius-socket/index.js +24 -0
- package/dist/module/mobius-socket/mobius-socket.js +593 -0
- package/dist/module/mobius-socket/socket/constants.js +26 -0
- package/dist/module/mobius-socket/socket/index.js +4 -0
- package/dist/module/mobius-socket/socket/socket-base.js +368 -0
- package/dist/module/mobius-socket/socket/socket.js +9 -0
- package/dist/module/mobius-socket/socket/socket.shim.js +12 -0
- package/dist/module/mobius-socket/socket/types.js +1 -0
- package/dist/module/mobius-socket/types.js +1 -0
- package/dist/types/CallRecording/CallRecording.d.ts +18 -0
- package/dist/types/CallRecording/CallRecording.d.ts.map +1 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +23 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +61 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +29 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +176 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/utils.d.ts +3 -0
- package/dist/types/CallRecording/utils.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts +8 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +17 -3
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +8 -4
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +38 -9
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +27 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +9 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +26 -2
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
- package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +4 -2
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/CallingClient/utils/constants.d.ts +35 -0
- package/dist/types/CallingClient/utils/constants.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/index.d.ts +6 -0
- package/dist/types/CallingClient/utils/index.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts +5 -0
- package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/request.d.ts +28 -0
- package/dist/types/CallingClient/utils/request.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/types.d.ts +34 -0
- package/dist/types/CallingClient/utils/types.d.ts.map +1 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts +4 -0
- package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts.map +1 -0
- package/dist/types/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +80 -6
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +19 -2
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +39 -12
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +6 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +9 -4
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +5 -1
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +5 -1
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mobius-socket/config.d.ts +17 -0
- package/dist/types/mobius-socket/config.d.ts.map +1 -0
- package/dist/types/mobius-socket/errors.d.ts +32 -0
- package/dist/types/mobius-socket/errors.d.ts.map +1 -0
- package/dist/types/mobius-socket/index.d.ts +14 -0
- package/dist/types/mobius-socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts +48 -0
- package/dist/types/mobius-socket/mobius-socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/constants.d.ts +27 -0
- package/dist/types/mobius-socket/socket/constants.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/index.d.ts +5 -0
- package/dist/types/mobius-socket/socket/index.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts +43 -0
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts +6 -0
- package/dist/types/mobius-socket/socket/socket.shim.d.ts.map +1 -0
- package/dist/types/mobius-socket/socket/types.d.ts +61 -0
- package/dist/types/mobius-socket/socket/types.d.ts.map +1 -0
- package/dist/types/mobius-socket/types.d.ts +21 -0
- package/dist/types/mobius-socket/types.d.ts.map +1 -0
- package/package.json +20 -7
- package/src/mobius-socket/socket/socket.shim.ts +22 -0
- package/src/mobius-socket/socket/socket.ts +14 -0
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
|
4
|
-
var
|
|
5
|
-
var _Object$
|
|
4
|
+
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
6
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
8
|
+
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
9
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
10
|
+
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
7
11
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
8
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
9
13
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
10
14
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
11
15
|
var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
|
|
12
16
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
17
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
13
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
14
20
|
var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
15
21
|
var _mediaHelpers = require("@webex/media-helpers");
|
|
@@ -27,11 +33,17 @@ var _callManager = require("./callManager");
|
|
|
27
33
|
var _Logger = _interopRequireDefault(require("../../Logger"));
|
|
28
34
|
var _Errors = require("../../Errors");
|
|
29
35
|
var _constants2 = require("../../common/constants");
|
|
36
|
+
var _request = require("../utils/request");
|
|
30
37
|
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
31
|
-
|
|
32
|
-
/* eslint-disable dot-notation */
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable dot-notation */ /* eslint-disable @typescript-eslint/no-shadow */
|
|
40
|
+
jest.mock('../../mobius-socket', function () {
|
|
41
|
+
return {
|
|
42
|
+
getMobiusSocketInstance: jest.fn().mockReturnValue({
|
|
43
|
+
sendWssRequest: jest.fn()
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
});
|
|
35
47
|
jest.mock('@webex/internal-media-core');
|
|
36
48
|
var uploadLogsSpy = jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
37
49
|
var webex = (0, _testUtil.getTestUtilsWebex)();
|
|
@@ -116,6 +128,11 @@ describe('Call Tests', function () {
|
|
|
116
128
|
webex.request = jest.fn();
|
|
117
129
|
});
|
|
118
130
|
beforeEach(function () {
|
|
131
|
+
_request.APIRequest.resetInstance();
|
|
132
|
+
_request.APIRequest.getInstance({
|
|
133
|
+
webex: webex,
|
|
134
|
+
isMobiusSocketEnabled: false
|
|
135
|
+
});
|
|
119
136
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
120
137
|
});
|
|
121
138
|
it('create call object', function () {
|
|
@@ -232,6 +249,9 @@ describe('Call Tests', function () {
|
|
|
232
249
|
// Need to add a small delay for Promise and callback to finish.
|
|
233
250
|
expect(parseMediaQualityStatisticsMock).toHaveBeenCalledTimes(1);
|
|
234
251
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
252
|
+
expect(webex.request.mock.calls[0][0].body.callId).toBe(call.getCallId().replace("".concat(_constants.DEFAULT_LOCAL_CALL_ID, "_"), ''));
|
|
253
|
+
expect(webex.request.mock.calls[0][0].body.callId).not.toContain(_constants.DEFAULT_LOCAL_CALL_ID);
|
|
254
|
+
expect(webex.request.mock.calls[0][0].body.callId).not.toMatch(/^_/);
|
|
235
255
|
expect(call.getDisconnectReason().code).toBe(_types5.DisconnectCode.NORMAL);
|
|
236
256
|
expect(call.getDisconnectReason().cause).toBe(_types5.DisconnectCause.NORMAL);
|
|
237
257
|
|
|
@@ -280,35 +300,64 @@ describe('Call Tests', function () {
|
|
|
280
300
|
}
|
|
281
301
|
}, _callee3);
|
|
282
302
|
})));
|
|
283
|
-
it('
|
|
284
|
-
var call;
|
|
303
|
+
it('delete sends the server-assigned callId unchanged', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
304
|
+
var serverCallId, call;
|
|
285
305
|
return _regenerator.default.wrap(function (_context4) {
|
|
286
306
|
while (1) switch (_context4.prev = _context4.next) {
|
|
287
307
|
case 0:
|
|
308
|
+
serverCallId = '8a67806f-fc4d-446b-a131-31e71ea5b020';
|
|
309
|
+
webex.request.mockReturnValue({
|
|
310
|
+
statusCode: 200,
|
|
311
|
+
body: {
|
|
312
|
+
device: {
|
|
313
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
314
|
+
correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
|
|
315
|
+
},
|
|
316
|
+
callId: serverCallId
|
|
317
|
+
}
|
|
318
|
+
});
|
|
288
319
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
289
|
-
call.
|
|
320
|
+
call.setCallId(serverCallId);
|
|
321
|
+
call.end();
|
|
290
322
|
_context4.next = 1;
|
|
291
323
|
return (0, _Utils.waitForMsecs)(50);
|
|
292
324
|
case 1:
|
|
293
|
-
expect(
|
|
294
|
-
expect(call.getCallerInfo().num).toStrictEqual('5010');
|
|
295
|
-
expect(call.getCallerInfo().avatarSrc).toBeFalsy();
|
|
325
|
+
expect(webex.request.mock.calls[0][0].body.callId).toBe(serverCallId);
|
|
296
326
|
case 2:
|
|
297
327
|
case "end":
|
|
298
328
|
return _context4.stop();
|
|
299
329
|
}
|
|
300
330
|
}, _callee4);
|
|
301
331
|
})));
|
|
302
|
-
it('check whether
|
|
303
|
-
var call
|
|
332
|
+
it('check whether callerId midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
333
|
+
var call;
|
|
304
334
|
return _regenerator.default.wrap(function (_context5) {
|
|
305
335
|
while (1) switch (_context5.prev = _context5.next) {
|
|
336
|
+
case 0:
|
|
337
|
+
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
338
|
+
call.handleMidCallEvent(dummyMidCallEvent);
|
|
339
|
+
_context5.next = 1;
|
|
340
|
+
return (0, _Utils.waitForMsecs)(50);
|
|
341
|
+
case 1:
|
|
342
|
+
expect(call.getCallerInfo().name).toStrictEqual('Bob Marley');
|
|
343
|
+
expect(call.getCallerInfo().num).toStrictEqual('5010');
|
|
344
|
+
expect(call.getCallerInfo().avatarSrc).toBeFalsy();
|
|
345
|
+
case 2:
|
|
346
|
+
case "end":
|
|
347
|
+
return _context5.stop();
|
|
348
|
+
}
|
|
349
|
+
}, _callee5);
|
|
350
|
+
})));
|
|
351
|
+
it('check whether call midcall event is serviced or not', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
352
|
+
var call, logSpy, corelationId;
|
|
353
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
354
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
306
355
|
case 0:
|
|
307
356
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
308
357
|
dummyMidCallEvent.eventType = 'callState';
|
|
309
358
|
logSpy = jest.spyOn(_Logger.default, 'log');
|
|
310
359
|
call.handleMidCallEvent(dummyMidCallEvent);
|
|
311
|
-
|
|
360
|
+
_context6.next = 1;
|
|
312
361
|
return (0, _Utils.waitForMsecs)(50);
|
|
313
362
|
case 1:
|
|
314
363
|
corelationId = call.getCorrelationId();
|
|
@@ -318,39 +367,39 @@ describe('Call Tests', function () {
|
|
|
318
367
|
});
|
|
319
368
|
case 2:
|
|
320
369
|
case "end":
|
|
321
|
-
return
|
|
370
|
+
return _context6.stop();
|
|
322
371
|
}
|
|
323
|
-
},
|
|
372
|
+
}, _callee6);
|
|
324
373
|
})));
|
|
325
|
-
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
374
|
+
it('check call stats for active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
326
375
|
var call, callRtpStats, _t;
|
|
327
|
-
return _regenerator.default.wrap(function (
|
|
328
|
-
while (1) switch (
|
|
376
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
377
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
329
378
|
case 0:
|
|
330
379
|
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
331
|
-
|
|
332
|
-
|
|
380
|
+
_context7.prev = 1;
|
|
381
|
+
_context7.next = 2;
|
|
333
382
|
return call.getCallRtpStats();
|
|
334
383
|
case 2:
|
|
335
|
-
callRtpStats =
|
|
336
|
-
|
|
384
|
+
callRtpStats = _context7.sent;
|
|
385
|
+
_context7.next = 4;
|
|
337
386
|
break;
|
|
338
387
|
case 3:
|
|
339
|
-
|
|
340
|
-
_t =
|
|
388
|
+
_context7.prev = 3;
|
|
389
|
+
_t = _context7["catch"](1);
|
|
341
390
|
console.error(_t);
|
|
342
391
|
case 4:
|
|
343
392
|
expect(callRtpStats).toStrictEqual(disconnectStats);
|
|
344
393
|
case 5:
|
|
345
394
|
case "end":
|
|
346
|
-
return
|
|
395
|
+
return _context7.stop();
|
|
347
396
|
}
|
|
348
|
-
},
|
|
397
|
+
}, _callee7, null, [[1, 3]]);
|
|
349
398
|
})));
|
|
350
|
-
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
399
|
+
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
351
400
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, logSpy;
|
|
352
|
-
return _regenerator.default.wrap(function (
|
|
353
|
-
while (1) switch (
|
|
401
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
402
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
354
403
|
case 0:
|
|
355
404
|
mockStream = {
|
|
356
405
|
outputStream: {
|
|
@@ -383,14 +432,14 @@ describe('Call Tests', function () {
|
|
|
383
432
|
});
|
|
384
433
|
case 1:
|
|
385
434
|
case "end":
|
|
386
|
-
return
|
|
435
|
+
return _context8.stop();
|
|
387
436
|
}
|
|
388
|
-
},
|
|
437
|
+
}, _callee8);
|
|
389
438
|
})));
|
|
390
|
-
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
439
|
+
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
391
440
|
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy, infoSpy;
|
|
392
|
-
return _regenerator.default.wrap(function (
|
|
393
|
-
while (1) switch (
|
|
441
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
442
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
394
443
|
case 0:
|
|
395
444
|
mockStream = {
|
|
396
445
|
outputStream: {
|
|
@@ -424,14 +473,309 @@ describe('Call Tests', function () {
|
|
|
424
473
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
425
474
|
case 1:
|
|
426
475
|
case "end":
|
|
427
|
-
return
|
|
476
|
+
return _context9.stop();
|
|
428
477
|
}
|
|
429
|
-
},
|
|
478
|
+
}, _callee9);
|
|
430
479
|
})));
|
|
431
|
-
it('
|
|
480
|
+
it('registers and unregisters media connection listeners with stable handlers', function () {
|
|
481
|
+
var mockStream = {
|
|
482
|
+
outputStream: {
|
|
483
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
484
|
+
},
|
|
485
|
+
on: jest.fn(),
|
|
486
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
487
|
+
};
|
|
488
|
+
var localAudioStream = mockStream;
|
|
489
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
490
|
+
call.dial(localAudioStream);
|
|
491
|
+
var mediaOnMock = call['mediaConnection'].on;
|
|
492
|
+
var mediaOffSpy = jest.spyOn(call['mediaConnection'], 'off');
|
|
493
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, expect.any(Function));
|
|
494
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE, expect.any(Function));
|
|
495
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.REMOTE_TRACK_ADDED, expect.any(Function));
|
|
496
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED, expect.any(Function));
|
|
497
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
498
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
499
|
+
expect(mediaOnMock).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, expect.any(Function));
|
|
500
|
+
call['unregisterMediaConnectionListeners']();
|
|
501
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, expect.any(Function));
|
|
502
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE, expect.any(Function));
|
|
503
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.REMOTE_TRACK_ADDED, expect.any(Function));
|
|
504
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED, expect.any(Function));
|
|
505
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
506
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED, expect.any(Function));
|
|
507
|
+
expect(mediaOffSpy).toBeCalledWith(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, expect.any(Function));
|
|
508
|
+
});
|
|
509
|
+
it('handles ICE listener payloads and submits metrics with event names', function () {
|
|
510
|
+
var mockStream = {
|
|
511
|
+
outputStream: {
|
|
512
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
513
|
+
},
|
|
514
|
+
on: jest.fn(),
|
|
515
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
516
|
+
};
|
|
517
|
+
var localAudioStream = mockStream;
|
|
518
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
519
|
+
call.dial(localAudioStream);
|
|
520
|
+
var metricSpy = jest.spyOn(call['metricManager'], 'submitMediaMetric');
|
|
521
|
+
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
522
|
+
var getHandlerForEvent = function getHandlerForEvent(eventName) {
|
|
523
|
+
var _mock$calls$find;
|
|
524
|
+
return (_mock$calls$find = call['mediaConnection'].on.mock.calls.find(function (_ref0) {
|
|
525
|
+
var _ref1 = (0, _slicedToArray2.default)(_ref0, 1),
|
|
526
|
+
name = _ref1[0];
|
|
527
|
+
return name === eventName;
|
|
528
|
+
})) === null || _mock$calls$find === void 0 ? void 0 : _mock$calls$find[1];
|
|
529
|
+
};
|
|
530
|
+
var iceGatheringHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED);
|
|
531
|
+
var peerConnectionHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED);
|
|
532
|
+
var iceConnectionHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED);
|
|
533
|
+
var iceCandidateErrorHandler = getHandlerForEvent(InternalMediaCoreModule.MediaConnectionEventNames.ICE_CANDIDATE_ERROR);
|
|
534
|
+
iceGatheringHandler({
|
|
535
|
+
iceGatheringState: 'gathering'
|
|
536
|
+
});
|
|
537
|
+
peerConnectionHandler({
|
|
538
|
+
connectionState: 'connected'
|
|
539
|
+
});
|
|
540
|
+
iceConnectionHandler({
|
|
541
|
+
iceConnectionState: 'completed'
|
|
542
|
+
});
|
|
543
|
+
iceCandidateErrorHandler({
|
|
544
|
+
errorCode: 701,
|
|
545
|
+
errorText: 'STUN host lookup failed',
|
|
546
|
+
url: 'stun:example.org:3478'
|
|
547
|
+
});
|
|
548
|
+
expect(metricSpy).toHaveBeenNthCalledWith(1, _types4.METRIC_EVENT.MEDIA, _types4.MEDIA_CONNECTION_ACTION.ICE_GATHERING_STATE_CHANGED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, 'gathering');
|
|
549
|
+
expect(metricSpy).toHaveBeenNthCalledWith(2, _types4.METRIC_EVENT.MEDIA, _types4.MEDIA_CONNECTION_ACTION.PEER_CONNECTION_STATE_CHANGED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, 'connected');
|
|
550
|
+
expect(metricSpy).toHaveBeenNthCalledWith(3, _types4.METRIC_EVENT.MEDIA, _types4.MEDIA_CONNECTION_ACTION.ICE_CONNECTION_STATE_CHANGED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, 'completed');
|
|
551
|
+
expect(metricSpy).toHaveBeenNthCalledWith(4, _types4.METRIC_EVENT.MEDIA_ERROR, _types4.MEDIA_CONNECTION_ACTION.ICE_CANDIDATE_ERROR, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, undefined, expect.any(_Errors.CallError));
|
|
552
|
+
var mediaErrorCall = metricSpy.mock.calls[3];
|
|
553
|
+
expect(mediaErrorCall[mediaErrorCall.length - 1].getCallError().message).toBe('ICE candidate error occurred: {"address":null,"errorCode":701,"errorText":"STUN host lookup failed","port":null,"url":"stun:example.org:3478"}');
|
|
554
|
+
expect(warnSpy).toHaveBeenCalledWith('ICE candidate error occurred: {"address":null,"errorCode":701,"errorText":"STUN host lookup failed","port":null,"url":"stun:example.org:3478"}', {
|
|
555
|
+
file: 'call',
|
|
556
|
+
method: 'mediaIceEventsListener'
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
it('handles ROAP failure listener and submits media error metric', function () {
|
|
560
|
+
var _mock$calls$find2;
|
|
561
|
+
var mockStream = {
|
|
562
|
+
outputStream: {
|
|
563
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
564
|
+
},
|
|
565
|
+
on: jest.fn(),
|
|
566
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
567
|
+
};
|
|
568
|
+
var localAudioStream = mockStream;
|
|
569
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
570
|
+
call.dial(localAudioStream);
|
|
571
|
+
var metricSpy = jest.spyOn(call['metricManager'], 'submitMediaMetric');
|
|
572
|
+
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
573
|
+
var roapFailureHandler = (_mock$calls$find2 = call['mediaConnection'].on.mock.calls.find(function (_ref10) {
|
|
574
|
+
var _ref11 = (0, _slicedToArray2.default)(_ref10, 1),
|
|
575
|
+
name = _ref11[0];
|
|
576
|
+
return name === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_FAILURE;
|
|
577
|
+
})) === null || _mock$calls$find2 === void 0 ? void 0 : _mock$calls$find2[1];
|
|
578
|
+
var roapFailure = new Error('Failed to process remote SDP');
|
|
579
|
+
roapFailureHandler(roapFailure);
|
|
580
|
+
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.MEDIA_ERROR, _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), undefined, undefined, undefined, expect.any(_Errors.CallError));
|
|
581
|
+
var roapFailureMetricCall = metricSpy.mock.calls.find(function (_ref12) {
|
|
582
|
+
var _ref13 = (0, _slicedToArray2.default)(_ref12, 2),
|
|
583
|
+
name = _ref13[0],
|
|
584
|
+
metricAction = _ref13[1];
|
|
585
|
+
return name === _types4.METRIC_EVENT.MEDIA_ERROR && metricAction === _types4.MEDIA_CONNECTION_ACTION.ROAP_FAILURE;
|
|
586
|
+
});
|
|
587
|
+
expect(roapFailureMetricCall).toBeDefined();
|
|
588
|
+
expect((roapFailureMetricCall === null || roapFailureMetricCall === void 0 ? void 0 : roapFailureMetricCall[roapFailureMetricCall.length - 1]).getCallError().message).toBe('ROAP failure occurred: Failed to process remote SDP');
|
|
589
|
+
expect(warnSpy).toHaveBeenCalledWith('ROAP failure occurred: Failed to process remote SDP', {
|
|
590
|
+
file: 'call',
|
|
591
|
+
method: 'mediaRoapEventsListener'
|
|
592
|
+
});
|
|
593
|
+
});
|
|
594
|
+
it('sends connect before ROAP answer when inbound offer is delayed', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
595
|
+
var _mock$calls$find3;
|
|
596
|
+
var mockStream, localAudioStream, call, handleOutgoingCallConnectSpy, delayedOffer, sendCallStateMachineEvtSpy, sendMediaStateMachineEvtSpy, roapListener;
|
|
597
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
598
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
599
|
+
case 0:
|
|
600
|
+
mockStream = {
|
|
601
|
+
outputStream: {
|
|
602
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
603
|
+
},
|
|
604
|
+
on: jest.fn(),
|
|
605
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
606
|
+
return mockEffect;
|
|
607
|
+
})
|
|
608
|
+
};
|
|
609
|
+
localAudioStream = mockStream;
|
|
610
|
+
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.INBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
611
|
+
webex.request.mockReturnValue({
|
|
612
|
+
statusCode: 200,
|
|
613
|
+
body: {
|
|
614
|
+
callId: 'mock-call-id'
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
call.sendCallStateMachineEvt({
|
|
618
|
+
type: 'E_RECV_CALL_SETUP',
|
|
619
|
+
data: {
|
|
620
|
+
seq: 1,
|
|
621
|
+
messageType: 'OFFER'
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
625
|
+
_context0.next = 1;
|
|
626
|
+
return call.answer(localAudioStream);
|
|
627
|
+
case 1:
|
|
628
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
629
|
+
|
|
630
|
+
// Connect is attempted by answer(), but is deferred because offer is not buffered yet.
|
|
631
|
+
handleOutgoingCallConnectSpy = jest.spyOn(call, 'handleOutgoingCallConnect');
|
|
632
|
+
expect(call['connectPending']).toBe(true);
|
|
633
|
+
expect(call['mediaConnection'].roapMessageReceived).not.toHaveBeenCalled();
|
|
634
|
+
delayedOffer = {
|
|
635
|
+
seq: 1,
|
|
636
|
+
messageType: 'OFFER',
|
|
637
|
+
sdp: 'v=0',
|
|
638
|
+
version: 1
|
|
639
|
+
};
|
|
640
|
+
call.sendMediaStateMachineEvt({
|
|
641
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
642
|
+
data: delayedOffer
|
|
643
|
+
});
|
|
644
|
+
_context0.next = 2;
|
|
645
|
+
return (0, _testUtil.flushPromises)(2);
|
|
646
|
+
case 2:
|
|
647
|
+
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenCalledWith(delayedOffer);
|
|
648
|
+
sendCallStateMachineEvtSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
649
|
+
sendMediaStateMachineEvtSpy = jest.spyOn(call, 'sendMediaStateMachineEvt');
|
|
650
|
+
roapListener = (_mock$calls$find3 = call['mediaConnection'].on.mock.calls.find(function (_ref15) {
|
|
651
|
+
var _ref16 = (0, _slicedToArray2.default)(_ref15, 1),
|
|
652
|
+
eventName = _ref16[0];
|
|
653
|
+
return eventName === InternalMediaCoreModule.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND;
|
|
654
|
+
})) === null || _mock$calls$find3 === void 0 ? void 0 : _mock$calls$find3[1];
|
|
655
|
+
expect(roapListener).toBeDefined();
|
|
656
|
+
_context0.next = 3;
|
|
657
|
+
return roapListener({
|
|
658
|
+
roapMessage: {
|
|
659
|
+
messageType: 'ANSWER',
|
|
660
|
+
sdp: 'v=0',
|
|
661
|
+
seq: 1,
|
|
662
|
+
version: 2
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
case 3:
|
|
666
|
+
_context0.next = 4;
|
|
667
|
+
return (0, _testUtil.flushPromises)(2);
|
|
668
|
+
case 4:
|
|
669
|
+
// On ANSWER from media layer, connect is retried first, then ROAP answer is posted.
|
|
670
|
+
expect(sendCallStateMachineEvtSpy).toHaveBeenNthCalledWith(1, {
|
|
671
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
672
|
+
});
|
|
673
|
+
expect(sendMediaStateMachineEvtSpy).toHaveBeenNthCalledWith(1, {
|
|
674
|
+
type: 'E_SEND_ROAP_ANSWER',
|
|
675
|
+
data: expect.objectContaining({
|
|
676
|
+
messageType: 'ANSWER'
|
|
677
|
+
})
|
|
678
|
+
});
|
|
679
|
+
expect(handleOutgoingCallConnectSpy).toHaveBeenCalled();
|
|
680
|
+
expect(call['mediaConnection'].roapMessageReceived).toHaveBeenLastCalledWith(delayedOffer);
|
|
681
|
+
expect(call['connectPending']).toBe(false);
|
|
682
|
+
case 5:
|
|
683
|
+
case "end":
|
|
684
|
+
return _context0.stop();
|
|
685
|
+
}
|
|
686
|
+
}, _callee0);
|
|
687
|
+
})));
|
|
688
|
+
var iceLiteOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'a=ice-lite\r\nm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\n';
|
|
689
|
+
var fullIceOfferSdp = 'v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n' + 'm=audio 19564 UDP/TLS/RTP/SAVPF 0\r\na=sendrecv\r\na=ice-ufrag:mLbW\r\n';
|
|
690
|
+
describe.each([{
|
|
691
|
+
name: 'reduced timeout when the offer is ice-lite and reduceTimeoutForIceLite is enabled',
|
|
692
|
+
sdp: iceLiteOfferSdp,
|
|
693
|
+
iceGatheringConfig: {
|
|
694
|
+
reduceTimeoutForIceLite: true
|
|
695
|
+
},
|
|
696
|
+
expectedTimeout: _constants.ICE_LITE_CANDIDATES_TIMEOUT
|
|
697
|
+
}, {
|
|
698
|
+
name: 'custom reduced timeout when the offer is ice-lite and iceLiteTimeout is overridden',
|
|
699
|
+
sdp: iceLiteOfferSdp,
|
|
700
|
+
iceGatheringConfig: {
|
|
701
|
+
reduceTimeoutForIceLite: true,
|
|
702
|
+
iceLiteTimeout: 750
|
|
703
|
+
},
|
|
704
|
+
expectedTimeout: 750
|
|
705
|
+
}, {
|
|
706
|
+
name: 'default timeout when the offer is ice-lite but reduceTimeoutForIceLite is disabled',
|
|
707
|
+
sdp: iceLiteOfferSdp,
|
|
708
|
+
iceGatheringConfig: {
|
|
709
|
+
reduceTimeoutForIceLite: false
|
|
710
|
+
},
|
|
711
|
+
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
712
|
+
}, {
|
|
713
|
+
name: 'default timeout when the offer is ice-lite but no iceGathering config is provided',
|
|
714
|
+
sdp: iceLiteOfferSdp,
|
|
715
|
+
iceGatheringConfig: undefined,
|
|
716
|
+
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
717
|
+
}, {
|
|
718
|
+
name: 'default timeout when reduceTimeoutForIceLite is enabled but the offer is not ice-lite',
|
|
719
|
+
sdp: fullIceOfferSdp,
|
|
720
|
+
iceGatheringConfig: {
|
|
721
|
+
reduceTimeoutForIceLite: true
|
|
722
|
+
},
|
|
723
|
+
expectedTimeout: _constants.ICE_CANDIDATES_TIMEOUT
|
|
724
|
+
}])('ICE candidates timeout selection', function (_ref17) {
|
|
725
|
+
var name = _ref17.name,
|
|
726
|
+
sdp = _ref17.sdp,
|
|
727
|
+
iceGatheringConfig = _ref17.iceGatheringConfig,
|
|
728
|
+
expectedTimeout = _ref17.expectedTimeout;
|
|
729
|
+
it("uses ".concat(name), /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
730
|
+
var mockStream, localAudioStream, call;
|
|
731
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
732
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
733
|
+
case 0:
|
|
734
|
+
mockStream = {
|
|
735
|
+
outputStream: {
|
|
736
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
737
|
+
},
|
|
738
|
+
on: jest.fn(),
|
|
739
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
740
|
+
return mockEffect;
|
|
741
|
+
})
|
|
742
|
+
};
|
|
743
|
+
localAudioStream = mockStream;
|
|
744
|
+
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.INBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest, iceGatheringConfig);
|
|
745
|
+
webex.request.mockReturnValue({
|
|
746
|
+
statusCode: 200,
|
|
747
|
+
body: {
|
|
748
|
+
callId: 'mock-call-id'
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
/* Buffer the remote offer before answering so it is available at media connection init. */
|
|
753
|
+
call.sendMediaStateMachineEvt({
|
|
754
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
755
|
+
data: {
|
|
756
|
+
seq: 1,
|
|
757
|
+
messageType: 'OFFER',
|
|
758
|
+
version: 1,
|
|
759
|
+
sdp: sdp
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
_context1.next = 1;
|
|
763
|
+
return call.answer(localAudioStream);
|
|
764
|
+
case 1:
|
|
765
|
+
expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(_objectSpread(_objectSpread({}, roapMediaConnectionConfig), {}, {
|
|
766
|
+
iceCandidatesTimeout: expectedTimeout
|
|
767
|
+
}), roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
|
|
768
|
+
case 2:
|
|
769
|
+
case "end":
|
|
770
|
+
return _context1.stop();
|
|
771
|
+
}
|
|
772
|
+
}, _callee1);
|
|
773
|
+
})));
|
|
774
|
+
});
|
|
775
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
432
776
|
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
433
|
-
return _regenerator.default.wrap(function (
|
|
434
|
-
while (1) switch (
|
|
777
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
778
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
435
779
|
case 0:
|
|
436
780
|
mockStream = {
|
|
437
781
|
outputStream: {
|
|
@@ -487,7 +831,7 @@ describe('Call Tests', function () {
|
|
|
487
831
|
});
|
|
488
832
|
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
489
833
|
call.end();
|
|
490
|
-
|
|
834
|
+
_context10.next = 1;
|
|
491
835
|
return (0, _Utils.waitForMsecs)(50);
|
|
492
836
|
case 1:
|
|
493
837
|
/* Checks for switching off the listeners on call disconnect */
|
|
@@ -498,14 +842,32 @@ describe('Call Tests', function () {
|
|
|
498
842
|
expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
|
|
499
843
|
case 2:
|
|
500
844
|
case "end":
|
|
501
|
-
return
|
|
845
|
+
return _context10.stop();
|
|
502
846
|
}
|
|
503
|
-
},
|
|
847
|
+
}, _callee10);
|
|
504
848
|
})));
|
|
505
|
-
it('
|
|
849
|
+
it('does not register effect listeners when the added effect cannot be resolved', function () {
|
|
850
|
+
var mockStream = {
|
|
851
|
+
outputStream: {
|
|
852
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
853
|
+
},
|
|
854
|
+
on: jest.fn(),
|
|
855
|
+
getEffectByKind: jest.fn().mockReturnValue(undefined)
|
|
856
|
+
};
|
|
857
|
+
var localAudioStream = mockStream;
|
|
858
|
+
var onStreamSpy = jest.spyOn(localAudioStream, 'on');
|
|
859
|
+
var onEffectSpy = jest.spyOn(mockEffect, 'on');
|
|
860
|
+
var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
861
|
+
call.dial(localAudioStream);
|
|
862
|
+
expect(function () {
|
|
863
|
+
return onStreamSpy.mock.calls[1][1](undefined);
|
|
864
|
+
}).not.toThrow();
|
|
865
|
+
expect(onEffectSpy).not.toHaveBeenCalled();
|
|
866
|
+
});
|
|
867
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
506
868
|
var mockStream, localAudioStream, warnSpy, call;
|
|
507
|
-
return _regenerator.default.wrap(function (
|
|
508
|
-
while (1) switch (
|
|
869
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
870
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
509
871
|
case 0:
|
|
510
872
|
mockStream = {
|
|
511
873
|
outputStream: {
|
|
@@ -529,7 +891,7 @@ describe('Call Tests', function () {
|
|
|
529
891
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
530
892
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
531
893
|
call.answer(localAudioStream);
|
|
532
|
-
|
|
894
|
+
_context11.next = 1;
|
|
533
895
|
return (0, _Utils.waitForMsecs)(50);
|
|
534
896
|
case 1:
|
|
535
897
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -544,14 +906,14 @@ describe('Call Tests', function () {
|
|
|
544
906
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
545
907
|
case 2:
|
|
546
908
|
case "end":
|
|
547
|
-
return
|
|
909
|
+
return _context11.stop();
|
|
548
910
|
}
|
|
549
|
-
},
|
|
911
|
+
}, _callee11);
|
|
550
912
|
})));
|
|
551
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
913
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
552
914
|
var mockStream, localAudioStream, warnSpy, call;
|
|
553
|
-
return _regenerator.default.wrap(function (
|
|
554
|
-
while (1) switch (
|
|
915
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
916
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
555
917
|
case 0:
|
|
556
918
|
mockStream = {
|
|
557
919
|
outputStream: {
|
|
@@ -563,7 +925,7 @@ describe('Call Tests', function () {
|
|
|
563
925
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
564
926
|
call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
|
|
565
927
|
call.dial(localAudioStream);
|
|
566
|
-
|
|
928
|
+
_context12.next = 1;
|
|
567
929
|
return (0, _Utils.waitForMsecs)(50);
|
|
568
930
|
case 1:
|
|
569
931
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -576,9 +938,9 @@ describe('Call Tests', function () {
|
|
|
576
938
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
577
939
|
case 2:
|
|
578
940
|
case "end":
|
|
579
|
-
return
|
|
941
|
+
return _context12.stop();
|
|
580
942
|
}
|
|
581
|
-
},
|
|
943
|
+
}, _callee12);
|
|
582
944
|
})));
|
|
583
945
|
it('update media after call creation with valid stream', function () {
|
|
584
946
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -652,10 +1014,10 @@ describe('Call Tests', function () {
|
|
|
652
1014
|
method: 'dial'
|
|
653
1015
|
});
|
|
654
1016
|
});
|
|
655
|
-
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1017
|
+
it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
656
1018
|
var logSpy, callManager, mockStream, localAudioStream, call;
|
|
657
|
-
return _regenerator.default.wrap(function (
|
|
658
|
-
while (1) switch (
|
|
1019
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1020
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
659
1021
|
case 0:
|
|
660
1022
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
661
1023
|
webex.request.mockReturnValue({
|
|
@@ -731,9 +1093,9 @@ describe('Call Tests', function () {
|
|
|
731
1093
|
expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
|
|
732
1094
|
case 1:
|
|
733
1095
|
case "end":
|
|
734
|
-
return
|
|
1096
|
+
return _context13.stop();
|
|
735
1097
|
}
|
|
736
|
-
},
|
|
1098
|
+
}, _callee13);
|
|
737
1099
|
})));
|
|
738
1100
|
describe('Guest Calling Flow Tests', function () {
|
|
739
1101
|
var dummyEvent = {
|
|
@@ -741,10 +1103,10 @@ describe('Call Tests', function () {
|
|
|
741
1103
|
data: undefined
|
|
742
1104
|
};
|
|
743
1105
|
var call;
|
|
744
|
-
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1106
|
+
it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
745
1107
|
var requestSpy, requestArgs;
|
|
746
|
-
return _regenerator.default.wrap(function (
|
|
747
|
-
while (1) switch (
|
|
1108
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1109
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
748
1110
|
case 0:
|
|
749
1111
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
750
1112
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -757,14 +1119,14 @@ describe('Call Tests', function () {
|
|
|
757
1119
|
expect('callee' in requestArgs.body).toBe(true);
|
|
758
1120
|
case 1:
|
|
759
1121
|
case "end":
|
|
760
|
-
return
|
|
1122
|
+
return _context14.stop();
|
|
761
1123
|
}
|
|
762
|
-
},
|
|
1124
|
+
}, _callee14);
|
|
763
1125
|
})));
|
|
764
|
-
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1126
|
+
it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
765
1127
|
var requestSpy, requestArgs;
|
|
766
|
-
return _regenerator.default.wrap(function (
|
|
767
|
-
while (1) switch (
|
|
1128
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1129
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
768
1130
|
case 0:
|
|
769
1131
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
770
1132
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -777,9 +1139,9 @@ describe('Call Tests', function () {
|
|
|
777
1139
|
expect('callee' in requestArgs.body).toBe(false);
|
|
778
1140
|
case 1:
|
|
779
1141
|
case "end":
|
|
780
|
-
return
|
|
1142
|
+
return _context15.stop();
|
|
781
1143
|
}
|
|
782
|
-
},
|
|
1144
|
+
}, _callee15);
|
|
783
1145
|
})));
|
|
784
1146
|
});
|
|
785
1147
|
});
|
|
@@ -799,6 +1161,11 @@ describe('State Machine handler tests', function () {
|
|
|
799
1161
|
var call;
|
|
800
1162
|
var dtmfMock;
|
|
801
1163
|
beforeEach(function () {
|
|
1164
|
+
_request.APIRequest.resetInstance();
|
|
1165
|
+
_request.APIRequest.getInstance({
|
|
1166
|
+
webex: webex,
|
|
1167
|
+
isMobiusSocketEnabled: false
|
|
1168
|
+
});
|
|
802
1169
|
call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
|
|
803
1170
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
804
1171
|
var dummy = 10;
|
|
@@ -812,10 +1179,10 @@ describe('State Machine handler tests', function () {
|
|
|
812
1179
|
|
|
813
1180
|
// afterEach(() => call.removeAllListeners());
|
|
814
1181
|
|
|
815
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1182
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
816
1183
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
817
|
-
return _regenerator.default.wrap(function (
|
|
818
|
-
while (1) switch (
|
|
1184
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1185
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
819
1186
|
case 0:
|
|
820
1187
|
statusPayload = {
|
|
821
1188
|
statusCode: 200,
|
|
@@ -835,7 +1202,7 @@ describe('State Machine handler tests', function () {
|
|
|
835
1202
|
/* This is to flush all the promises from the Promise queue so that
|
|
836
1203
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
837
1204
|
*/
|
|
838
|
-
|
|
1205
|
+
_context16.next = 1;
|
|
839
1206
|
return (0, _testUtil.flushPromises)(3);
|
|
840
1207
|
case 1:
|
|
841
1208
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -851,14 +1218,14 @@ describe('State Machine handler tests', function () {
|
|
|
851
1218
|
});
|
|
852
1219
|
case 2:
|
|
853
1220
|
case "end":
|
|
854
|
-
return
|
|
1221
|
+
return _context16.stop();
|
|
855
1222
|
}
|
|
856
|
-
},
|
|
1223
|
+
}, _callee16);
|
|
857
1224
|
})));
|
|
858
|
-
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1225
|
+
it('session refresh 401 emits token error and ends the call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
859
1226
|
var statusPayload, emitSpy, funcSpy;
|
|
860
|
-
return _regenerator.default.wrap(function (
|
|
861
|
-
while (1) switch (
|
|
1227
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1228
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
862
1229
|
case 0:
|
|
863
1230
|
expect.assertions(4);
|
|
864
1231
|
statusPayload = {
|
|
@@ -873,10 +1240,10 @@ describe('State Machine handler tests', function () {
|
|
|
873
1240
|
funcSpy = jest.spyOn(call, 'postStatus').mockRejectedValue(statusPayload);
|
|
874
1241
|
call['handleCallEstablished']({});
|
|
875
1242
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
876
|
-
|
|
1243
|
+
_context17.next = 1;
|
|
877
1244
|
return _promise.default.resolve();
|
|
878
1245
|
case 1:
|
|
879
|
-
|
|
1246
|
+
_context17.next = 2;
|
|
880
1247
|
return _promise.default.resolve();
|
|
881
1248
|
case 2:
|
|
882
1249
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -886,14 +1253,14 @@ describe('State Machine handler tests', function () {
|
|
|
886
1253
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
887
1254
|
case 3:
|
|
888
1255
|
case "end":
|
|
889
|
-
return
|
|
1256
|
+
return _context17.stop();
|
|
890
1257
|
}
|
|
891
|
-
},
|
|
1258
|
+
}, _callee17);
|
|
892
1259
|
})));
|
|
893
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1260
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
894
1261
|
var statusPayload, funcSpy;
|
|
895
|
-
return _regenerator.default.wrap(function (
|
|
896
|
-
while (1) switch (
|
|
1262
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1263
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
897
1264
|
case 0:
|
|
898
1265
|
expect.assertions(4);
|
|
899
1266
|
statusPayload = {
|
|
@@ -912,7 +1279,7 @@ describe('State Machine handler tests', function () {
|
|
|
912
1279
|
/* This is to flush all the promises from the Promise queue so that
|
|
913
1280
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
914
1281
|
*/
|
|
915
|
-
|
|
1282
|
+
_context18.next = 1;
|
|
916
1283
|
return (0, _testUtil.flushPromises)(2);
|
|
917
1284
|
case 1:
|
|
918
1285
|
// clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
|
|
@@ -921,14 +1288,14 @@ describe('State Machine handler tests', function () {
|
|
|
921
1288
|
expect(funcSpy).toBeCalledTimes(1);
|
|
922
1289
|
case 2:
|
|
923
1290
|
case "end":
|
|
924
|
-
return
|
|
1291
|
+
return _context18.stop();
|
|
925
1292
|
}
|
|
926
|
-
},
|
|
1293
|
+
}, _callee18);
|
|
927
1294
|
})));
|
|
928
|
-
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1295
|
+
it('session refresh 500 schedules retry via retry-after or default interval', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
929
1296
|
var errorPayload, okPayload, scheduleKeepaliveSpy, postStatusSpy;
|
|
930
|
-
return _regenerator.default.wrap(function (
|
|
931
|
-
while (1) switch (
|
|
1297
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1298
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
932
1299
|
case 0:
|
|
933
1300
|
errorPayload = {
|
|
934
1301
|
statusCode: 500,
|
|
@@ -946,28 +1313,28 @@ describe('State Machine handler tests', function () {
|
|
|
946
1313
|
call['handleCallEstablished']({});
|
|
947
1314
|
}
|
|
948
1315
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
949
|
-
|
|
1316
|
+
_context19.next = 1;
|
|
950
1317
|
return (0, _testUtil.flushPromises)(2);
|
|
951
1318
|
case 1:
|
|
952
1319
|
expect(postStatusSpy).toHaveBeenCalledTimes(1);
|
|
953
1320
|
|
|
954
1321
|
// Now advance by 1 second for the retry-after interval
|
|
955
1322
|
jest.advanceTimersByTime(1000);
|
|
956
|
-
|
|
1323
|
+
_context19.next = 2;
|
|
957
1324
|
return (0, _testUtil.flushPromises)(2);
|
|
958
1325
|
case 2:
|
|
959
1326
|
expect(postStatusSpy).toHaveBeenCalledTimes(2);
|
|
960
1327
|
expect(scheduleKeepaliveSpy).toHaveBeenCalledTimes(2);
|
|
961
1328
|
case 3:
|
|
962
1329
|
case "end":
|
|
963
|
-
return
|
|
1330
|
+
return _context19.stop();
|
|
964
1331
|
}
|
|
965
|
-
},
|
|
1332
|
+
}, _callee19);
|
|
966
1333
|
})));
|
|
967
|
-
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1334
|
+
it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
968
1335
|
var firstTimer, secondTimer;
|
|
969
|
-
return _regenerator.default.wrap(function (
|
|
970
|
-
while (1) switch (
|
|
1336
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1337
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
971
1338
|
case 0:
|
|
972
1339
|
jest.spyOn(global, 'setInterval');
|
|
973
1340
|
jest.spyOn(global, 'clearInterval');
|
|
@@ -995,14 +1362,14 @@ describe('State Machine handler tests', function () {
|
|
|
995
1362
|
expect(secondTimer).toBeDefined();
|
|
996
1363
|
case 1:
|
|
997
1364
|
case "end":
|
|
998
|
-
return
|
|
1365
|
+
return _context20.stop();
|
|
999
1366
|
}
|
|
1000
|
-
},
|
|
1367
|
+
}, _callee20);
|
|
1001
1368
|
})));
|
|
1002
|
-
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1369
|
+
it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1003
1370
|
var errorPayload, warnSpy, postStatusSpy;
|
|
1004
|
-
return _regenerator.default.wrap(function (
|
|
1005
|
-
while (1) switch (
|
|
1371
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1372
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1006
1373
|
case 0:
|
|
1007
1374
|
errorPayload = {
|
|
1008
1375
|
statusCode: 500,
|
|
@@ -1021,25 +1388,25 @@ describe('State Machine handler tests', function () {
|
|
|
1021
1388
|
|
|
1022
1389
|
// Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
|
|
1023
1390
|
jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
|
|
1024
|
-
|
|
1391
|
+
_context21.next = 1;
|
|
1025
1392
|
return (0, _testUtil.flushPromises)(2);
|
|
1026
1393
|
case 1:
|
|
1027
1394
|
// Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
|
|
1028
1395
|
// Need to do this separately to allow state machine to process and create new intervals
|
|
1029
1396
|
jest.advanceTimersByTime(1000);
|
|
1030
|
-
|
|
1397
|
+
_context21.next = 2;
|
|
1031
1398
|
return (0, _testUtil.flushPromises)(2);
|
|
1032
1399
|
case 2:
|
|
1033
1400
|
jest.advanceTimersByTime(1000);
|
|
1034
|
-
|
|
1401
|
+
_context21.next = 3;
|
|
1035
1402
|
return (0, _testUtil.flushPromises)(2);
|
|
1036
1403
|
case 3:
|
|
1037
1404
|
jest.advanceTimersByTime(1000);
|
|
1038
|
-
|
|
1405
|
+
_context21.next = 4;
|
|
1039
1406
|
return (0, _testUtil.flushPromises)(2);
|
|
1040
1407
|
case 4:
|
|
1041
1408
|
jest.advanceTimersByTime(1000);
|
|
1042
|
-
|
|
1409
|
+
_context21.next = 5;
|
|
1043
1410
|
return (0, _testUtil.flushPromises)(2);
|
|
1044
1411
|
case 5:
|
|
1045
1412
|
// The error handler should detect we're at max retry count and stop
|
|
@@ -1051,14 +1418,14 @@ describe('State Machine handler tests', function () {
|
|
|
1051
1418
|
expect(call['callKeepaliveRetryCount']).toBe(4);
|
|
1052
1419
|
case 6:
|
|
1053
1420
|
case "end":
|
|
1054
|
-
return
|
|
1421
|
+
return _context21.stop();
|
|
1055
1422
|
}
|
|
1056
|
-
},
|
|
1423
|
+
}, _callee21);
|
|
1057
1424
|
})));
|
|
1058
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1425
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1059
1426
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
1060
|
-
return _regenerator.default.wrap(function (
|
|
1061
|
-
while (1) switch (
|
|
1427
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1428
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1062
1429
|
case 0:
|
|
1063
1430
|
statusPayload = {
|
|
1064
1431
|
statusCode: 200,
|
|
@@ -1114,14 +1481,14 @@ describe('State Machine handler tests', function () {
|
|
|
1114
1481
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1115
1482
|
case 1:
|
|
1116
1483
|
case "end":
|
|
1117
|
-
return
|
|
1484
|
+
return _context22.stop();
|
|
1118
1485
|
}
|
|
1119
|
-
},
|
|
1486
|
+
}, _callee22);
|
|
1120
1487
|
})));
|
|
1121
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1488
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1122
1489
|
var statusPayload, dummyEvent;
|
|
1123
|
-
return _regenerator.default.wrap(function (
|
|
1124
|
-
while (1) switch (
|
|
1490
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1491
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1125
1492
|
case 0:
|
|
1126
1493
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1127
1494
|
statusPayload = {
|
|
@@ -1139,7 +1506,7 @@ describe('State Machine handler tests', function () {
|
|
|
1139
1506
|
webex.request.mockReturnValue(statusPayload);
|
|
1140
1507
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1141
1508
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1142
|
-
|
|
1509
|
+
_context23.next = 1;
|
|
1143
1510
|
return call['handleOutgoingCallConnect']({
|
|
1144
1511
|
type: 'E_SEND_CALL_CONNECT'
|
|
1145
1512
|
});
|
|
@@ -1153,14 +1520,14 @@ describe('State Machine handler tests', function () {
|
|
|
1153
1520
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1154
1521
|
case 2:
|
|
1155
1522
|
case "end":
|
|
1156
|
-
return
|
|
1523
|
+
return _context23.stop();
|
|
1157
1524
|
}
|
|
1158
|
-
},
|
|
1525
|
+
}, _callee23);
|
|
1159
1526
|
})));
|
|
1160
|
-
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1527
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1161
1528
|
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1162
|
-
return _regenerator.default.wrap(function (
|
|
1163
|
-
while (1) switch (
|
|
1529
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1530
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1164
1531
|
case 0:
|
|
1165
1532
|
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1166
1533
|
statusPayload = {
|
|
@@ -1254,14 +1621,14 @@ describe('State Machine handler tests', function () {
|
|
|
1254
1621
|
expect(call.earlyMedia).not.toBe(true);
|
|
1255
1622
|
case 1:
|
|
1256
1623
|
case "end":
|
|
1257
|
-
return
|
|
1624
|
+
return _context24.stop();
|
|
1258
1625
|
}
|
|
1259
|
-
},
|
|
1626
|
+
}, _callee24);
|
|
1260
1627
|
})));
|
|
1261
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1628
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1262
1629
|
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1263
|
-
return _regenerator.default.wrap(function (
|
|
1264
|
-
while (1) switch (
|
|
1630
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1631
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1265
1632
|
case 0:
|
|
1266
1633
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1267
1634
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1288,7 +1655,7 @@ describe('State Machine handler tests', function () {
|
|
|
1288
1655
|
webex.request.mockRejectedValueOnce({
|
|
1289
1656
|
statusCode: 403
|
|
1290
1657
|
}).mockResolvedValue(statusPayload);
|
|
1291
|
-
|
|
1658
|
+
_context25.next = 1;
|
|
1292
1659
|
return call['handleOutgoingCallConnect']({
|
|
1293
1660
|
type: 'E_SEND_CALL_CONNECT'
|
|
1294
1661
|
});
|
|
@@ -1299,14 +1666,14 @@ describe('State Machine handler tests', function () {
|
|
|
1299
1666
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1300
1667
|
case 2:
|
|
1301
1668
|
case "end":
|
|
1302
|
-
return
|
|
1669
|
+
return _context25.stop();
|
|
1303
1670
|
}
|
|
1304
|
-
},
|
|
1671
|
+
}, _callee25);
|
|
1305
1672
|
})));
|
|
1306
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1673
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1307
1674
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1308
|
-
return _regenerator.default.wrap(function (
|
|
1309
|
-
while (1) switch (
|
|
1675
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1676
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1310
1677
|
case 0:
|
|
1311
1678
|
statusPayload = {
|
|
1312
1679
|
statusCode: 200,
|
|
@@ -1382,14 +1749,14 @@ describe('State Machine handler tests', function () {
|
|
|
1382
1749
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1383
1750
|
case 1:
|
|
1384
1751
|
case "end":
|
|
1385
|
-
return
|
|
1752
|
+
return _context26.stop();
|
|
1386
1753
|
}
|
|
1387
|
-
},
|
|
1754
|
+
}, _callee26);
|
|
1388
1755
|
})));
|
|
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
|
|
1756
|
+
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 _callee27() {
|
|
1390
1757
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1391
|
-
return _regenerator.default.wrap(function (
|
|
1392
|
-
while (1) switch (
|
|
1758
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1759
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1393
1760
|
case 0:
|
|
1394
1761
|
statusPayload = {
|
|
1395
1762
|
statusCode: 200,
|
|
@@ -1457,14 +1824,14 @@ describe('State Machine handler tests', function () {
|
|
|
1457
1824
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1458
1825
|
case 1:
|
|
1459
1826
|
case "end":
|
|
1460
|
-
return
|
|
1827
|
+
return _context27.stop();
|
|
1461
1828
|
}
|
|
1462
|
-
},
|
|
1829
|
+
}, _callee27);
|
|
1463
1830
|
})));
|
|
1464
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1831
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1465
1832
|
var statusPayload, dummyEvent;
|
|
1466
|
-
return _regenerator.default.wrap(function (
|
|
1467
|
-
while (1) switch (
|
|
1833
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1834
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1468
1835
|
case 0:
|
|
1469
1836
|
statusPayload = {
|
|
1470
1837
|
statusCode: 200,
|
|
@@ -1503,14 +1870,14 @@ describe('State Machine handler tests', function () {
|
|
|
1503
1870
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1504
1871
|
case 1:
|
|
1505
1872
|
case "end":
|
|
1506
|
-
return
|
|
1873
|
+
return _context28.stop();
|
|
1507
1874
|
}
|
|
1508
|
-
},
|
|
1875
|
+
}, _callee28);
|
|
1509
1876
|
})));
|
|
1510
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1877
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1511
1878
|
var statusPayload, dummyEvent, errorSpy;
|
|
1512
|
-
return _regenerator.default.wrap(function (
|
|
1513
|
-
while (1) switch (
|
|
1879
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1880
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1514
1881
|
case 0:
|
|
1515
1882
|
statusPayload = {
|
|
1516
1883
|
statusCode: 403,
|
|
@@ -1527,25 +1894,31 @@ describe('State Machine handler tests', function () {
|
|
|
1527
1894
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1528
1895
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1529
1896
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1530
|
-
|
|
1897
|
+
_context29.next = 1;
|
|
1531
1898
|
return (0, _testUtil.flushPromises)(3);
|
|
1532
1899
|
case 1:
|
|
1900
|
+
_context29.next = 2;
|
|
1901
|
+
return _promise.default.resolve();
|
|
1902
|
+
case 2:
|
|
1903
|
+
_context29.next = 3;
|
|
1904
|
+
return _promise.default.resolve();
|
|
1905
|
+
case 3:
|
|
1533
1906
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1534
1907
|
expect(errorSpy).toHaveBeenCalled();
|
|
1535
1908
|
expect(uploadLogsSpy).toHaveBeenCalledWith({
|
|
1536
1909
|
correlationId: call.getCorrelationId(),
|
|
1537
1910
|
callId: call.getCallId()
|
|
1538
1911
|
});
|
|
1539
|
-
case
|
|
1912
|
+
case 4:
|
|
1540
1913
|
case "end":
|
|
1541
|
-
return
|
|
1914
|
+
return _context29.stop();
|
|
1542
1915
|
}
|
|
1543
|
-
},
|
|
1916
|
+
}, _callee29);
|
|
1544
1917
|
})));
|
|
1545
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1918
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1546
1919
|
var statusPayload, dummyEvent, warnSpy;
|
|
1547
|
-
return _regenerator.default.wrap(function (
|
|
1548
|
-
while (1) switch (
|
|
1920
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1921
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1549
1922
|
case 0:
|
|
1550
1923
|
statusPayload = {
|
|
1551
1924
|
statusCode: 403,
|
|
@@ -1564,12 +1937,18 @@ describe('State Machine handler tests', function () {
|
|
|
1564
1937
|
webex.request.mockRejectedValue(statusPayload);
|
|
1565
1938
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1566
1939
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1567
|
-
|
|
1940
|
+
_context30.next = 1;
|
|
1568
1941
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1569
1942
|
case 1:
|
|
1570
|
-
|
|
1943
|
+
_context30.next = 2;
|
|
1571
1944
|
return (0, _testUtil.flushPromises)(2);
|
|
1572
1945
|
case 2:
|
|
1946
|
+
_context30.next = 3;
|
|
1947
|
+
return _promise.default.resolve();
|
|
1948
|
+
case 3:
|
|
1949
|
+
_context30.next = 4;
|
|
1950
|
+
return _promise.default.resolve();
|
|
1951
|
+
case 4:
|
|
1573
1952
|
expect(call.isConnected()).toBe(false);
|
|
1574
1953
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1575
1954
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
@@ -1581,16 +1960,16 @@ describe('State Machine handler tests', function () {
|
|
|
1581
1960
|
file: 'call',
|
|
1582
1961
|
method: 'handleRoapError'
|
|
1583
1962
|
});
|
|
1584
|
-
case
|
|
1963
|
+
case 5:
|
|
1585
1964
|
case "end":
|
|
1586
|
-
return
|
|
1965
|
+
return _context30.stop();
|
|
1587
1966
|
}
|
|
1588
|
-
},
|
|
1967
|
+
}, _callee30);
|
|
1589
1968
|
})));
|
|
1590
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1969
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1591
1970
|
var statusPayload, dummyEvent;
|
|
1592
|
-
return _regenerator.default.wrap(function (
|
|
1593
|
-
while (1) switch (
|
|
1971
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1972
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1594
1973
|
case 0:
|
|
1595
1974
|
statusPayload = {
|
|
1596
1975
|
statusCode: 403,
|
|
@@ -1613,14 +1992,14 @@ describe('State Machine handler tests', function () {
|
|
|
1613
1992
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1614
1993
|
case 1:
|
|
1615
1994
|
case "end":
|
|
1616
|
-
return
|
|
1995
|
+
return _context31.stop();
|
|
1617
1996
|
}
|
|
1618
|
-
},
|
|
1997
|
+
}, _callee31);
|
|
1619
1998
|
})));
|
|
1620
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1999
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1621
2000
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1622
|
-
return _regenerator.default.wrap(function (
|
|
1623
|
-
while (1) switch (
|
|
2001
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
2002
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1624
2003
|
case 0:
|
|
1625
2004
|
statusPayload = {
|
|
1626
2005
|
statusCode: 503,
|
|
@@ -1642,7 +2021,7 @@ describe('State Machine handler tests', function () {
|
|
|
1642
2021
|
}
|
|
1643
2022
|
};
|
|
1644
2023
|
call['connected'] = true;
|
|
1645
|
-
|
|
2024
|
+
_context32.next = 1;
|
|
1646
2025
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1647
2026
|
case 1:
|
|
1648
2027
|
jest.advanceTimersByTime(1005);
|
|
@@ -1654,14 +2033,14 @@ describe('State Machine handler tests', function () {
|
|
|
1654
2033
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1655
2034
|
case 2:
|
|
1656
2035
|
case "end":
|
|
1657
|
-
return
|
|
2036
|
+
return _context32.stop();
|
|
1658
2037
|
}
|
|
1659
|
-
},
|
|
2038
|
+
}, _callee32);
|
|
1660
2039
|
})));
|
|
1661
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2040
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1662
2041
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1663
|
-
return _regenerator.default.wrap(function (
|
|
1664
|
-
while (1) switch (
|
|
2042
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
2043
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1665
2044
|
case 0:
|
|
1666
2045
|
statusPayload = {
|
|
1667
2046
|
statusCode: 503,
|
|
@@ -1683,7 +2062,7 @@ describe('State Machine handler tests', function () {
|
|
|
1683
2062
|
}
|
|
1684
2063
|
};
|
|
1685
2064
|
call['connected'] = false;
|
|
1686
|
-
|
|
2065
|
+
_context33.next = 1;
|
|
1687
2066
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1688
2067
|
case 1:
|
|
1689
2068
|
jest.advanceTimersByTime(1005);
|
|
@@ -1694,14 +2073,14 @@ describe('State Machine handler tests', function () {
|
|
|
1694
2073
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1695
2074
|
case 2:
|
|
1696
2075
|
case "end":
|
|
1697
|
-
return
|
|
2076
|
+
return _context33.stop();
|
|
1698
2077
|
}
|
|
1699
|
-
},
|
|
2078
|
+
}, _callee33);
|
|
1700
2079
|
})));
|
|
1701
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2080
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1702
2081
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1703
|
-
return _regenerator.default.wrap(function (
|
|
1704
|
-
while (1) switch (
|
|
2082
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
2083
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1705
2084
|
case 0:
|
|
1706
2085
|
statusPayload = {
|
|
1707
2086
|
statusCode: 503,
|
|
@@ -1723,7 +2102,7 @@ describe('State Machine handler tests', function () {
|
|
|
1723
2102
|
};
|
|
1724
2103
|
call['connected'] = true;
|
|
1725
2104
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1726
|
-
|
|
2105
|
+
_context34.next = 1;
|
|
1727
2106
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1728
2107
|
case 1:
|
|
1729
2108
|
jest.advanceTimersByTime(1005);
|
|
@@ -1735,14 +2114,14 @@ describe('State Machine handler tests', function () {
|
|
|
1735
2114
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1736
2115
|
case 2:
|
|
1737
2116
|
case "end":
|
|
1738
|
-
return
|
|
2117
|
+
return _context34.stop();
|
|
1739
2118
|
}
|
|
1740
|
-
},
|
|
2119
|
+
}, _callee34);
|
|
1741
2120
|
})));
|
|
1742
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2121
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1743
2122
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1744
|
-
return _regenerator.default.wrap(function (
|
|
1745
|
-
while (1) switch (
|
|
2123
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
2124
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1746
2125
|
case 0:
|
|
1747
2126
|
statusPayload = {
|
|
1748
2127
|
statusCode: 503,
|
|
@@ -1763,7 +2142,7 @@ describe('State Machine handler tests', function () {
|
|
|
1763
2142
|
}
|
|
1764
2143
|
};
|
|
1765
2144
|
call['connected'] = false;
|
|
1766
|
-
|
|
2145
|
+
_context35.next = 1;
|
|
1767
2146
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1768
2147
|
case 1:
|
|
1769
2148
|
jest.advanceTimersByTime(1005);
|
|
@@ -1775,14 +2154,14 @@ describe('State Machine handler tests', function () {
|
|
|
1775
2154
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1776
2155
|
case 2:
|
|
1777
2156
|
case "end":
|
|
1778
|
-
return
|
|
2157
|
+
return _context35.stop();
|
|
1779
2158
|
}
|
|
1780
|
-
},
|
|
2159
|
+
}, _callee35);
|
|
1781
2160
|
})));
|
|
1782
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2161
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1783
2162
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1784
|
-
return _regenerator.default.wrap(function (
|
|
1785
|
-
while (1) switch (
|
|
2163
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
2164
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1786
2165
|
case 0:
|
|
1787
2166
|
statusPayload = {
|
|
1788
2167
|
statusCode: 200,
|
|
@@ -1807,14 +2186,14 @@ describe('State Machine handler tests', function () {
|
|
|
1807
2186
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1808
2187
|
case 1:
|
|
1809
2188
|
case "end":
|
|
1810
|
-
return
|
|
2189
|
+
return _context36.stop();
|
|
1811
2190
|
}
|
|
1812
|
-
},
|
|
2191
|
+
}, _callee36);
|
|
1813
2192
|
})));
|
|
1814
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2193
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1815
2194
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1816
|
-
return _regenerator.default.wrap(function (
|
|
1817
|
-
while (1) switch (
|
|
2195
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
2196
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1818
2197
|
case 0:
|
|
1819
2198
|
statusPayload = {
|
|
1820
2199
|
statusCode: 503,
|
|
@@ -1836,7 +2215,7 @@ describe('State Machine handler tests', function () {
|
|
|
1836
2215
|
};
|
|
1837
2216
|
call['connected'] = true;
|
|
1838
2217
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1839
|
-
|
|
2218
|
+
_context37.next = 1;
|
|
1840
2219
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1841
2220
|
case 1:
|
|
1842
2221
|
jest.advanceTimersByTime(1005);
|
|
@@ -1848,14 +2227,14 @@ describe('State Machine handler tests', function () {
|
|
|
1848
2227
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1849
2228
|
case 2:
|
|
1850
2229
|
case "end":
|
|
1851
|
-
return
|
|
2230
|
+
return _context37.stop();
|
|
1852
2231
|
}
|
|
1853
|
-
},
|
|
2232
|
+
}, _callee37);
|
|
1854
2233
|
})));
|
|
1855
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2234
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1856
2235
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1857
|
-
return _regenerator.default.wrap(function (
|
|
1858
|
-
while (1) switch (
|
|
2236
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2237
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1859
2238
|
case 0:
|
|
1860
2239
|
statusPayload = {
|
|
1861
2240
|
statusCode: 403,
|
|
@@ -1878,14 +2257,14 @@ describe('State Machine handler tests', function () {
|
|
|
1878
2257
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1879
2258
|
case 1:
|
|
1880
2259
|
case "end":
|
|
1881
|
-
return
|
|
2260
|
+
return _context38.stop();
|
|
1882
2261
|
}
|
|
1883
|
-
},
|
|
2262
|
+
}, _callee38);
|
|
1884
2263
|
})));
|
|
1885
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2264
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1886
2265
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1887
|
-
return _regenerator.default.wrap(function (
|
|
1888
|
-
while (1) switch (
|
|
2266
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2267
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1889
2268
|
case 0:
|
|
1890
2269
|
statusPayload = {
|
|
1891
2270
|
statusCode: 200,
|
|
@@ -1903,7 +2282,7 @@ describe('State Machine handler tests', function () {
|
|
|
1903
2282
|
}
|
|
1904
2283
|
};
|
|
1905
2284
|
call['connected'] = false;
|
|
1906
|
-
|
|
2285
|
+
_context39.next = 1;
|
|
1907
2286
|
return call['handleRoapError']({}, errorEvent);
|
|
1908
2287
|
case 1:
|
|
1909
2288
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1919,14 +2298,14 @@ describe('State Machine handler tests', function () {
|
|
|
1919
2298
|
});
|
|
1920
2299
|
case 2:
|
|
1921
2300
|
case "end":
|
|
1922
|
-
return
|
|
2301
|
+
return _context39.stop();
|
|
1923
2302
|
}
|
|
1924
|
-
},
|
|
2303
|
+
}, _callee39);
|
|
1925
2304
|
})));
|
|
1926
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2305
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1927
2306
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1928
|
-
return _regenerator.default.wrap(function (
|
|
1929
|
-
while (1) switch (
|
|
2307
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2308
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1930
2309
|
case 0:
|
|
1931
2310
|
statusPayload = {
|
|
1932
2311
|
statusCode: 403,
|
|
@@ -1964,12 +2343,18 @@ describe('State Machine handler tests', function () {
|
|
|
1964
2343
|
messageType: 'ANSWER'
|
|
1965
2344
|
}
|
|
1966
2345
|
};
|
|
1967
|
-
|
|
2346
|
+
_context40.next = 1;
|
|
1968
2347
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1969
2348
|
case 1:
|
|
1970
|
-
|
|
2349
|
+
_context40.next = 2;
|
|
1971
2350
|
return (0, _testUtil.flushPromises)(2);
|
|
1972
2351
|
case 2:
|
|
2352
|
+
_context40.next = 3;
|
|
2353
|
+
return _promise.default.resolve();
|
|
2354
|
+
case 3:
|
|
2355
|
+
_context40.next = 4;
|
|
2356
|
+
return _promise.default.resolve();
|
|
2357
|
+
case 4:
|
|
1973
2358
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
1974
2359
|
expect(warnSpy).toHaveBeenCalledWith('Failed to send MediaAnswer request', {
|
|
1975
2360
|
file: 'call',
|
|
@@ -1983,16 +2368,16 @@ describe('State Machine handler tests', function () {
|
|
|
1983
2368
|
// Final state should be torn down and cleared for unconnected call
|
|
1984
2369
|
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1985
2370
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1986
|
-
case
|
|
2371
|
+
case 5:
|
|
1987
2372
|
case "end":
|
|
1988
|
-
return
|
|
2373
|
+
return _context40.stop();
|
|
1989
2374
|
}
|
|
1990
|
-
},
|
|
2375
|
+
}, _callee40);
|
|
1991
2376
|
})));
|
|
1992
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2377
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
1993
2378
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1994
|
-
return _regenerator.default.wrap(function (
|
|
1995
|
-
while (1) switch (
|
|
2379
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2380
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
1996
2381
|
case 0:
|
|
1997
2382
|
statusPayload = {
|
|
1998
2383
|
statusCode: 200,
|
|
@@ -2025,7 +2410,7 @@ describe('State Machine handler tests', function () {
|
|
|
2025
2410
|
seq: 1,
|
|
2026
2411
|
messageType: 'ANSWER'
|
|
2027
2412
|
};
|
|
2028
|
-
|
|
2413
|
+
_context41.next = 1;
|
|
2029
2414
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2030
2415
|
case 1:
|
|
2031
2416
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2047,7 +2432,7 @@ describe('State Machine handler tests', function () {
|
|
|
2047
2432
|
seq: 2,
|
|
2048
2433
|
messageType: 'OFFER_REQUEST'
|
|
2049
2434
|
};
|
|
2050
|
-
|
|
2435
|
+
_context41.next = 2;
|
|
2051
2436
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2052
2437
|
case 2:
|
|
2053
2438
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2097,7 +2482,7 @@ describe('State Machine handler tests', function () {
|
|
|
2097
2482
|
};
|
|
2098
2483
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2099
2484
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2100
|
-
|
|
2485
|
+
_context41.next = 3;
|
|
2101
2486
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2102
2487
|
case 3:
|
|
2103
2488
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2106,7 +2491,7 @@ describe('State Machine handler tests', function () {
|
|
|
2106
2491
|
seq: 3,
|
|
2107
2492
|
messageType: 'ANSWER'
|
|
2108
2493
|
};
|
|
2109
|
-
|
|
2494
|
+
_context41.next = 4;
|
|
2110
2495
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2111
2496
|
case 4:
|
|
2112
2497
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2125,7 +2510,7 @@ describe('State Machine handler tests', function () {
|
|
|
2125
2510
|
messageType: 'OK'
|
|
2126
2511
|
}
|
|
2127
2512
|
};
|
|
2128
|
-
|
|
2513
|
+
_context41.next = 5;
|
|
2129
2514
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2130
2515
|
case 5:
|
|
2131
2516
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -2140,14 +2525,14 @@ describe('State Machine handler tests', function () {
|
|
|
2140
2525
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2141
2526
|
case 6:
|
|
2142
2527
|
case "end":
|
|
2143
|
-
return
|
|
2528
|
+
return _context41.stop();
|
|
2144
2529
|
}
|
|
2145
|
-
},
|
|
2530
|
+
}, _callee41);
|
|
2146
2531
|
})));
|
|
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
|
|
2532
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2148
2533
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2149
|
-
return _regenerator.default.wrap(function (
|
|
2150
|
-
while (1) switch (
|
|
2534
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2535
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2151
2536
|
case 0:
|
|
2152
2537
|
mockStatusBody = {
|
|
2153
2538
|
device: {
|
|
@@ -2187,7 +2572,7 @@ describe('State Machine handler tests', function () {
|
|
|
2187
2572
|
seq: 1,
|
|
2188
2573
|
messageType: 'ANSWER'
|
|
2189
2574
|
};
|
|
2190
|
-
|
|
2575
|
+
_context42.next = 1;
|
|
2191
2576
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2192
2577
|
case 1:
|
|
2193
2578
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2209,7 +2594,7 @@ describe('State Machine handler tests', function () {
|
|
|
2209
2594
|
seq: 2,
|
|
2210
2595
|
messageType: 'OFFER_REQUEST'
|
|
2211
2596
|
};
|
|
2212
|
-
|
|
2597
|
+
_context42.next = 2;
|
|
2213
2598
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2214
2599
|
case 2:
|
|
2215
2600
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2259,7 +2644,7 @@ describe('State Machine handler tests', function () {
|
|
|
2259
2644
|
};
|
|
2260
2645
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2261
2646
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2262
|
-
|
|
2647
|
+
_context42.next = 3;
|
|
2263
2648
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2264
2649
|
case 3:
|
|
2265
2650
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2268,7 +2653,7 @@ describe('State Machine handler tests', function () {
|
|
|
2268
2653
|
seq: 3,
|
|
2269
2654
|
messageType: 'ANSWER'
|
|
2270
2655
|
};
|
|
2271
|
-
|
|
2656
|
+
_context42.next = 4;
|
|
2272
2657
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2273
2658
|
case 4:
|
|
2274
2659
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2285,7 +2670,7 @@ describe('State Machine handler tests', function () {
|
|
|
2285
2670
|
}
|
|
2286
2671
|
};
|
|
2287
2672
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2288
|
-
|
|
2673
|
+
_context42.next = 5;
|
|
2289
2674
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2290
2675
|
case 5:
|
|
2291
2676
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2301,14 +2686,14 @@ describe('State Machine handler tests', function () {
|
|
|
2301
2686
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2302
2687
|
case 6:
|
|
2303
2688
|
case "end":
|
|
2304
|
-
return
|
|
2689
|
+
return _context42.stop();
|
|
2305
2690
|
}
|
|
2306
|
-
},
|
|
2691
|
+
}, _callee42);
|
|
2307
2692
|
})));
|
|
2308
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2693
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2309
2694
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2310
|
-
return _regenerator.default.wrap(function (
|
|
2311
|
-
while (1) switch (
|
|
2695
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2696
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2312
2697
|
case 0:
|
|
2313
2698
|
statusPayload = {
|
|
2314
2699
|
statusCode: 200,
|
|
@@ -2369,20 +2754,20 @@ describe('State Machine handler tests', function () {
|
|
|
2369
2754
|
dummyEvent.data = undefined;
|
|
2370
2755
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2371
2756
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_HOLD');
|
|
2372
|
-
expect(infoSpy).
|
|
2757
|
+
expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(call.getCorrelationId()), {
|
|
2373
2758
|
file: 'call',
|
|
2374
2759
|
method: 'handleCallHold'
|
|
2375
2760
|
});
|
|
2376
2761
|
case 1:
|
|
2377
2762
|
case "end":
|
|
2378
|
-
return
|
|
2763
|
+
return _context43.stop();
|
|
2379
2764
|
}
|
|
2380
|
-
},
|
|
2765
|
+
}, _callee43);
|
|
2381
2766
|
})));
|
|
2382
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2767
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2383
2768
|
var emitSpy, deleteSpy;
|
|
2384
|
-
return _regenerator.default.wrap(function (
|
|
2385
|
-
while (1) switch (
|
|
2769
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2770
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2386
2771
|
case 0:
|
|
2387
2772
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2388
2773
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2391,7 +2776,7 @@ describe('State Machine handler tests', function () {
|
|
|
2391
2776
|
call.sendCallStateMachineEvt({
|
|
2392
2777
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2393
2778
|
});
|
|
2394
|
-
|
|
2779
|
+
_context44.next = 1;
|
|
2395
2780
|
return (0, _testUtil.flushPromises)(1);
|
|
2396
2781
|
case 1:
|
|
2397
2782
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2399,9 +2784,9 @@ describe('State Machine handler tests', function () {
|
|
|
2399
2784
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2400
2785
|
case 2:
|
|
2401
2786
|
case "end":
|
|
2402
|
-
return
|
|
2787
|
+
return _context44.stop();
|
|
2403
2788
|
}
|
|
2404
|
-
},
|
|
2789
|
+
}, _callee44);
|
|
2405
2790
|
})));
|
|
2406
2791
|
describe('Call event timers tests', function () {
|
|
2407
2792
|
var callManager;
|
|
@@ -2412,10 +2797,10 @@ describe('State Machine handler tests', function () {
|
|
|
2412
2797
|
afterEach(function () {
|
|
2413
2798
|
jest.clearAllTimers();
|
|
2414
2799
|
});
|
|
2415
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2800
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2416
2801
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2417
|
-
return _regenerator.default.wrap(function (
|
|
2418
|
-
while (1) switch (
|
|
2802
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2803
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2419
2804
|
case 0:
|
|
2420
2805
|
statusPayload = {
|
|
2421
2806
|
statusCode: 200,
|
|
@@ -2432,7 +2817,7 @@ describe('State Machine handler tests', function () {
|
|
|
2432
2817
|
webex.request.mockReturnValue(statusPayload);
|
|
2433
2818
|
|
|
2434
2819
|
// handleOutgoingCallSetup is asynchronous
|
|
2435
|
-
|
|
2820
|
+
_context45.next = 1;
|
|
2436
2821
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2437
2822
|
case 1:
|
|
2438
2823
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2475,14 +2860,14 @@ describe('State Machine handler tests', function () {
|
|
|
2475
2860
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2476
2861
|
case 2:
|
|
2477
2862
|
case "end":
|
|
2478
|
-
return
|
|
2863
|
+
return _context45.stop();
|
|
2479
2864
|
}
|
|
2480
|
-
},
|
|
2865
|
+
}, _callee45);
|
|
2481
2866
|
})));
|
|
2482
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2867
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2483
2868
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2484
|
-
return _regenerator.default.wrap(function (
|
|
2485
|
-
while (1) switch (
|
|
2869
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2870
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2486
2871
|
case 0:
|
|
2487
2872
|
statusPayload = {
|
|
2488
2873
|
statusCode: 200,
|
|
@@ -2501,7 +2886,7 @@ describe('State Machine handler tests', function () {
|
|
|
2501
2886
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2502
2887
|
|
|
2503
2888
|
// handleOutgoingCallSetup is asynchronous
|
|
2504
|
-
|
|
2889
|
+
_context46.next = 1;
|
|
2505
2890
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2506
2891
|
case 1:
|
|
2507
2892
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2513,9 +2898,9 @@ describe('State Machine handler tests', function () {
|
|
|
2513
2898
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2514
2899
|
case 2:
|
|
2515
2900
|
case "end":
|
|
2516
|
-
return
|
|
2901
|
+
return _context46.stop();
|
|
2517
2902
|
}
|
|
2518
|
-
},
|
|
2903
|
+
}, _callee46);
|
|
2519
2904
|
})));
|
|
2520
2905
|
});
|
|
2521
2906
|
});
|
|
@@ -2534,6 +2919,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2534
2919
|
};
|
|
2535
2920
|
var call;
|
|
2536
2921
|
beforeEach(function () {
|
|
2922
|
+
_request.APIRequest.resetInstance();
|
|
2923
|
+
_request.APIRequest.getInstance({
|
|
2924
|
+
webex: webex,
|
|
2925
|
+
isMobiusSocketEnabled: false
|
|
2926
|
+
});
|
|
2537
2927
|
/* Since we are not actually testing from the start of a call , so it's good to set the below
|
|
2538
2928
|
* parameters manually
|
|
2539
2929
|
*/
|
|
@@ -2575,10 +2965,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2575
2965
|
beforeEach(function () {
|
|
2576
2966
|
call.removeAllListeners();
|
|
2577
2967
|
});
|
|
2578
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2968
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2579
2969
|
var responsePayload, warnSpy, roapEvent;
|
|
2580
|
-
return _regenerator.default.wrap(function (
|
|
2581
|
-
while (1) switch (
|
|
2970
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2971
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2582
2972
|
case 0:
|
|
2583
2973
|
expect.assertions(7);
|
|
2584
2974
|
responsePayload = {
|
|
@@ -2591,25 +2981,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2591
2981
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2592
2982
|
call['held'] = false;
|
|
2593
2983
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2594
|
-
var
|
|
2595
|
-
return _regenerator.default.wrap(function (
|
|
2596
|
-
while (1) switch (
|
|
2984
|
+
var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(correlationId) {
|
|
2985
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2986
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2597
2987
|
case 0:
|
|
2598
2988
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2599
2989
|
case 1:
|
|
2600
2990
|
case "end":
|
|
2601
|
-
return
|
|
2991
|
+
return _context47.stop();
|
|
2602
2992
|
}
|
|
2603
|
-
},
|
|
2993
|
+
}, _callee47);
|
|
2604
2994
|
}));
|
|
2605
2995
|
return function (_x) {
|
|
2606
|
-
return
|
|
2996
|
+
return _ref57.apply(this, arguments);
|
|
2607
2997
|
};
|
|
2608
2998
|
}());
|
|
2609
|
-
|
|
2999
|
+
_context48.next = 1;
|
|
2610
3000
|
return call.doHoldResume();
|
|
2611
3001
|
case 1:
|
|
2612
|
-
|
|
3002
|
+
_context48.next = 2;
|
|
2613
3003
|
return (0, _testUtil.flushPromises)(2);
|
|
2614
3004
|
case 2:
|
|
2615
3005
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2625,11 +3015,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2625
3015
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2626
3016
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2627
3017
|
roapEvent.data.type = 'ANSWER';
|
|
2628
|
-
|
|
3018
|
+
_context48.next = 3;
|
|
2629
3019
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2630
3020
|
case 3:
|
|
2631
3021
|
roapEvent.data.type = 'OK';
|
|
2632
|
-
|
|
3022
|
+
_context48.next = 4;
|
|
2633
3023
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2634
3024
|
case 4:
|
|
2635
3025
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2644,14 +3034,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2644
3034
|
});
|
|
2645
3035
|
case 5:
|
|
2646
3036
|
case "end":
|
|
2647
|
-
return
|
|
3037
|
+
return _context48.stop();
|
|
2648
3038
|
}
|
|
2649
|
-
},
|
|
3039
|
+
}, _callee48);
|
|
2650
3040
|
})));
|
|
2651
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3041
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2652
3042
|
var responsePayload, warnSpy, roapEvent;
|
|
2653
|
-
return _regenerator.default.wrap(function (
|
|
2654
|
-
while (1) switch (
|
|
3043
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
3044
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2655
3045
|
case 0:
|
|
2656
3046
|
expect.assertions(8);
|
|
2657
3047
|
responsePayload = {
|
|
@@ -2664,26 +3054,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2664
3054
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2665
3055
|
call['held'] = false;
|
|
2666
3056
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2667
|
-
var
|
|
2668
|
-
return _regenerator.default.wrap(function (
|
|
2669
|
-
while (1) switch (
|
|
3057
|
+
var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(correlationId) {
|
|
3058
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
3059
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2670
3060
|
case 0:
|
|
2671
3061
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2672
3062
|
case 1:
|
|
2673
3063
|
case "end":
|
|
2674
|
-
return
|
|
3064
|
+
return _context49.stop();
|
|
2675
3065
|
}
|
|
2676
|
-
},
|
|
3066
|
+
}, _callee49);
|
|
2677
3067
|
}));
|
|
2678
3068
|
return function (_x2) {
|
|
2679
|
-
return
|
|
3069
|
+
return _ref59.apply(this, arguments);
|
|
2680
3070
|
};
|
|
2681
3071
|
}());
|
|
2682
3072
|
call.doHoldResume();
|
|
2683
|
-
|
|
3073
|
+
_context50.next = 1;
|
|
2684
3074
|
return _promise.default.resolve();
|
|
2685
3075
|
case 1:
|
|
2686
|
-
|
|
3076
|
+
_context50.next = 2;
|
|
2687
3077
|
return _promise.default.resolve();
|
|
2688
3078
|
case 2:
|
|
2689
3079
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2699,11 +3089,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2699
3089
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2700
3090
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2701
3091
|
roapEvent.data.type = 'ANSWER';
|
|
2702
|
-
|
|
3092
|
+
_context50.next = 3;
|
|
2703
3093
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2704
3094
|
case 3:
|
|
2705
3095
|
roapEvent.data.type = 'OK';
|
|
2706
|
-
|
|
3096
|
+
_context50.next = 4;
|
|
2707
3097
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2708
3098
|
case 4:
|
|
2709
3099
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2718,14 +3108,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2718
3108
|
});
|
|
2719
3109
|
case 5:
|
|
2720
3110
|
case "end":
|
|
2721
|
-
return
|
|
3111
|
+
return _context50.stop();
|
|
2722
3112
|
}
|
|
2723
|
-
},
|
|
3113
|
+
}, _callee50);
|
|
2724
3114
|
})));
|
|
2725
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3115
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2726
3116
|
var responsePayload;
|
|
2727
|
-
return _regenerator.default.wrap(function (
|
|
2728
|
-
while (1) switch (
|
|
3117
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
3118
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2729
3119
|
case 0:
|
|
2730
3120
|
expect.assertions(4);
|
|
2731
3121
|
responsePayload = {
|
|
@@ -2735,26 +3125,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2735
3125
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2736
3126
|
call['held'] = false;
|
|
2737
3127
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2738
|
-
var
|
|
2739
|
-
return _regenerator.default.wrap(function (
|
|
2740
|
-
while (1) switch (
|
|
3128
|
+
var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
|
|
3129
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
3130
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2741
3131
|
case 0:
|
|
2742
3132
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2743
3133
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2744
3134
|
case 1:
|
|
2745
3135
|
case "end":
|
|
2746
|
-
return
|
|
3136
|
+
return _context51.stop();
|
|
2747
3137
|
}
|
|
2748
|
-
},
|
|
3138
|
+
}, _callee51);
|
|
2749
3139
|
}));
|
|
2750
3140
|
return function (_x3) {
|
|
2751
|
-
return
|
|
3141
|
+
return _ref61.apply(this, arguments);
|
|
2752
3142
|
};
|
|
2753
3143
|
}());
|
|
2754
|
-
|
|
3144
|
+
_context52.next = 1;
|
|
2755
3145
|
return call.doHoldResume();
|
|
2756
3146
|
case 1:
|
|
2757
|
-
|
|
3147
|
+
_context52.next = 2;
|
|
2758
3148
|
return (0, _testUtil.flushPromises)(2);
|
|
2759
3149
|
case 2:
|
|
2760
3150
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2764,14 +3154,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2764
3154
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2765
3155
|
case 3:
|
|
2766
3156
|
case "end":
|
|
2767
|
-
return
|
|
3157
|
+
return _context52.stop();
|
|
2768
3158
|
}
|
|
2769
|
-
},
|
|
3159
|
+
}, _callee52);
|
|
2770
3160
|
})));
|
|
2771
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3161
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2772
3162
|
var responsePayload, rejectPayload, roapEvent;
|
|
2773
|
-
return _regenerator.default.wrap(function (
|
|
2774
|
-
while (1) switch (
|
|
3163
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
3164
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2775
3165
|
case 0:
|
|
2776
3166
|
expect.assertions(5);
|
|
2777
3167
|
responsePayload = {
|
|
@@ -2785,24 +3175,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2785
3175
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2786
3176
|
call['held'] = false;
|
|
2787
3177
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2788
|
-
var
|
|
2789
|
-
return _regenerator.default.wrap(function (
|
|
2790
|
-
while (1) switch (
|
|
3178
|
+
var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(errObj) {
|
|
3179
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
3180
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2791
3181
|
case 0:
|
|
2792
3182
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2793
3183
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2794
3184
|
case 1:
|
|
2795
3185
|
case "end":
|
|
2796
|
-
return
|
|
3186
|
+
return _context53.stop();
|
|
2797
3187
|
}
|
|
2798
|
-
},
|
|
3188
|
+
}, _callee53);
|
|
2799
3189
|
}));
|
|
2800
3190
|
return function (_x4) {
|
|
2801
|
-
return
|
|
3191
|
+
return _ref63.apply(this, arguments);
|
|
2802
3192
|
};
|
|
2803
3193
|
}());
|
|
2804
3194
|
call.doHoldResume();
|
|
2805
|
-
|
|
3195
|
+
_context54.next = 1;
|
|
2806
3196
|
return (0, _testUtil.flushPromises)(2);
|
|
2807
3197
|
case 1:
|
|
2808
3198
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2812,7 +3202,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2812
3202
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2813
3203
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2814
3204
|
roapEvent.data.type = 'ANSWER';
|
|
2815
|
-
|
|
3205
|
+
_context54.next = 2;
|
|
2816
3206
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2817
3207
|
case 2:
|
|
2818
3208
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2820,14 +3210,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2820
3210
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2821
3211
|
case 3:
|
|
2822
3212
|
case "end":
|
|
2823
|
-
return
|
|
3213
|
+
return _context54.stop();
|
|
2824
3214
|
}
|
|
2825
|
-
},
|
|
3215
|
+
}, _callee54);
|
|
2826
3216
|
})));
|
|
2827
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3217
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2828
3218
|
var responsePayload, warnSpy, roapEvent;
|
|
2829
|
-
return _regenerator.default.wrap(function (
|
|
2830
|
-
while (1) switch (
|
|
3219
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
3220
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2831
3221
|
case 0:
|
|
2832
3222
|
responsePayload = {
|
|
2833
3223
|
statusCode: 200,
|
|
@@ -2838,10 +3228,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2838
3228
|
jest.spyOn(global, 'clearTimeout');
|
|
2839
3229
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2840
3230
|
call['held'] = false;
|
|
2841
|
-
|
|
3231
|
+
_context55.next = 1;
|
|
2842
3232
|
return call.doHoldResume();
|
|
2843
3233
|
case 1:
|
|
2844
|
-
|
|
3234
|
+
_context55.next = 2;
|
|
2845
3235
|
return (0, _testUtil.flushPromises)(2);
|
|
2846
3236
|
case 2:
|
|
2847
3237
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2856,19 +3246,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2856
3246
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2857
3247
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2858
3248
|
roapEvent.data.type = 'ANSWER';
|
|
2859
|
-
|
|
3249
|
+
_context55.next = 3;
|
|
2860
3250
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2861
3251
|
case 3:
|
|
2862
3252
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2863
3253
|
statusCode: 403
|
|
2864
3254
|
});
|
|
2865
3255
|
roapEvent.data.type = 'OK';
|
|
2866
|
-
|
|
3256
|
+
_context55.next = 4;
|
|
2867
3257
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2868
3258
|
case 4:
|
|
2869
3259
|
/* this is for coverage */
|
|
2870
3260
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2871
|
-
|
|
3261
|
+
_context55.next = 5;
|
|
2872
3262
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2873
3263
|
case 5:
|
|
2874
3264
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2880,14 +3270,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2880
3270
|
});
|
|
2881
3271
|
case 6:
|
|
2882
3272
|
case "end":
|
|
2883
|
-
return
|
|
3273
|
+
return _context55.stop();
|
|
2884
3274
|
}
|
|
2885
|
-
},
|
|
3275
|
+
}, _callee55);
|
|
2886
3276
|
})));
|
|
2887
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3277
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
2888
3278
|
var responsePayload, warnSpy, roapEvent;
|
|
2889
|
-
return _regenerator.default.wrap(function (
|
|
2890
|
-
while (1) switch (
|
|
3279
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
3280
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2891
3281
|
case 0:
|
|
2892
3282
|
responsePayload = {
|
|
2893
3283
|
statusCode: 200,
|
|
@@ -2898,10 +3288,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2898
3288
|
jest.spyOn(global, 'clearTimeout');
|
|
2899
3289
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2900
3290
|
call['held'] = true;
|
|
2901
|
-
|
|
3291
|
+
_context56.next = 1;
|
|
2902
3292
|
return call.doHoldResume();
|
|
2903
3293
|
case 1:
|
|
2904
|
-
|
|
3294
|
+
_context56.next = 2;
|
|
2905
3295
|
return (0, _testUtil.flushPromises)(2);
|
|
2906
3296
|
case 2:
|
|
2907
3297
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2916,14 +3306,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2916
3306
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2917
3307
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2918
3308
|
roapEvent.data.type = 'ANSWER';
|
|
2919
|
-
|
|
3309
|
+
_context56.next = 3;
|
|
2920
3310
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2921
3311
|
case 3:
|
|
2922
3312
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2923
3313
|
statusCode: 403
|
|
2924
3314
|
});
|
|
2925
3315
|
roapEvent.data.type = 'OK';
|
|
2926
|
-
|
|
3316
|
+
_context56.next = 4;
|
|
2927
3317
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2928
3318
|
case 4:
|
|
2929
3319
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2935,14 +3325,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2935
3325
|
});
|
|
2936
3326
|
case 5:
|
|
2937
3327
|
case "end":
|
|
2938
|
-
return
|
|
3328
|
+
return _context56.stop();
|
|
2939
3329
|
}
|
|
2940
|
-
},
|
|
3330
|
+
}, _callee56);
|
|
2941
3331
|
})));
|
|
2942
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3332
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2943
3333
|
var responsePayload, roapEvent;
|
|
2944
|
-
return _regenerator.default.wrap(function (
|
|
2945
|
-
while (1) switch (
|
|
3334
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3335
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2946
3336
|
case 0:
|
|
2947
3337
|
expect.assertions(5);
|
|
2948
3338
|
responsePayload = {
|
|
@@ -2952,25 +3342,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2952
3342
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2953
3343
|
call['held'] = false;
|
|
2954
3344
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2955
|
-
var
|
|
2956
|
-
return _regenerator.default.wrap(function (
|
|
2957
|
-
while (1) switch (
|
|
3345
|
+
var _ref67 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(errObj) {
|
|
3346
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3347
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2958
3348
|
case 0:
|
|
2959
3349
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2960
3350
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2961
3351
|
case 1:
|
|
2962
3352
|
case "end":
|
|
2963
|
-
return
|
|
3353
|
+
return _context57.stop();
|
|
2964
3354
|
}
|
|
2965
|
-
},
|
|
3355
|
+
}, _callee57);
|
|
2966
3356
|
}));
|
|
2967
3357
|
return function (_x5) {
|
|
2968
|
-
return
|
|
3358
|
+
return _ref67.apply(this, arguments);
|
|
2969
3359
|
};
|
|
2970
3360
|
}());
|
|
2971
3361
|
jest.runAllTimers();
|
|
2972
3362
|
call.doHoldResume();
|
|
2973
|
-
|
|
3363
|
+
_context58.next = 1;
|
|
2974
3364
|
return (0, _testUtil.flushPromises)(2);
|
|
2975
3365
|
case 1:
|
|
2976
3366
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2983,11 +3373,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2983
3373
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2984
3374
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2985
3375
|
roapEvent.data.type = 'ANSWER';
|
|
2986
|
-
|
|
3376
|
+
_context58.next = 2;
|
|
2987
3377
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2988
3378
|
case 2:
|
|
2989
3379
|
roapEvent.data.type = 'OK';
|
|
2990
|
-
|
|
3380
|
+
_context58.next = 3;
|
|
2991
3381
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2992
3382
|
case 3:
|
|
2993
3383
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2999,14 +3389,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2999
3389
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3000
3390
|
case 4:
|
|
3001
3391
|
case "end":
|
|
3002
|
-
return
|
|
3392
|
+
return _context58.stop();
|
|
3003
3393
|
}
|
|
3004
|
-
},
|
|
3394
|
+
}, _callee58);
|
|
3005
3395
|
})));
|
|
3006
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3396
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
3007
3397
|
var responsePayload, warnSpy, roapEvent;
|
|
3008
|
-
return _regenerator.default.wrap(function (
|
|
3009
|
-
while (1) switch (
|
|
3398
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3399
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3010
3400
|
case 0:
|
|
3011
3401
|
expect.assertions(7);
|
|
3012
3402
|
responsePayload = {
|
|
@@ -3019,25 +3409,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3019
3409
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3020
3410
|
call['held'] = true;
|
|
3021
3411
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3022
|
-
var
|
|
3023
|
-
return _regenerator.default.wrap(function (
|
|
3024
|
-
while (1) switch (
|
|
3412
|
+
var _ref69 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
|
|
3413
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3414
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3025
3415
|
case 0:
|
|
3026
3416
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3027
3417
|
case 1:
|
|
3028
3418
|
case "end":
|
|
3029
|
-
return
|
|
3419
|
+
return _context59.stop();
|
|
3030
3420
|
}
|
|
3031
|
-
},
|
|
3421
|
+
}, _callee59);
|
|
3032
3422
|
}));
|
|
3033
3423
|
return function (_x6) {
|
|
3034
|
-
return
|
|
3424
|
+
return _ref69.apply(this, arguments);
|
|
3035
3425
|
};
|
|
3036
3426
|
}());
|
|
3037
|
-
|
|
3427
|
+
_context60.next = 1;
|
|
3038
3428
|
return call.doHoldResume();
|
|
3039
3429
|
case 1:
|
|
3040
|
-
|
|
3430
|
+
_context60.next = 2;
|
|
3041
3431
|
return (0, _testUtil.flushPromises)(2);
|
|
3042
3432
|
case 2:
|
|
3043
3433
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3053,11 +3443,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3053
3443
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3054
3444
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3055
3445
|
roapEvent.data.type = 'ANSWER';
|
|
3056
|
-
|
|
3446
|
+
_context60.next = 3;
|
|
3057
3447
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3058
3448
|
case 3:
|
|
3059
3449
|
roapEvent.data.type = 'OK';
|
|
3060
|
-
|
|
3450
|
+
_context60.next = 4;
|
|
3061
3451
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3062
3452
|
case 4:
|
|
3063
3453
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -3072,14 +3462,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3072
3462
|
});
|
|
3073
3463
|
case 5:
|
|
3074
3464
|
case "end":
|
|
3075
|
-
return
|
|
3465
|
+
return _context60.stop();
|
|
3076
3466
|
}
|
|
3077
|
-
},
|
|
3467
|
+
}, _callee60);
|
|
3078
3468
|
})));
|
|
3079
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3469
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
|
|
3080
3470
|
var responsePayload, warnSpy, roapEvent;
|
|
3081
|
-
return _regenerator.default.wrap(function (
|
|
3082
|
-
while (1) switch (
|
|
3471
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3472
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3083
3473
|
case 0:
|
|
3084
3474
|
expect.assertions(7);
|
|
3085
3475
|
responsePayload = {
|
|
@@ -3092,26 +3482,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3092
3482
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3093
3483
|
call['held'] = true;
|
|
3094
3484
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
3095
|
-
var
|
|
3096
|
-
return _regenerator.default.wrap(function (
|
|
3097
|
-
while (1) switch (
|
|
3485
|
+
var _ref71 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
|
|
3486
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3487
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3098
3488
|
case 0:
|
|
3099
3489
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3100
3490
|
case 1:
|
|
3101
3491
|
case "end":
|
|
3102
|
-
return
|
|
3492
|
+
return _context61.stop();
|
|
3103
3493
|
}
|
|
3104
|
-
},
|
|
3494
|
+
}, _callee61);
|
|
3105
3495
|
}));
|
|
3106
3496
|
return function (_x7) {
|
|
3107
|
-
return
|
|
3497
|
+
return _ref71.apply(this, arguments);
|
|
3108
3498
|
};
|
|
3109
3499
|
}());
|
|
3110
3500
|
call.doHoldResume();
|
|
3111
|
-
|
|
3501
|
+
_context62.next = 1;
|
|
3112
3502
|
return _promise.default.resolve();
|
|
3113
3503
|
case 1:
|
|
3114
|
-
|
|
3504
|
+
_context62.next = 2;
|
|
3115
3505
|
return _promise.default.resolve();
|
|
3116
3506
|
case 2:
|
|
3117
3507
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -3127,11 +3517,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3127
3517
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3128
3518
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3129
3519
|
roapEvent.data.type = 'ANSWER';
|
|
3130
|
-
|
|
3520
|
+
_context62.next = 3;
|
|
3131
3521
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3132
3522
|
case 3:
|
|
3133
3523
|
roapEvent.data.type = 'OK';
|
|
3134
|
-
|
|
3524
|
+
_context62.next = 4;
|
|
3135
3525
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3136
3526
|
case 4:
|
|
3137
3527
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3146,14 +3536,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3146
3536
|
});
|
|
3147
3537
|
case 5:
|
|
3148
3538
|
case "end":
|
|
3149
|
-
return
|
|
3539
|
+
return _context62.stop();
|
|
3150
3540
|
}
|
|
3151
|
-
},
|
|
3541
|
+
}, _callee62);
|
|
3152
3542
|
})));
|
|
3153
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3543
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
3154
3544
|
var responsePayload;
|
|
3155
|
-
return _regenerator.default.wrap(function (
|
|
3156
|
-
while (1) switch (
|
|
3545
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3546
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3157
3547
|
case 0:
|
|
3158
3548
|
expect.assertions(4);
|
|
3159
3549
|
responsePayload = {
|
|
@@ -3163,26 +3553,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3163
3553
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3164
3554
|
call['held'] = true;
|
|
3165
3555
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3166
|
-
var
|
|
3167
|
-
return _regenerator.default.wrap(function (
|
|
3168
|
-
while (1) switch (
|
|
3556
|
+
var _ref73 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(errObj) {
|
|
3557
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3558
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3169
3559
|
case 0:
|
|
3170
3560
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3171
3561
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3172
3562
|
case 1:
|
|
3173
3563
|
case "end":
|
|
3174
|
-
return
|
|
3564
|
+
return _context63.stop();
|
|
3175
3565
|
}
|
|
3176
|
-
},
|
|
3566
|
+
}, _callee63);
|
|
3177
3567
|
}));
|
|
3178
3568
|
return function (_x8) {
|
|
3179
|
-
return
|
|
3569
|
+
return _ref73.apply(this, arguments);
|
|
3180
3570
|
};
|
|
3181
3571
|
}());
|
|
3182
|
-
|
|
3572
|
+
_context64.next = 1;
|
|
3183
3573
|
return call.doHoldResume();
|
|
3184
3574
|
case 1:
|
|
3185
|
-
|
|
3575
|
+
_context64.next = 2;
|
|
3186
3576
|
return (0, _testUtil.flushPromises)(2);
|
|
3187
3577
|
case 2:
|
|
3188
3578
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3193,14 +3583,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3193
3583
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3194
3584
|
case 3:
|
|
3195
3585
|
case "end":
|
|
3196
|
-
return
|
|
3586
|
+
return _context64.stop();
|
|
3197
3587
|
}
|
|
3198
|
-
},
|
|
3588
|
+
}, _callee64);
|
|
3199
3589
|
})));
|
|
3200
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3590
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3201
3591
|
var responsePayload, rejectPayload, roapEvent;
|
|
3202
|
-
return _regenerator.default.wrap(function (
|
|
3203
|
-
while (1) switch (
|
|
3592
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3593
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3204
3594
|
case 0:
|
|
3205
3595
|
expect.assertions(5);
|
|
3206
3596
|
responsePayload = {
|
|
@@ -3214,24 +3604,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3214
3604
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3215
3605
|
call['held'] = true;
|
|
3216
3606
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3217
|
-
var
|
|
3218
|
-
return _regenerator.default.wrap(function (
|
|
3219
|
-
while (1) switch (
|
|
3607
|
+
var _ref75 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(errObj) {
|
|
3608
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3609
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3220
3610
|
case 0:
|
|
3221
3611
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3222
3612
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3223
3613
|
case 1:
|
|
3224
3614
|
case "end":
|
|
3225
|
-
return
|
|
3615
|
+
return _context65.stop();
|
|
3226
3616
|
}
|
|
3227
|
-
},
|
|
3617
|
+
}, _callee65);
|
|
3228
3618
|
}));
|
|
3229
3619
|
return function (_x9) {
|
|
3230
|
-
return
|
|
3620
|
+
return _ref75.apply(this, arguments);
|
|
3231
3621
|
};
|
|
3232
3622
|
}());
|
|
3233
3623
|
call.doHoldResume();
|
|
3234
|
-
|
|
3624
|
+
_context66.next = 1;
|
|
3235
3625
|
return (0, _testUtil.flushPromises)(2);
|
|
3236
3626
|
case 1:
|
|
3237
3627
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3242,7 +3632,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3242
3632
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3243
3633
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3244
3634
|
roapEvent.data.type = 'ANSWER';
|
|
3245
|
-
|
|
3635
|
+
_context66.next = 2;
|
|
3246
3636
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3247
3637
|
case 2:
|
|
3248
3638
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3250,14 +3640,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3250
3640
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3251
3641
|
case 3:
|
|
3252
3642
|
case "end":
|
|
3253
|
-
return
|
|
3643
|
+
return _context66.stop();
|
|
3254
3644
|
}
|
|
3255
|
-
},
|
|
3645
|
+
}, _callee66);
|
|
3256
3646
|
})));
|
|
3257
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3647
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
|
|
3258
3648
|
var responsePayload, roapEvent;
|
|
3259
|
-
return _regenerator.default.wrap(function (
|
|
3260
|
-
while (1) switch (
|
|
3649
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3650
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3261
3651
|
case 0:
|
|
3262
3652
|
expect.assertions(5);
|
|
3263
3653
|
responsePayload = {
|
|
@@ -3267,24 +3657,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3267
3657
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3268
3658
|
call['held'] = true;
|
|
3269
3659
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3270
|
-
var
|
|
3271
|
-
return _regenerator.default.wrap(function (
|
|
3272
|
-
while (1) switch (
|
|
3660
|
+
var _ref77 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(errObj) {
|
|
3661
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3662
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3273
3663
|
case 0:
|
|
3274
3664
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3275
3665
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3276
3666
|
case 1:
|
|
3277
3667
|
case "end":
|
|
3278
|
-
return
|
|
3668
|
+
return _context67.stop();
|
|
3279
3669
|
}
|
|
3280
|
-
},
|
|
3670
|
+
}, _callee67);
|
|
3281
3671
|
}));
|
|
3282
3672
|
return function (_x0) {
|
|
3283
|
-
return
|
|
3673
|
+
return _ref77.apply(this, arguments);
|
|
3284
3674
|
};
|
|
3285
3675
|
}());
|
|
3286
3676
|
call.doHoldResume();
|
|
3287
|
-
|
|
3677
|
+
_context68.next = 1;
|
|
3288
3678
|
return (0, _testUtil.flushPromises)(2);
|
|
3289
3679
|
case 1:
|
|
3290
3680
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3297,11 +3687,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3297
3687
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3298
3688
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3299
3689
|
roapEvent.data.type = 'ANSWER';
|
|
3300
|
-
|
|
3690
|
+
_context68.next = 2;
|
|
3301
3691
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3302
3692
|
case 2:
|
|
3303
3693
|
roapEvent.data.type = 'OK';
|
|
3304
|
-
|
|
3694
|
+
_context68.next = 3;
|
|
3305
3695
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3306
3696
|
case 3:
|
|
3307
3697
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3311,9 +3701,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3311
3701
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3312
3702
|
case 4:
|
|
3313
3703
|
case "end":
|
|
3314
|
-
return
|
|
3704
|
+
return _context68.stop();
|
|
3315
3705
|
}
|
|
3316
|
-
},
|
|
3706
|
+
}, _callee68);
|
|
3317
3707
|
})));
|
|
3318
3708
|
});
|
|
3319
3709
|
describe('Call transfer tests', function () {
|
|
@@ -3346,10 +3736,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3346
3736
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3347
3737
|
secondCall['held'] = false;
|
|
3348
3738
|
});
|
|
3349
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3739
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
|
|
3350
3740
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3351
|
-
return _regenerator.default.wrap(function (
|
|
3352
|
-
while (1) switch (
|
|
3741
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3742
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3353
3743
|
case 0:
|
|
3354
3744
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3355
3745
|
responsePayload = {
|
|
@@ -3361,41 +3751,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3361
3751
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3362
3752
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3363
3753
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3364
|
-
var
|
|
3365
|
-
return _regenerator.default.wrap(function (
|
|
3366
|
-
while (1) switch (
|
|
3754
|
+
var _ref79 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
|
|
3755
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3756
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3367
3757
|
case 0:
|
|
3368
3758
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3369
3759
|
case 1:
|
|
3370
3760
|
case "end":
|
|
3371
|
-
return
|
|
3761
|
+
return _context69.stop();
|
|
3372
3762
|
}
|
|
3373
|
-
},
|
|
3763
|
+
}, _callee69);
|
|
3374
3764
|
}));
|
|
3375
3765
|
return function (_x1) {
|
|
3376
|
-
return
|
|
3766
|
+
return _ref79.apply(this, arguments);
|
|
3377
3767
|
};
|
|
3378
3768
|
}());
|
|
3379
3769
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3380
|
-
var
|
|
3381
|
-
return _regenerator.default.wrap(function (
|
|
3382
|
-
while (1) switch (
|
|
3770
|
+
var _ref80 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70(correlationId) {
|
|
3771
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3772
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3383
3773
|
case 0:
|
|
3384
3774
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3385
3775
|
case 1:
|
|
3386
3776
|
case "end":
|
|
3387
|
-
return
|
|
3777
|
+
return _context70.stop();
|
|
3388
3778
|
}
|
|
3389
|
-
},
|
|
3779
|
+
}, _callee70);
|
|
3390
3780
|
}));
|
|
3391
3781
|
return function (_x10) {
|
|
3392
|
-
return
|
|
3782
|
+
return _ref80.apply(this, arguments);
|
|
3393
3783
|
};
|
|
3394
3784
|
}());
|
|
3395
|
-
|
|
3785
|
+
_context71.next = 1;
|
|
3396
3786
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3397
3787
|
case 1:
|
|
3398
|
-
|
|
3788
|
+
_context71.next = 2;
|
|
3399
3789
|
return (0, _testUtil.flushPromises)(2);
|
|
3400
3790
|
case 2:
|
|
3401
3791
|
expect(requestSpy).toBeCalled();
|
|
@@ -3418,14 +3808,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3418
3808
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3419
3809
|
case 3:
|
|
3420
3810
|
case "end":
|
|
3421
|
-
return
|
|
3811
|
+
return _context71.stop();
|
|
3422
3812
|
}
|
|
3423
|
-
},
|
|
3813
|
+
}, _callee71);
|
|
3424
3814
|
})));
|
|
3425
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3815
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3426
3816
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3427
|
-
return _regenerator.default.wrap(function (
|
|
3428
|
-
while (1) switch (
|
|
3817
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3818
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3429
3819
|
case 0:
|
|
3430
3820
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3431
3821
|
responsePayload = {
|
|
@@ -3437,25 +3827,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3437
3827
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3438
3828
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3439
3829
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3440
|
-
var
|
|
3441
|
-
return _regenerator.default.wrap(function (
|
|
3442
|
-
while (1) switch (
|
|
3830
|
+
var _ref82 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72(correlationId) {
|
|
3831
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3832
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3443
3833
|
case 0:
|
|
3444
3834
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3445
3835
|
case 1:
|
|
3446
3836
|
case "end":
|
|
3447
|
-
return
|
|
3837
|
+
return _context72.stop();
|
|
3448
3838
|
}
|
|
3449
|
-
},
|
|
3839
|
+
}, _callee72);
|
|
3450
3840
|
}));
|
|
3451
3841
|
return function (_x11) {
|
|
3452
|
-
return
|
|
3842
|
+
return _ref82.apply(this, arguments);
|
|
3453
3843
|
};
|
|
3454
3844
|
}());
|
|
3455
|
-
|
|
3845
|
+
_context73.next = 1;
|
|
3456
3846
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3457
3847
|
case 1:
|
|
3458
|
-
|
|
3848
|
+
_context73.next = 2;
|
|
3459
3849
|
return (0, _testUtil.flushPromises)(2);
|
|
3460
3850
|
case 2:
|
|
3461
3851
|
expect(requestSpy).toBeCalled();
|
|
@@ -3474,14 +3864,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3474
3864
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3475
3865
|
case 3:
|
|
3476
3866
|
case "end":
|
|
3477
|
-
return
|
|
3867
|
+
return _context73.stop();
|
|
3478
3868
|
}
|
|
3479
|
-
},
|
|
3869
|
+
}, _callee73);
|
|
3480
3870
|
})));
|
|
3481
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3871
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
|
|
3482
3872
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3483
|
-
return _regenerator.default.wrap(function (
|
|
3484
|
-
while (1) switch (
|
|
3873
|
+
return _regenerator.default.wrap(function (_context74) {
|
|
3874
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
3485
3875
|
case 0:
|
|
3486
3876
|
responsePayload = {
|
|
3487
3877
|
statusCode: 403,
|
|
@@ -3492,10 +3882,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3492
3882
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3493
3883
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3494
3884
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3495
|
-
|
|
3885
|
+
_context74.next = 1;
|
|
3496
3886
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3497
3887
|
case 1:
|
|
3498
|
-
|
|
3888
|
+
_context74.next = 2;
|
|
3499
3889
|
return (0, _testUtil.flushPromises)(1);
|
|
3500
3890
|
case 2:
|
|
3501
3891
|
expect(requestSpy).toBeCalled();
|
|
@@ -3516,14 +3906,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3516
3906
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3517
3907
|
case 3:
|
|
3518
3908
|
case "end":
|
|
3519
|
-
return
|
|
3909
|
+
return _context74.stop();
|
|
3520
3910
|
}
|
|
3521
|
-
},
|
|
3911
|
+
}, _callee74);
|
|
3522
3912
|
})));
|
|
3523
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3913
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee75() {
|
|
3524
3914
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3525
|
-
return _regenerator.default.wrap(function (
|
|
3526
|
-
while (1) switch (
|
|
3915
|
+
return _regenerator.default.wrap(function (_context75) {
|
|
3916
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
3527
3917
|
case 0:
|
|
3528
3918
|
responsePayload = {
|
|
3529
3919
|
statusCode: 403,
|
|
@@ -3533,10 +3923,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3533
3923
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3534
3924
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3535
3925
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3536
|
-
|
|
3926
|
+
_context75.next = 1;
|
|
3537
3927
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3538
3928
|
case 1:
|
|
3539
|
-
|
|
3929
|
+
_context75.next = 2;
|
|
3540
3930
|
return (0, _testUtil.flushPromises)(2);
|
|
3541
3931
|
case 2:
|
|
3542
3932
|
expect(requestSpy).toBeCalled();
|
|
@@ -3557,18 +3947,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3557
3947
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3558
3948
|
case 3:
|
|
3559
3949
|
case "end":
|
|
3560
|
-
return
|
|
3950
|
+
return _context75.stop();
|
|
3561
3951
|
}
|
|
3562
|
-
},
|
|
3952
|
+
}, _callee75);
|
|
3563
3953
|
})));
|
|
3564
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3954
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee76() {
|
|
3565
3955
|
var requestSpy, warnSpy;
|
|
3566
|
-
return _regenerator.default.wrap(function (
|
|
3567
|
-
while (1) switch (
|
|
3956
|
+
return _regenerator.default.wrap(function (_context76) {
|
|
3957
|
+
while (1) switch (_context76.prev = _context76.next) {
|
|
3568
3958
|
case 0:
|
|
3569
3959
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3570
3960
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3571
|
-
|
|
3961
|
+
_context76.next = 1;
|
|
3572
3962
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3573
3963
|
case 1:
|
|
3574
3964
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3580,18 +3970,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3580
3970
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3581
3971
|
case 2:
|
|
3582
3972
|
case "end":
|
|
3583
|
-
return
|
|
3973
|
+
return _context76.stop();
|
|
3584
3974
|
}
|
|
3585
|
-
},
|
|
3975
|
+
}, _callee76);
|
|
3586
3976
|
})));
|
|
3587
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3977
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee77() {
|
|
3588
3978
|
var requestSpy, warnSpy;
|
|
3589
|
-
return _regenerator.default.wrap(function (
|
|
3590
|
-
while (1) switch (
|
|
3979
|
+
return _regenerator.default.wrap(function (_context77) {
|
|
3980
|
+
while (1) switch (_context77.prev = _context77.next) {
|
|
3591
3981
|
case 0:
|
|
3592
3982
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3593
3983
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3594
|
-
|
|
3984
|
+
_context77.next = 1;
|
|
3595
3985
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3596
3986
|
case 1:
|
|
3597
3987
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3603,9 +3993,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3603
3993
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3604
3994
|
case 2:
|
|
3605
3995
|
case "end":
|
|
3606
|
-
return
|
|
3996
|
+
return _context77.stop();
|
|
3607
3997
|
}
|
|
3608
|
-
},
|
|
3998
|
+
}, _callee77);
|
|
3609
3999
|
})));
|
|
3610
4000
|
});
|
|
3611
4001
|
});
|