@webex/calling 3.12.0-next.12 → 3.12.0-next.120
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/CallerId/index.js +3 -1
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +12 -2
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +645 -458
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +928 -498
- 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 +33 -3
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +27 -3
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +102 -17
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +971 -506
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +946 -61
- 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 +252 -127
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +493 -229
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/callUtils.js +187 -0
- package/dist/common/callUtils.js.map +1 -0
- package/dist/common/callUtils.test.js +313 -0
- package/dist/common/callUtils.test.js.map +1 -0
- package/dist/common/constants.js +27 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js +11 -0
- package/dist/common/index.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 +493 -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 +614 -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 +747 -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/CallerId/index.js +2 -2
- package/dist/module/CallingClient/calling/call.js +207 -68
- package/dist/module/CallingClient/calling/callManager.js +51 -11
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +28 -0
- package/dist/module/CallingClient/line/index.js +11 -3
- package/dist/module/CallingClient/registration/register.js +297 -68
- 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 +103 -58
- package/dist/module/common/callUtils.js +90 -0
- package/dist/module/common/constants.js +11 -0
- package/dist/module/common/index.js +1 -0
- 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 +376 -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/CallerId/index.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 +28 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +3 -2
- 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 +6 -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 +11 -5
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/callUtils.d.ts +6 -0
- package/dist/types/common/callUtils.d.ts.map +1 -0
- package/dist/types/common/constants.d.ts +6 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/index.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
|
@@ -23,6 +23,7 @@ var _types2 = require("../Errors/types");
|
|
|
23
23
|
var _Utils = require("./Utils");
|
|
24
24
|
var _voicemailFixture = require("../Voicemail/voicemailFixture");
|
|
25
25
|
var _constants2 = require("./constants");
|
|
26
|
+
var _testFixtures = require("../CallSettings/testFixtures");
|
|
26
27
|
var _types3 = require("../Events/types");
|
|
27
28
|
var _SDKConnector = _interopRequireDefault(require("../SDKConnector"));
|
|
28
29
|
function ownKeys(e, r) { var t = _Object$keys(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; }
|
|
@@ -38,6 +39,7 @@ var mockSubmitRegistrationMetric = jest.fn();
|
|
|
38
39
|
var mockEmitterCb = jest.fn();
|
|
39
40
|
var mockRestoreCb = jest.fn();
|
|
40
41
|
var mock429RetryCb = jest.fn();
|
|
42
|
+
var mockSessionSupersededCb = jest.fn();
|
|
41
43
|
var webex = (0, _testUtil.getTestUtilsWebex)();
|
|
42
44
|
_SDKConnector.default.setWebex(webex);
|
|
43
45
|
webex.internal.metrics.submitClientMetrics = mockSubmitRegistrationMetric;
|
|
@@ -64,6 +66,28 @@ describe('Mobius service discovery tests', function () {
|
|
|
64
66
|
expect(filteredUris.primary[0]).toBe(defaultMobiusUrl + callingContext);
|
|
65
67
|
expect(filteredUris.backup.length).toBe(0);
|
|
66
68
|
});
|
|
69
|
+
it('filterMobiusUris drops untrusted wss hosts', function () {
|
|
70
|
+
var defaultMobiusUrl = 'https://mobius.webex.com/api/v1/calling/web';
|
|
71
|
+
var discoveryResponse = (0, _testUtil.getMobiusDiscoveryResponse)();
|
|
72
|
+
discoveryResponse.primary.wss = ['wss://mobius-dfw.webex.com/socket', 'wss://evil.example.com/socket'];
|
|
73
|
+
discoveryResponse.backup.wss = ['wss://mobius-sjc.webex.com/socket', 'wss://attacker.example.org/socket'];
|
|
74
|
+
var filteredUris = (0, _Utils.filterMobiusUris)(discoveryResponse, defaultMobiusUrl);
|
|
75
|
+
expect(filteredUris.primaryWss).toHaveLength(1);
|
|
76
|
+
expect(filteredUris.primaryWss[0]).toBe('wss://mobius-dfw.webex.com/socket');
|
|
77
|
+
expect(filteredUris.backupWss).toHaveLength(1);
|
|
78
|
+
expect(filteredUris.backupWss[0]).toBe('wss://mobius-sjc.webex.com/socket');
|
|
79
|
+
});
|
|
80
|
+
it('filterMobiusUris drops malformed/unparseable wss hosts', function () {
|
|
81
|
+
var defaultMobiusUrl = 'https://mobius.webex.com/api/v1/calling/web';
|
|
82
|
+
var discoveryResponse = (0, _testUtil.getMobiusDiscoveryResponse)();
|
|
83
|
+
discoveryResponse.primary.wss = ['wss://mobius-dfw.webex.com/socket', 'wss://', 'not a url'];
|
|
84
|
+
discoveryResponse.backup.wss = ['not a url', 'wss://mobius-sjc.webex.com/socket'];
|
|
85
|
+
var filteredUris = (0, _Utils.filterMobiusUris)(discoveryResponse, defaultMobiusUrl);
|
|
86
|
+
expect(filteredUris.primaryWss).toHaveLength(1);
|
|
87
|
+
expect(filteredUris.primaryWss[0]).toBe('wss://mobius-dfw.webex.com/socket');
|
|
88
|
+
expect(filteredUris.backupWss).toHaveLength(1);
|
|
89
|
+
expect(filteredUris.backupWss[0]).toBe('wss://mobius-sjc.webex.com/socket');
|
|
90
|
+
});
|
|
67
91
|
});
|
|
68
92
|
describe('Call Tests - keepalive (handleCallEstablished) cases', function () {
|
|
69
93
|
var logObj = {
|
|
@@ -452,6 +476,18 @@ describe('Registration Tests', function () {
|
|
|
452
476
|
restoreCbExpected: false,
|
|
453
477
|
retry429CbExpected: false,
|
|
454
478
|
logMsg: '400 Bad Request'
|
|
479
|
+
}, {
|
|
480
|
+
name: 'verify 409 error response',
|
|
481
|
+
statusCode: _types2.ERROR_CODE.CONFLICT,
|
|
482
|
+
deviceErrorCode: 0,
|
|
483
|
+
message: _constants.SESSION_SUPERSEDED_MESSAGE,
|
|
484
|
+
errorType: _types2.ERROR_TYPE.SESSION_SUPERSEDED,
|
|
485
|
+
emitterCbExpected: false,
|
|
486
|
+
finalError: true,
|
|
487
|
+
restoreCbExpected: false,
|
|
488
|
+
retry429CbExpected: false,
|
|
489
|
+
sessionSupersededCbExpected: true,
|
|
490
|
+
logMsg: '409 Conflict: session superseded by another device for this user'
|
|
455
491
|
}, {
|
|
456
492
|
name: 'verify unknown error response',
|
|
457
493
|
statusCode: 206,
|
|
@@ -477,55 +513,114 @@ describe('Registration Tests', function () {
|
|
|
477
513
|
};
|
|
478
514
|
|
|
479
515
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
480
|
-
it.each(errorCodes)('%s', function (
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
516
|
+
it.each(errorCodes)('%s', /*#__PURE__*/function () {
|
|
517
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(codeObj) {
|
|
518
|
+
var webexPayload, mockErrorEvent, callClientError, result;
|
|
519
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
520
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
521
|
+
case 0:
|
|
522
|
+
webexPayload = {
|
|
523
|
+
statusCode: codeObj.statusCode,
|
|
524
|
+
headers: _objectSpread({
|
|
525
|
+
trackingid: 'webex-js-sdk_b5812e58-7246-4a9b-bf64-831bdf13b0cd_31'
|
|
526
|
+
}, codeObj.retryAfter && {
|
|
527
|
+
'retry-after': codeObj.retryAfter.toString()
|
|
528
|
+
}),
|
|
529
|
+
body: {
|
|
530
|
+
device: {
|
|
531
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010'
|
|
532
|
+
},
|
|
533
|
+
userId: '8a67806f-fc4d-446b-a131-31e71ea5b0e9',
|
|
534
|
+
errorCode: codeObj.deviceErrorCode,
|
|
535
|
+
devices: [{
|
|
536
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
537
|
+
uri: 'https://mobius.webex.com/api/v1/calling/web/',
|
|
538
|
+
status: 'active',
|
|
539
|
+
lastSeen: '2022-04-07T18:00:40Z',
|
|
540
|
+
addresses: ['sip:sipAddress@webex.com']
|
|
541
|
+
}]
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
if (codeObj.customBodyPresent) {
|
|
545
|
+
webexPayload.body = codeObj.body;
|
|
546
|
+
}
|
|
547
|
+
mockErrorEvent = {
|
|
548
|
+
type: codeObj.errorType,
|
|
549
|
+
message: codeObj.message,
|
|
550
|
+
context: logObj
|
|
551
|
+
};
|
|
552
|
+
callClientError = new _Errors.CallingClientError(mockErrorEvent.message, mockErrorEvent.context, mockErrorEvent.type, _types.RegistrationStatus.ACTIVE);
|
|
553
|
+
_context8.next = 1;
|
|
554
|
+
return (0, _Utils.handleRegistrationErrors)(webexPayload, mockEmitterCb, logObj, {
|
|
555
|
+
retry429Cb: mock429RetryCb,
|
|
556
|
+
restoreRegCb: mockRestoreCb,
|
|
557
|
+
sessionSupersededCb: mockSessionSupersededCb
|
|
558
|
+
});
|
|
559
|
+
case 1:
|
|
560
|
+
result = _context8.sent;
|
|
561
|
+
expect(result.finalError).toBe(codeObj.finalError);
|
|
562
|
+
if (codeObj.emitterCbExpected) {
|
|
563
|
+
expect(mockEmitterCb).toBeCalledOnceWith(callClientError, codeObj.finalError);
|
|
564
|
+
} else {
|
|
565
|
+
expect(mockEmitterCb).not.toHaveBeenCalled();
|
|
566
|
+
}
|
|
567
|
+
if (codeObj.restoreCbExpected) {
|
|
568
|
+
expect(mockRestoreCb).toBeCalledOnceWith(webexPayload.body, logObj.method);
|
|
569
|
+
} else {
|
|
570
|
+
expect(mockRestoreCb).not.toHaveBeenCalled();
|
|
571
|
+
}
|
|
572
|
+
if (codeObj.retry429CbExpected) {
|
|
573
|
+
expect(mock429RetryCb).toBeCalledOnceWith(codeObj.retryAfter, logObj.method);
|
|
574
|
+
} else {
|
|
575
|
+
expect(mock429RetryCb).not.toHaveBeenCalled();
|
|
576
|
+
}
|
|
577
|
+
if (codeObj.sessionSupersededCbExpected) {
|
|
578
|
+
expect(mockSessionSupersededCb).toBeCalledOnceWith(callClientError);
|
|
579
|
+
} else {
|
|
580
|
+
expect(mockSessionSupersededCb).not.toHaveBeenCalled();
|
|
581
|
+
}
|
|
582
|
+
expect(logSpy).toHaveBeenCalledWith("Status code: -> ".concat(codeObj.statusCode), logObj);
|
|
583
|
+
expect(logSpy).toHaveBeenCalledWith(codeObj.logMsg, logObj);
|
|
584
|
+
case 2:
|
|
585
|
+
case "end":
|
|
586
|
+
return _context8.stop();
|
|
587
|
+
}
|
|
588
|
+
}, _callee8);
|
|
589
|
+
}));
|
|
590
|
+
return function (_x) {
|
|
591
|
+
return _ref8.apply(this, arguments);
|
|
510
592
|
};
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
593
|
+
}());
|
|
594
|
+
it('verify 409 response for a caller that does not handle a superseded session', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
595
|
+
var webexPayload, result;
|
|
596
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
597
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
598
|
+
case 0:
|
|
599
|
+
webexPayload = {
|
|
600
|
+
statusCode: _types2.ERROR_CODE.CONFLICT,
|
|
601
|
+
headers: {
|
|
602
|
+
trackingid: 'webex-js-sdk_b5812e58-7246-4a9b-bf64-831bdf13b0cd_31'
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
_context9.next = 1;
|
|
606
|
+
return (0, _Utils.handleRegistrationErrors)(webexPayload, mockEmitterCb, logObj, {
|
|
607
|
+
retry429Cb: mock429RetryCb,
|
|
608
|
+
restoreRegCb: mockRestoreCb
|
|
609
|
+
});
|
|
610
|
+
case 1:
|
|
611
|
+
result = _context9.sent;
|
|
612
|
+
expect(result).toStrictEqual({
|
|
613
|
+
finalError: false,
|
|
614
|
+
shouldDisconnect: false
|
|
615
|
+
});
|
|
616
|
+
expect(mockEmitterCb).not.toHaveBeenCalled();
|
|
617
|
+
expect(logSpy).toHaveBeenCalledWith('409 Conflict: ignored, caller does not handle a superseded session', logObj);
|
|
618
|
+
case 2:
|
|
619
|
+
case "end":
|
|
620
|
+
return _context9.stop();
|
|
621
|
+
}
|
|
622
|
+
}, _callee9);
|
|
623
|
+
})));
|
|
529
624
|
});
|
|
530
625
|
describe('CallingClient Error Tests', function () {
|
|
531
626
|
var logSpy = jest.spyOn(_Logger.default, 'warn');
|
|
@@ -536,10 +631,10 @@ describe('CallingClient Error Tests', function () {
|
|
|
536
631
|
beforeEach(function () {
|
|
537
632
|
jest.clearAllMocks();
|
|
538
633
|
});
|
|
539
|
-
it('verify 401 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
634
|
+
it('verify 401 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
540
635
|
var statusCode, message, errorType, finalError, webexPayload, mockErrorEvent, callClientError, result;
|
|
541
|
-
return _regenerator.default.wrap(function (
|
|
542
|
-
while (1) switch (
|
|
636
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
637
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
543
638
|
case 0:
|
|
544
639
|
statusCode = _types2.ERROR_CODE.UNAUTHORIZED;
|
|
545
640
|
message = 'User is unauthorized due to an expired token.';
|
|
@@ -564,24 +659,24 @@ describe('CallingClient Error Tests', function () {
|
|
|
564
659
|
context: logObj
|
|
565
660
|
};
|
|
566
661
|
callClientError = new _Errors.CallingClientError(mockErrorEvent.message, mockErrorEvent.context, mockErrorEvent.type, _types.RegistrationStatus.ACTIVE);
|
|
567
|
-
|
|
662
|
+
_context0.next = 1;
|
|
568
663
|
return (0, _Utils.handleCallingClientErrors)(webexPayload, mockEmitterCb, logObj);
|
|
569
664
|
case 1:
|
|
570
|
-
result =
|
|
665
|
+
result = _context0.sent;
|
|
571
666
|
expect(mockEmitterCb).toHaveBeenCalledWith(callClientError, finalError);
|
|
572
667
|
expect(result).toBe(finalError);
|
|
573
668
|
expect(logSpy).toHaveBeenCalledWith("Status code: -> ".concat(statusCode), logObj);
|
|
574
669
|
expect(logSpy).toHaveBeenCalledWith('401 Unauthorized', logObj);
|
|
575
670
|
case 2:
|
|
576
671
|
case "end":
|
|
577
|
-
return
|
|
672
|
+
return _context0.stop();
|
|
578
673
|
}
|
|
579
|
-
},
|
|
674
|
+
}, _callee0);
|
|
580
675
|
})));
|
|
581
|
-
it('verify 500 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
676
|
+
it('verify 500 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
582
677
|
var statusCode, message, errorType, finalError, webexPayload, mockErrorEvent, callClientError, result;
|
|
583
|
-
return _regenerator.default.wrap(function (
|
|
584
|
-
while (1) switch (
|
|
678
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
679
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
585
680
|
case 0:
|
|
586
681
|
statusCode = _types2.ERROR_CODE.INTERNAL_SERVER_ERROR;
|
|
587
682
|
message = 'An unknown error occurred while placing the request. Wait a moment and try again.';
|
|
@@ -606,24 +701,24 @@ describe('CallingClient Error Tests', function () {
|
|
|
606
701
|
context: logObj
|
|
607
702
|
};
|
|
608
703
|
callClientError = new _Errors.CallingClientError(mockErrorEvent.message, mockErrorEvent.context, mockErrorEvent.type, _types.RegistrationStatus.ACTIVE);
|
|
609
|
-
|
|
704
|
+
_context1.next = 1;
|
|
610
705
|
return (0, _Utils.handleCallingClientErrors)(webexPayload, mockEmitterCb, logObj);
|
|
611
706
|
case 1:
|
|
612
|
-
result =
|
|
707
|
+
result = _context1.sent;
|
|
613
708
|
expect(mockEmitterCb).toHaveBeenCalledWith(callClientError, finalError);
|
|
614
709
|
expect(result).toBe(finalError);
|
|
615
710
|
expect(logSpy).toHaveBeenCalledWith("Status code: -> ".concat(statusCode), logObj);
|
|
616
711
|
expect(logSpy).toHaveBeenCalledWith('500 Internal Server Error', logObj);
|
|
617
712
|
case 2:
|
|
618
713
|
case "end":
|
|
619
|
-
return
|
|
714
|
+
return _context1.stop();
|
|
620
715
|
}
|
|
621
|
-
},
|
|
716
|
+
}, _callee1);
|
|
622
717
|
})));
|
|
623
|
-
it('verify unknown error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
718
|
+
it('verify unknown error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
624
719
|
var statusCode, message, errorType, finalError, webexPayload, mockErrorEvent, callClientError, result;
|
|
625
|
-
return _regenerator.default.wrap(function (
|
|
626
|
-
while (1) switch (
|
|
720
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
721
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
627
722
|
case 0:
|
|
628
723
|
statusCode = 206;
|
|
629
724
|
message = 'Unknown error';
|
|
@@ -648,19 +743,19 @@ describe('CallingClient Error Tests', function () {
|
|
|
648
743
|
context: logObj
|
|
649
744
|
};
|
|
650
745
|
callClientError = new _Errors.CallingClientError(mockErrorEvent.message, mockErrorEvent.context, mockErrorEvent.type, _types.RegistrationStatus.ACTIVE);
|
|
651
|
-
|
|
746
|
+
_context10.next = 1;
|
|
652
747
|
return (0, _Utils.handleCallingClientErrors)(webexPayload, mockEmitterCb, logObj);
|
|
653
748
|
case 1:
|
|
654
|
-
result =
|
|
749
|
+
result = _context10.sent;
|
|
655
750
|
expect(mockEmitterCb).toHaveBeenCalledWith(callClientError, finalError);
|
|
656
751
|
expect(result).toBe(finalError);
|
|
657
752
|
expect(logSpy).toHaveBeenCalledWith("Status code: -> ".concat(statusCode), logObj);
|
|
658
753
|
expect(logSpy).toHaveBeenCalledWith('Unknown Error', logObj);
|
|
659
754
|
case 2:
|
|
660
755
|
case "end":
|
|
661
|
-
return
|
|
756
|
+
return _context10.stop();
|
|
662
757
|
}
|
|
663
|
-
},
|
|
758
|
+
}, _callee10);
|
|
664
759
|
})));
|
|
665
760
|
});
|
|
666
761
|
describe('Call Tests', function () {
|
|
@@ -1208,11 +1303,11 @@ describe('resolveContact tests', function () {
|
|
|
1208
1303
|
}));
|
|
1209
1304
|
});
|
|
1210
1305
|
});
|
|
1211
|
-
it('Resolve by userExternalId - SCIM exception', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1306
|
+
it('Resolve by userExternalId - SCIM exception', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1212
1307
|
var _callingPartyInfo$use2;
|
|
1213
1308
|
var callingPartyInfo, warnSpy, webexSpy, displayInfo, query;
|
|
1214
|
-
return _regenerator.default.wrap(function (
|
|
1215
|
-
while (1) switch (
|
|
1309
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
1310
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1216
1311
|
case 0:
|
|
1217
1312
|
callingPartyInfo = {};
|
|
1218
1313
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
@@ -1222,10 +1317,10 @@ describe('resolveContact tests', function () {
|
|
|
1222
1317
|
callingPartyInfo.userExternalId = {
|
|
1223
1318
|
$: 'userExternalId'
|
|
1224
1319
|
};
|
|
1225
|
-
|
|
1320
|
+
_context11.next = 1;
|
|
1226
1321
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1227
1322
|
case 1:
|
|
1228
|
-
displayInfo =
|
|
1323
|
+
displayInfo = _context11.sent;
|
|
1229
1324
|
expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.name).toBeUndefined();
|
|
1230
1325
|
expect(warnSpy).toHaveBeenCalledWith('Error response: - 500', {
|
|
1231
1326
|
file: _constants.UTILS_FILE,
|
|
@@ -1237,15 +1332,15 @@ describe('resolveContact tests', function () {
|
|
|
1237
1332
|
}));
|
|
1238
1333
|
case 2:
|
|
1239
1334
|
case "end":
|
|
1240
|
-
return
|
|
1335
|
+
return _context11.stop();
|
|
1241
1336
|
}
|
|
1242
|
-
},
|
|
1337
|
+
}, _callee11);
|
|
1243
1338
|
})));
|
|
1244
|
-
it('Resolve by userExternalId - totalResults zero', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1339
|
+
it('Resolve by userExternalId - totalResults zero', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1245
1340
|
var _callingPartyInfo$use3;
|
|
1246
1341
|
var callingPartyInfo, scimResponse, webexSpy, displayInfo, query;
|
|
1247
|
-
return _regenerator.default.wrap(function (
|
|
1248
|
-
while (1) switch (
|
|
1342
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
1343
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1249
1344
|
case 0:
|
|
1250
1345
|
callingPartyInfo = {};
|
|
1251
1346
|
scimResponse = (0, _testUtil.getSampleScimResponse)();
|
|
@@ -1257,10 +1352,10 @@ describe('resolveContact tests', function () {
|
|
|
1257
1352
|
callingPartyInfo.userExternalId = {
|
|
1258
1353
|
$: 'userExternalId'
|
|
1259
1354
|
};
|
|
1260
|
-
|
|
1355
|
+
_context12.next = 1;
|
|
1261
1356
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1262
1357
|
case 1:
|
|
1263
|
-
displayInfo =
|
|
1358
|
+
displayInfo = _context12.sent;
|
|
1264
1359
|
query = scimUrl + encodeURIComponent("id eq \"".concat((_callingPartyInfo$use3 = callingPartyInfo.userExternalId) === null || _callingPartyInfo$use3 === void 0 ? void 0 : _callingPartyInfo$use3.$, "\""));
|
|
1265
1360
|
expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.name).toBeUndefined();
|
|
1266
1361
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
@@ -1269,15 +1364,15 @@ describe('resolveContact tests', function () {
|
|
|
1269
1364
|
scimResponse.totalResults = '1';
|
|
1270
1365
|
case 2:
|
|
1271
1366
|
case "end":
|
|
1272
|
-
return
|
|
1367
|
+
return _context12.stop();
|
|
1273
1368
|
}
|
|
1274
|
-
},
|
|
1369
|
+
}, _callee12);
|
|
1275
1370
|
})));
|
|
1276
|
-
it('Resolve by userExternalId - no primary number and no phone numbers', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1371
|
+
it('Resolve by userExternalId - no primary number and no phone numbers', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
1277
1372
|
var _callingPartyInfo$use4, _displayInfo, _displayInfo2;
|
|
1278
1373
|
var callingPartyInfo, scimResponse, webexSpy, displayInfo, query, phoneNumbers;
|
|
1279
|
-
return _regenerator.default.wrap(function (
|
|
1280
|
-
while (1) switch (
|
|
1374
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1375
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1281
1376
|
case 0:
|
|
1282
1377
|
callingPartyInfo = {};
|
|
1283
1378
|
scimResponse = (0, _testUtil.getSampleScimResponse)();
|
|
@@ -1289,10 +1384,10 @@ describe('resolveContact tests', function () {
|
|
|
1289
1384
|
callingPartyInfo.userExternalId = {
|
|
1290
1385
|
$: 'userExternalId'
|
|
1291
1386
|
};
|
|
1292
|
-
|
|
1387
|
+
_context13.next = 1;
|
|
1293
1388
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1294
1389
|
case 1:
|
|
1295
|
-
displayInfo =
|
|
1390
|
+
displayInfo = _context13.sent;
|
|
1296
1391
|
query = scimUrl + encodeURIComponent("id eq \"".concat((_callingPartyInfo$use4 = callingPartyInfo.userExternalId) === null || _callingPartyInfo$use4 === void 0 ? void 0 : _callingPartyInfo$use4.$, "\""));
|
|
1297
1392
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
1298
1393
|
uri: query
|
|
@@ -1308,10 +1403,10 @@ describe('resolveContact tests', function () {
|
|
|
1308
1403
|
statusCode: 200,
|
|
1309
1404
|
body: scimResponse
|
|
1310
1405
|
});
|
|
1311
|
-
|
|
1406
|
+
_context13.next = 2;
|
|
1312
1407
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1313
1408
|
case 2:
|
|
1314
|
-
displayInfo =
|
|
1409
|
+
displayInfo = _context13.sent;
|
|
1315
1410
|
expect((_displayInfo2 = displayInfo) === null || _displayInfo2 === void 0 ? void 0 : _displayInfo2.num).toBeUndefined();
|
|
1316
1411
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
1317
1412
|
uri: query
|
|
@@ -1319,9 +1414,9 @@ describe('resolveContact tests', function () {
|
|
|
1319
1414
|
scimResponse.Resources[0].phoneNumbers = phoneNumbers;
|
|
1320
1415
|
case 3:
|
|
1321
1416
|
case "end":
|
|
1322
|
-
return
|
|
1417
|
+
return _context13.stop();
|
|
1323
1418
|
}
|
|
1324
|
-
},
|
|
1419
|
+
}, _callee13);
|
|
1325
1420
|
})));
|
|
1326
1421
|
it('Resolve by userExternalId - no photo', function () {
|
|
1327
1422
|
var callingPartyInfo = {};
|
|
@@ -1346,6 +1441,63 @@ describe('resolveContact tests', function () {
|
|
|
1346
1441
|
}));
|
|
1347
1442
|
});
|
|
1348
1443
|
});
|
|
1444
|
+
it('resolveContact escapes SCIM filter injection in userExternalId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
1445
|
+
var callingPartyInfo, injectionPayload, webexSpy, escapedValue, expectedQuery;
|
|
1446
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1447
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1448
|
+
case 0:
|
|
1449
|
+
callingPartyInfo = {};
|
|
1450
|
+
injectionPayload = 'x" or userName pr "';
|
|
1451
|
+
webexSpy = jest.spyOn(webex, 'request').mockResolvedValueOnce({
|
|
1452
|
+
statusCode: 200,
|
|
1453
|
+
body: (0, _testUtil.getSampleScimResponse)()
|
|
1454
|
+
});
|
|
1455
|
+
callingPartyInfo.userExternalId = {
|
|
1456
|
+
$: injectionPayload
|
|
1457
|
+
};
|
|
1458
|
+
_context14.next = 1;
|
|
1459
|
+
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1460
|
+
case 1:
|
|
1461
|
+
// After escaping: backslash → \\ then double-quote → \"
|
|
1462
|
+
escapedValue = injectionPayload.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
1463
|
+
expectedQuery = scimUrl + encodeURIComponent("id eq \"".concat(escapedValue, "\""));
|
|
1464
|
+
expect(webexSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
1465
|
+
uri: expectedQuery
|
|
1466
|
+
}));
|
|
1467
|
+
case 2:
|
|
1468
|
+
case "end":
|
|
1469
|
+
return _context14.stop();
|
|
1470
|
+
}
|
|
1471
|
+
}, _callee14);
|
|
1472
|
+
})));
|
|
1473
|
+
it('legitimate externalId still resolves', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1474
|
+
var callingPartyInfo, legitimateId, webexSpy, expectedQuery;
|
|
1475
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1476
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1477
|
+
case 0:
|
|
1478
|
+
callingPartyInfo = {};
|
|
1479
|
+
legitimateId = '69fde5ad-fb8b-4a1b-9998-b0999e95719b';
|
|
1480
|
+
webexSpy = jest.spyOn(webex, 'request').mockResolvedValueOnce({
|
|
1481
|
+
statusCode: 200,
|
|
1482
|
+
body: (0, _testUtil.getSampleScimResponse)()
|
|
1483
|
+
});
|
|
1484
|
+
callingPartyInfo.userExternalId = {
|
|
1485
|
+
$: legitimateId
|
|
1486
|
+
};
|
|
1487
|
+
_context15.next = 1;
|
|
1488
|
+
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1489
|
+
case 1:
|
|
1490
|
+
// A UUID contains no SCIM metacharacters; the query string is unchanged
|
|
1491
|
+
expectedQuery = scimUrl + encodeURIComponent("id eq \"".concat(legitimateId, "\""));
|
|
1492
|
+
expect(webexSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
1493
|
+
uri: expectedQuery
|
|
1494
|
+
}));
|
|
1495
|
+
case 2:
|
|
1496
|
+
case "end":
|
|
1497
|
+
return _context15.stop();
|
|
1498
|
+
}
|
|
1499
|
+
}, _callee15);
|
|
1500
|
+
})));
|
|
1349
1501
|
it('Resolve with minimal response from SCIM', function () {
|
|
1350
1502
|
var callingPartyInfo = {};
|
|
1351
1503
|
var scimResponse = (0, _testUtil.getSampleMinimumScimResponse)();
|
|
@@ -1386,10 +1538,10 @@ describe('resolveContact tests', function () {
|
|
|
1386
1538
|
}));
|
|
1387
1539
|
});
|
|
1388
1540
|
});
|
|
1389
|
-
it('Resolve by name - Empty Info', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1541
|
+
it('Resolve by name - Empty Info', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1390
1542
|
var callingPartyInfo, peopleListResponse, items, webexSpy, displayInfo;
|
|
1391
|
-
return _regenerator.default.wrap(function (
|
|
1392
|
-
while (1) switch (
|
|
1543
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1544
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1393
1545
|
case 0:
|
|
1394
1546
|
callingPartyInfo = {};
|
|
1395
1547
|
peopleListResponse = (0, _testUtil.getSamplePeopleListResponse)();
|
|
@@ -1399,10 +1551,10 @@ describe('resolveContact tests', function () {
|
|
|
1399
1551
|
callingPartyInfo.name = {
|
|
1400
1552
|
$: 'Name'
|
|
1401
1553
|
};
|
|
1402
|
-
|
|
1554
|
+
_context16.next = 1;
|
|
1403
1555
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1404
1556
|
case 1:
|
|
1405
|
-
displayInfo =
|
|
1557
|
+
displayInfo = _context16.sent;
|
|
1406
1558
|
expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.name).toBeUndefined();
|
|
1407
1559
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
1408
1560
|
displayName: 'Name'
|
|
@@ -1410,15 +1562,15 @@ describe('resolveContact tests', function () {
|
|
|
1410
1562
|
peopleListResponse.items = items;
|
|
1411
1563
|
case 2:
|
|
1412
1564
|
case "end":
|
|
1413
|
-
return
|
|
1565
|
+
return _context16.stop();
|
|
1414
1566
|
}
|
|
1415
|
-
},
|
|
1567
|
+
}, _callee16);
|
|
1416
1568
|
})));
|
|
1417
|
-
it('Resolve by name - ID as plain UUID instead of part of URI', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1569
|
+
it('Resolve by name - ID as plain UUID instead of part of URI', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
1418
1570
|
var _displayInfo3, _displayInfo4, _displayInfo5, _displayInfo6, _displayInfo7, _displayInfo8;
|
|
1419
1571
|
var callingPartyInfo, peopleListResponse, id, webexSpy, displayInfo;
|
|
1420
|
-
return _regenerator.default.wrap(function (
|
|
1421
|
-
while (1) switch (
|
|
1572
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1573
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1422
1574
|
case 0:
|
|
1423
1575
|
callingPartyInfo = {};
|
|
1424
1576
|
peopleListResponse = (0, _testUtil.getSamplePeopleListResponse)();
|
|
@@ -1429,10 +1581,10 @@ describe('resolveContact tests', function () {
|
|
|
1429
1581
|
callingPartyInfo.name = {
|
|
1430
1582
|
$: 'Name'
|
|
1431
1583
|
};
|
|
1432
|
-
|
|
1584
|
+
_context17.next = 1;
|
|
1433
1585
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1434
1586
|
case 1:
|
|
1435
|
-
displayInfo =
|
|
1587
|
+
displayInfo = _context17.sent;
|
|
1436
1588
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
1437
1589
|
displayName: 'Name'
|
|
1438
1590
|
}));
|
|
@@ -1445,10 +1597,10 @@ describe('resolveContact tests', function () {
|
|
|
1445
1597
|
/* Also test empty id */
|
|
1446
1598
|
peopleListResponse.items[0].id = '';
|
|
1447
1599
|
webex.people.list.mockResolvedValueOnce(peopleListResponse);
|
|
1448
|
-
|
|
1600
|
+
_context17.next = 2;
|
|
1449
1601
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1450
1602
|
case 2:
|
|
1451
|
-
displayInfo =
|
|
1603
|
+
displayInfo = _context17.sent;
|
|
1452
1604
|
expect((_displayInfo7 = displayInfo) === null || _displayInfo7 === void 0 ? void 0 : _displayInfo7.id).toStrictEqual('');
|
|
1453
1605
|
expect((_displayInfo8 = displayInfo) === null || _displayInfo8 === void 0 ? void 0 : _displayInfo8.name).toStrictEqual(peopleListResponse.items[0].displayName);
|
|
1454
1606
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
@@ -1457,14 +1609,14 @@ describe('resolveContact tests', function () {
|
|
|
1457
1609
|
peopleListResponse.items[0].id = id;
|
|
1458
1610
|
case 3:
|
|
1459
1611
|
case "end":
|
|
1460
|
-
return
|
|
1612
|
+
return _context17.stop();
|
|
1461
1613
|
}
|
|
1462
|
-
},
|
|
1614
|
+
}, _callee17);
|
|
1463
1615
|
})));
|
|
1464
|
-
it('Resolve by name - Phone numbers no match for type - work', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1616
|
+
it('Resolve by name - Phone numbers no match for type - work', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
1465
1617
|
var callingPartyInfo, peopleListResponse, phoneNumbers, webexSpy, displayInfo;
|
|
1466
|
-
return _regenerator.default.wrap(function (
|
|
1467
|
-
while (1) switch (
|
|
1618
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1619
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1468
1620
|
case 0:
|
|
1469
1621
|
callingPartyInfo = {};
|
|
1470
1622
|
peopleListResponse = (0, _testUtil.getSamplePeopleListResponse)();
|
|
@@ -1475,10 +1627,10 @@ describe('resolveContact tests', function () {
|
|
|
1475
1627
|
callingPartyInfo.name = {
|
|
1476
1628
|
$: 'Name'
|
|
1477
1629
|
};
|
|
1478
|
-
|
|
1630
|
+
_context18.next = 1;
|
|
1479
1631
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1480
1632
|
case 1:
|
|
1481
|
-
displayInfo =
|
|
1633
|
+
displayInfo = _context18.sent;
|
|
1482
1634
|
expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.name).toStrictEqual(peopleListResponse.items[0].displayName);
|
|
1483
1635
|
expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.num).toStrictEqual(peopleListResponse.items[0].phoneNumbers[0].value);
|
|
1484
1636
|
expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.avatarSrc).toStrictEqual(peopleListResponse.items[0].avatar);
|
|
@@ -1488,14 +1640,14 @@ describe('resolveContact tests', function () {
|
|
|
1488
1640
|
peopleListResponse.items[0].phoneNumbers = phoneNumbers;
|
|
1489
1641
|
case 2:
|
|
1490
1642
|
case "end":
|
|
1491
|
-
return
|
|
1643
|
+
return _context18.stop();
|
|
1492
1644
|
}
|
|
1493
|
-
},
|
|
1645
|
+
}, _callee18);
|
|
1494
1646
|
})));
|
|
1495
|
-
it('Resolve by name - Phone numbers empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1647
|
+
it('Resolve by name - Phone numbers empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1496
1648
|
var callingPartyInfo, peopleListResponse, phoneNumbers, webexSpy, displayInfo;
|
|
1497
|
-
return _regenerator.default.wrap(function (
|
|
1498
|
-
while (1) switch (
|
|
1649
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1650
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1499
1651
|
case 0:
|
|
1500
1652
|
callingPartyInfo = {};
|
|
1501
1653
|
peopleListResponse = (0, _testUtil.getSamplePeopleListResponse)();
|
|
@@ -1505,10 +1657,10 @@ describe('resolveContact tests', function () {
|
|
|
1505
1657
|
callingPartyInfo.name = {
|
|
1506
1658
|
$: 'Name'
|
|
1507
1659
|
};
|
|
1508
|
-
|
|
1660
|
+
_context19.next = 1;
|
|
1509
1661
|
return (0, _Utils.resolveContact)(callingPartyInfo);
|
|
1510
1662
|
case 1:
|
|
1511
|
-
displayInfo =
|
|
1663
|
+
displayInfo = _context19.sent;
|
|
1512
1664
|
expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
|
|
1513
1665
|
displayName: 'Name'
|
|
1514
1666
|
}));
|
|
@@ -1518,9 +1670,9 @@ describe('resolveContact tests', function () {
|
|
|
1518
1670
|
peopleListResponse.items[0].phoneNumbers = phoneNumbers;
|
|
1519
1671
|
case 2:
|
|
1520
1672
|
case "end":
|
|
1521
|
-
return
|
|
1673
|
+
return _context19.stop();
|
|
1522
1674
|
}
|
|
1523
|
-
},
|
|
1675
|
+
}, _callee19);
|
|
1524
1676
|
})));
|
|
1525
1677
|
});
|
|
1526
1678
|
describe('Store and Fetch voicemail tests', function () {
|
|
@@ -1638,40 +1790,40 @@ describe('Infer id from UUID Tests', function () {
|
|
|
1638
1790
|
});
|
|
1639
1791
|
});
|
|
1640
1792
|
describe('Get endpoint by CALLING_BACKEND tests', function () {
|
|
1641
|
-
it('verify invalid calling backend ucm for xsi endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1793
|
+
it('verify invalid calling backend ucm for xsi endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1642
1794
|
var _t;
|
|
1643
|
-
return _regenerator.default.wrap(function (
|
|
1644
|
-
while (1) switch (
|
|
1795
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1796
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1645
1797
|
case 0:
|
|
1646
1798
|
_t = expect;
|
|
1647
|
-
|
|
1799
|
+
_context20.next = 1;
|
|
1648
1800
|
return (0, _Utils.getXsiActionEndpoint)(webex, {
|
|
1649
1801
|
file: 'testFile',
|
|
1650
1802
|
method: 'testMethod'
|
|
1651
1803
|
}, _types.CALLING_BACKEND.UCM);
|
|
1652
1804
|
case 1:
|
|
1653
|
-
_t(
|
|
1805
|
+
_t(_context20.sent).toBeInstanceOf(Error);
|
|
1654
1806
|
case 2:
|
|
1655
1807
|
case "end":
|
|
1656
|
-
return
|
|
1808
|
+
return _context20.stop();
|
|
1657
1809
|
}
|
|
1658
|
-
},
|
|
1810
|
+
}, _callee20);
|
|
1659
1811
|
})));
|
|
1660
|
-
it('verify invalid calling backend wxc for vg endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1812
|
+
it('verify invalid calling backend wxc for vg endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1661
1813
|
var _t2;
|
|
1662
|
-
return _regenerator.default.wrap(function (
|
|
1663
|
-
while (1) switch (
|
|
1814
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1815
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1664
1816
|
case 0:
|
|
1665
1817
|
_t2 = expect;
|
|
1666
|
-
|
|
1818
|
+
_context21.next = 1;
|
|
1667
1819
|
return (0, _Utils.getVgActionEndpoint)(webex, _types.CALLING_BACKEND.WXC);
|
|
1668
1820
|
case 1:
|
|
1669
|
-
_t2(
|
|
1821
|
+
_t2(_context21.sent).toBeInstanceOf(Error);
|
|
1670
1822
|
case 2:
|
|
1671
1823
|
case "end":
|
|
1672
|
-
return
|
|
1824
|
+
return _context21.stop();
|
|
1673
1825
|
}
|
|
1674
|
-
},
|
|
1826
|
+
}, _callee21);
|
|
1675
1827
|
})));
|
|
1676
1828
|
});
|
|
1677
1829
|
describe('Get XSI Action Endpoint tests', function () {
|
|
@@ -1689,10 +1841,91 @@ describe('Get XSI Action Endpoint tests', function () {
|
|
|
1689
1841
|
file: 'testFile',
|
|
1690
1842
|
method: 'testMethod'
|
|
1691
1843
|
};
|
|
1692
|
-
|
|
1844
|
+
var expectedXsiEndpoint = 'https://api-proxy-si.broadcloudpbx.net/com.broadsoft.xsi-actions';
|
|
1845
|
+
beforeEach(function () {
|
|
1846
|
+
mockWebex.request.mockClear();
|
|
1847
|
+
});
|
|
1848
|
+
it('should return xsiEndpoint for WXC backend using _serviceUrls.hydra', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1849
|
+
var hydraEndpoint, wxcWebex, result;
|
|
1850
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1851
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1852
|
+
case 0:
|
|
1853
|
+
hydraEndpoint = 'https://hydra-a.wbx2.com/v1/';
|
|
1854
|
+
wxcWebex = {
|
|
1855
|
+
request: jest.fn().mockResolvedValue({
|
|
1856
|
+
statusCode: 200,
|
|
1857
|
+
body: _testFixtures.xsiEndpointUrlResponse
|
|
1858
|
+
}),
|
|
1859
|
+
internal: {
|
|
1860
|
+
services: {
|
|
1861
|
+
_serviceUrls: {
|
|
1862
|
+
hydra: hydraEndpoint
|
|
1863
|
+
},
|
|
1864
|
+
_activeServices: {
|
|
1865
|
+
hydra: 'urn:TEAM:us-east-2_a:hydra'
|
|
1866
|
+
},
|
|
1867
|
+
get: jest.fn()
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
};
|
|
1871
|
+
_context22.next = 1;
|
|
1872
|
+
return (0, _Utils.getXsiActionEndpoint)(wxcWebex, loggerContext, _types.CALLING_BACKEND.WXC);
|
|
1873
|
+
case 1:
|
|
1874
|
+
result = _context22.sent;
|
|
1875
|
+
expect(wxcWebex.request).toBeCalledOnceWith({
|
|
1876
|
+
method: _types.HTTP_METHODS.GET,
|
|
1877
|
+
uri: "".concat(hydraEndpoint, "/").concat(_constants2.XSI_ACTION_ENDPOINT_ORG_URL_PARAM)
|
|
1878
|
+
});
|
|
1879
|
+
expect(result).toBe(expectedXsiEndpoint);
|
|
1880
|
+
expect(wxcWebex.internal.services.get).not.toHaveBeenCalled();
|
|
1881
|
+
case 2:
|
|
1882
|
+
case "end":
|
|
1883
|
+
return _context22.stop();
|
|
1884
|
+
}
|
|
1885
|
+
}, _callee22);
|
|
1886
|
+
})));
|
|
1887
|
+
it('should return xsiEndpoint for WXC backend using services.get when _serviceUrls is undefined', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1888
|
+
var hydraEndpoint, activeHydraCluster, wxcWebex, result;
|
|
1889
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1890
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1891
|
+
case 0:
|
|
1892
|
+
hydraEndpoint = 'https://hydra-a.wbx2.com/v1/';
|
|
1893
|
+
activeHydraCluster = 'urn:TEAM:us-east-2_a:hydra';
|
|
1894
|
+
wxcWebex = {
|
|
1895
|
+
request: jest.fn().mockResolvedValue({
|
|
1896
|
+
statusCode: 200,
|
|
1897
|
+
body: _testFixtures.xsiEndpointUrlResponse
|
|
1898
|
+
}),
|
|
1899
|
+
internal: {
|
|
1900
|
+
services: {
|
|
1901
|
+
_serviceUrls: undefined,
|
|
1902
|
+
_activeServices: {
|
|
1903
|
+
hydra: activeHydraCluster
|
|
1904
|
+
},
|
|
1905
|
+
get: jest.fn().mockReturnValue(hydraEndpoint)
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
};
|
|
1909
|
+
_context23.next = 1;
|
|
1910
|
+
return (0, _Utils.getXsiActionEndpoint)(wxcWebex, loggerContext, _types.CALLING_BACKEND.WXC);
|
|
1911
|
+
case 1:
|
|
1912
|
+
result = _context23.sent;
|
|
1913
|
+
expect(wxcWebex.internal.services.get).toBeCalledOnceWith(activeHydraCluster);
|
|
1914
|
+
expect(wxcWebex.request).toBeCalledOnceWith({
|
|
1915
|
+
method: _types.HTTP_METHODS.GET,
|
|
1916
|
+
uri: "".concat(hydraEndpoint, "/").concat(_constants2.XSI_ACTION_ENDPOINT_ORG_URL_PARAM)
|
|
1917
|
+
});
|
|
1918
|
+
expect(result).toBe(expectedXsiEndpoint);
|
|
1919
|
+
case 2:
|
|
1920
|
+
case "end":
|
|
1921
|
+
return _context23.stop();
|
|
1922
|
+
}
|
|
1923
|
+
}, _callee23);
|
|
1924
|
+
})));
|
|
1925
|
+
it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1693
1926
|
var mockResponse, xsiEndpoint;
|
|
1694
|
-
return _regenerator.default.wrap(function (
|
|
1695
|
-
while (1) switch (
|
|
1927
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1928
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1696
1929
|
case 0:
|
|
1697
1930
|
mockResponse = {
|
|
1698
1931
|
body: {
|
|
@@ -1704,22 +1937,22 @@ describe('Get XSI Action Endpoint tests', function () {
|
|
|
1704
1937
|
}
|
|
1705
1938
|
};
|
|
1706
1939
|
mockWebex.request.mockResolvedValue(mockResponse);
|
|
1707
|
-
|
|
1940
|
+
_context24.next = 1;
|
|
1708
1941
|
return (0, _Utils.getXsiActionEndpoint)(mockWebex, loggerContext, _types.CALLING_BACKEND.BWRKS);
|
|
1709
1942
|
case 1:
|
|
1710
|
-
xsiEndpoint =
|
|
1943
|
+
xsiEndpoint = _context24.sent;
|
|
1711
1944
|
expect(mockWebex.request).toHaveBeenCalledTimes(1);
|
|
1712
1945
|
expect(xsiEndpoint).toBe('https://fake-broadworks-url.com');
|
|
1713
1946
|
case 2:
|
|
1714
1947
|
case "end":
|
|
1715
|
-
return
|
|
1948
|
+
return _context24.stop();
|
|
1716
1949
|
}
|
|
1717
|
-
},
|
|
1950
|
+
}, _callee24);
|
|
1718
1951
|
})));
|
|
1719
|
-
it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0/', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1952
|
+
it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0/', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1720
1953
|
var mockResponse, xsiEndpoint;
|
|
1721
|
-
return _regenerator.default.wrap(function (
|
|
1722
|
-
while (1) switch (
|
|
1954
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1955
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1723
1956
|
case 0:
|
|
1724
1957
|
mockResponse = {
|
|
1725
1958
|
body: {
|
|
@@ -1731,22 +1964,22 @@ describe('Get XSI Action Endpoint tests', function () {
|
|
|
1731
1964
|
}
|
|
1732
1965
|
};
|
|
1733
1966
|
mockWebex.request.mockResolvedValue(mockResponse);
|
|
1734
|
-
|
|
1967
|
+
_context25.next = 1;
|
|
1735
1968
|
return (0, _Utils.getXsiActionEndpoint)(mockWebex, loggerContext, _types.CALLING_BACKEND.BWRKS);
|
|
1736
1969
|
case 1:
|
|
1737
|
-
xsiEndpoint =
|
|
1970
|
+
xsiEndpoint = _context25.sent;
|
|
1738
1971
|
expect(mockWebex.request).toHaveBeenCalledTimes(1);
|
|
1739
1972
|
expect(xsiEndpoint).toBe('https://fake-broadworks-url.com');
|
|
1740
1973
|
case 2:
|
|
1741
1974
|
case "end":
|
|
1742
|
-
return
|
|
1975
|
+
return _context25.stop();
|
|
1743
1976
|
}
|
|
1744
|
-
},
|
|
1977
|
+
}, _callee25);
|
|
1745
1978
|
})));
|
|
1746
|
-
it('should return xsiEndpoint for BWRKS backend when URL does not end with any version', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1979
|
+
it('should return xsiEndpoint for BWRKS backend when URL does not end with any version', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1747
1980
|
var mockResponse, xsiEndpoint;
|
|
1748
|
-
return _regenerator.default.wrap(function (
|
|
1749
|
-
while (1) switch (
|
|
1981
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1982
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1750
1983
|
case 0:
|
|
1751
1984
|
mockResponse = {
|
|
1752
1985
|
body: {
|
|
@@ -1758,67 +1991,19 @@ describe('Get XSI Action Endpoint tests', function () {
|
|
|
1758
1991
|
}
|
|
1759
1992
|
};
|
|
1760
1993
|
mockWebex.request.mockResolvedValue(mockResponse);
|
|
1761
|
-
|
|
1994
|
+
_context26.next = 1;
|
|
1762
1995
|
return (0, _Utils.getXsiActionEndpoint)(mockWebex, loggerContext, _types.CALLING_BACKEND.BWRKS);
|
|
1763
1996
|
case 1:
|
|
1764
|
-
xsiEndpoint =
|
|
1997
|
+
xsiEndpoint = _context26.sent;
|
|
1765
1998
|
expect(mockWebex.request).toHaveBeenCalledTimes(1);
|
|
1766
1999
|
expect(xsiEndpoint).toBe('https://fake-broadworks-url.com');
|
|
1767
2000
|
case 2:
|
|
1768
2001
|
case "end":
|
|
1769
|
-
return
|
|
2002
|
+
return _context26.stop();
|
|
1770
2003
|
}
|
|
1771
|
-
},
|
|
2004
|
+
}, _callee26);
|
|
1772
2005
|
})));
|
|
1773
2006
|
});
|
|
1774
|
-
describe('modifySdpForIPv4', function () {
|
|
1775
|
-
it('should return original SDP if input is empty', function () {
|
|
1776
|
-
expect((0, _Utils.modifySdpForIPv4)('')).toBe('');
|
|
1777
|
-
});
|
|
1778
|
-
it('should return original SDP if there is no IPv6 c= line', function () {
|
|
1779
|
-
var sdp = "v=0\no=- 12345 67890 IN IP4 192.168.1.1\n\ns=Test Session";
|
|
1780
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp)).toEqual(sdp);
|
|
1781
|
-
});
|
|
1782
|
-
it('should replace IPv6 c= line with default IPv4 if no IPv4 candidate exists', function () {
|
|
1783
|
-
var sdp = "v=0\n o=- 12345 67890 IN IP6 2001:db8::1\n s=Test Session\n c=IN IP6 2001:db8::1\n a=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host";
|
|
1784
|
-
var expectedSdp = "v=0\no=- 12345 67890 IN IP6 2001:db8::1\ns=Test Session\nc=IN IP4 192.1.1.1\na=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host\na=candidate:2 1 UDP 2122260223 192.1.1.1 3478 typ host generation 0 network-id 1 network-cost 10";
|
|
1785
|
-
var result = (0, _Utils.modifySdpForIPv4)(sdp);
|
|
1786
|
-
expect(result).toEqual(expectedSdp);
|
|
1787
|
-
});
|
|
1788
|
-
it('should replace IPv6 c= line with an existing IPv4 candidate address', function () {
|
|
1789
|
-
var sdp = "v=0\n o=- 12345 67890 IN IP6 2001:db8::1\n s=Test Session\n c=IN IP6 2001:db8::1\n a=candidate:1 1 UDP 2122260223 192.168.1.2 3478 typ host";
|
|
1790
|
-
var expectedSdp = "v=0\no=- 12345 67890 IN IP6 2001:db8::1\ns=Test Session\nc=IN IP4 192.168.1.2\na=candidate:1 1 UDP 2122260223 192.168.1.2 3478 typ host";
|
|
1791
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp).trim()).toEqual(expectedSdp.trim());
|
|
1792
|
-
});
|
|
1793
|
-
it('should correctly handle both UDP and TCP candidates by adding only one IPv4 candidate UDP first', function () {
|
|
1794
|
-
var sdp = "v=0\n o=- 12345 67890 IN IP6 2001:db8::1\n s=Test Session\n c=IN IP6 2001:db8::1\n a=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host\n a=candidate:2 1 TCP 2122260223 2001:db8::2 3479 typ host";
|
|
1795
|
-
var expectedSdp = "v=0\no=- 12345 67890 IN IP6 2001:db8::1\ns=Test Session\nc=IN IP4 192.1.1.1\na=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host\na=candidate:2 1 UDP 2122260223 192.1.1.1 3478 typ host generation 0 network-id 1 network-cost 10\na=candidate:2 1 TCP 2122260223 2001:db8::2 3479 typ host\n";
|
|
1796
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp).trim()).toEqual(expectedSdp.trim());
|
|
1797
|
-
});
|
|
1798
|
-
it('should correctly handle both UDP and TCP candidates by adding only one IPv4 candidate TCP first', function () {
|
|
1799
|
-
var sdp = "v=0\n o=- 12345 67890 IN IP6 2001:db8::1\n s=Test Session\n c=IN IP6 2001:db8::1\n a=candidate:1 1 TCP 2122260223 2001:db8::2 3479 typ host\n a=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host";
|
|
1800
|
-
var expectedSdp = "v=0\no=- 12345 67890 IN IP6 2001:db8::1\ns=Test Session\nc=IN IP4 192.1.1.1\na=candidate:1 1 TCP 2122260223 2001:db8::2 3479 typ host\na=candidate:2 1 TCP 2122260223 192.1.1.1 3479 typ host generation 0 network-id 1 network-cost 10\na=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host";
|
|
1801
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp).trim()).toEqual(expectedSdp.trim());
|
|
1802
|
-
});
|
|
1803
|
-
it('should replace all IPv6 c= line if multiple exist', function () {
|
|
1804
|
-
var sdp = "v=0\n o=- 12345 67890 IN IP6 2001:db8::1\n s=Test Session\n c=IN IP6 2001:db8::1\n c=IN IP6 2001:db8::2\n a=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host";
|
|
1805
|
-
var expectedSdp = "v=0\no=- 12345 67890 IN IP6 2001:db8::1\ns=Test Session\nc=IN IP4 192.1.1.1\nc=IN IP4 192.1.1.1\na=candidate:1 1 UDP 2122260223 2001:db8::1 3478 typ host\na=candidate:2 1 UDP 2122260223 192.1.1.1 3478 typ host generation 0 network-id 1 network-cost 10";
|
|
1806
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp).trim()).toEqual(expectedSdp.trim());
|
|
1807
|
-
});
|
|
1808
|
-
it('should not modify SDP if IPv6 c= line is absent and IPv4 candidate already exists', function () {
|
|
1809
|
-
var sdp = "v=0\no=- 12345 67890 IN IP4 192.168.1.1\ns=Test Session\nc=IN IP4 192.168.1.1\na=candidate:1 1 UDP 2122260223 192.168.1.1 3478 typ host";
|
|
1810
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp).trim()).toEqual(sdp.trim());
|
|
1811
|
-
});
|
|
1812
|
-
it('should handle malformed SDP gracefully and return unmodified input', function () {
|
|
1813
|
-
var malformedSdp = "random text without proper format";
|
|
1814
|
-
expect((0, _Utils.modifySdpForIPv4)(malformedSdp).trim()).toEqual(malformedSdp.trim());
|
|
1815
|
-
});
|
|
1816
|
-
it('should handle an SDP with both IP6 and IP4 c= lines correctly', function () {
|
|
1817
|
-
var sdp = "v=0\n o=- 12345 67890 IN IP6 2001:db8::1\n s=Test Session\n c=IN IP6 2001:db8::1\n c=IN IP4 192.168.1.3\n a=candidate:1 1 UDP 2122260223 192.168.1.3 3478 typ host";
|
|
1818
|
-
var expectedSdp = "v=0\no=- 12345 67890 IN IP6 2001:db8::1\ns=Test Session\nc=IN IP4 192.168.1.3\nc=IN IP4 192.168.1.3\na=candidate:1 1 UDP 2122260223 192.168.1.3 3478 typ host";
|
|
1819
|
-
expect((0, _Utils.modifySdpForIPv4)(sdp).trim()).toEqual(expectedSdp.trim());
|
|
1820
|
-
});
|
|
1821
|
-
});
|
|
1822
2007
|
describe('uploadLogs', function () {
|
|
1823
2008
|
var submitLogsMock;
|
|
1824
2009
|
beforeEach(function () {
|
|
@@ -1838,19 +2023,19 @@ describe('uploadLogs', function () {
|
|
|
1838
2023
|
afterEach(function () {
|
|
1839
2024
|
jest.clearAllMocks();
|
|
1840
2025
|
});
|
|
1841
|
-
it('should upload logs and return the response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2026
|
+
it('should upload logs and return the response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1842
2027
|
var mockMetaData, logSpy, result;
|
|
1843
|
-
return _regenerator.default.wrap(function (
|
|
1844
|
-
while (1) switch (
|
|
2028
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
2029
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1845
2030
|
case 0:
|
|
1846
2031
|
mockMetaData = {
|
|
1847
2032
|
correlationId: 'test-correlation'
|
|
1848
2033
|
};
|
|
1849
2034
|
logSpy = jest.spyOn(_Logger.default, 'info');
|
|
1850
|
-
|
|
2035
|
+
_context27.next = 1;
|
|
1851
2036
|
return (0, _Utils.uploadLogs)(mockMetaData, true);
|
|
1852
2037
|
case 1:
|
|
1853
|
-
result =
|
|
2038
|
+
result = _context27.sent;
|
|
1854
2039
|
expect(result).toEqual({
|
|
1855
2040
|
trackingid: '1234',
|
|
1856
2041
|
feedbackId: 'mocked-uuid-12345'
|
|
@@ -1883,14 +2068,14 @@ describe('uploadLogs', function () {
|
|
|
1883
2068
|
});
|
|
1884
2069
|
case 2:
|
|
1885
2070
|
case "end":
|
|
1886
|
-
return
|
|
2071
|
+
return _context27.stop();
|
|
1887
2072
|
}
|
|
1888
|
-
},
|
|
2073
|
+
}, _callee27);
|
|
1889
2074
|
})));
|
|
1890
|
-
it('should log and throw an error if the upload fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2075
|
+
it('should log and throw an error if the upload fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1891
2076
|
var mockMetaData, mockError, logSpy, _t3;
|
|
1892
|
-
return _regenerator.default.wrap(function (
|
|
1893
|
-
while (1) switch (
|
|
2077
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
2078
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1894
2079
|
case 0:
|
|
1895
2080
|
mockMetaData = {
|
|
1896
2081
|
correlationId: 'test-correlation'
|
|
@@ -1898,17 +2083,17 @@ describe('uploadLogs', function () {
|
|
|
1898
2083
|
mockError = new Error('Upload failed'); // Mock the submitLogs to fail
|
|
1899
2084
|
submitLogsMock.mockRejectedValueOnce(mockError);
|
|
1900
2085
|
logSpy = jest.spyOn(_Logger.default, 'error');
|
|
1901
|
-
|
|
1902
|
-
|
|
2086
|
+
_context28.prev = 1;
|
|
2087
|
+
_context28.next = 2;
|
|
1903
2088
|
return (0, _Utils.uploadLogs)(mockMetaData, true);
|
|
1904
2089
|
case 2:
|
|
1905
2090
|
// If we get here, the test should fail since we expected an exception
|
|
1906
2091
|
expect(true).toBe(false); // This will fail the test if no exception is thrown
|
|
1907
|
-
|
|
2092
|
+
_context28.next = 4;
|
|
1908
2093
|
break;
|
|
1909
2094
|
case 3:
|
|
1910
|
-
|
|
1911
|
-
_t3 =
|
|
2095
|
+
_context28.prev = 3;
|
|
2096
|
+
_t3 = _context28["catch"](1);
|
|
1912
2097
|
expect(_t3).toBe(mockError);
|
|
1913
2098
|
expect(logSpy).toHaveBeenCalledWith("Failed to upload Logs ".concat((0, _stringify.default)(_t3)), {
|
|
1914
2099
|
file: _constants.UTILS_FILE,
|
|
@@ -1935,14 +2120,14 @@ describe('uploadLogs', function () {
|
|
|
1935
2120
|
});
|
|
1936
2121
|
case 4:
|
|
1937
2122
|
case "end":
|
|
1938
|
-
return
|
|
2123
|
+
return _context28.stop();
|
|
1939
2124
|
}
|
|
1940
|
-
},
|
|
2125
|
+
}, _callee28, null, [[1, 3]]);
|
|
1941
2126
|
})));
|
|
1942
|
-
it('should log error and not throw an error if the upload fails with throw exception false', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2127
|
+
it('should log error and not throw an error if the upload fails with throw exception false', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1943
2128
|
var mockMetaData, mockError, logSpy, result;
|
|
1944
|
-
return _regenerator.default.wrap(function (
|
|
1945
|
-
while (1) switch (
|
|
2129
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
2130
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1946
2131
|
case 0:
|
|
1947
2132
|
mockMetaData = {
|
|
1948
2133
|
correlationId: 'test-correlation',
|
|
@@ -1951,10 +2136,10 @@ describe('uploadLogs', function () {
|
|
|
1951
2136
|
mockError = new Error('Upload failed'); // Mock the submitLogs to fail
|
|
1952
2137
|
submitLogsMock.mockRejectedValueOnce(mockError);
|
|
1953
2138
|
logSpy = jest.spyOn(_Logger.default, 'error');
|
|
1954
|
-
|
|
2139
|
+
_context29.next = 1;
|
|
1955
2140
|
return (0, _Utils.uploadLogs)(mockMetaData, false);
|
|
1956
2141
|
case 1:
|
|
1957
|
-
result =
|
|
2142
|
+
result = _context29.sent;
|
|
1958
2143
|
expect(result).toBeUndefined();
|
|
1959
2144
|
expect(logSpy).toHaveBeenCalledWith("Failed to upload Logs ".concat((0, _stringify.default)(mockError)), {
|
|
1960
2145
|
file: _constants.UTILS_FILE,
|
|
@@ -1981,9 +2166,88 @@ describe('uploadLogs', function () {
|
|
|
1981
2166
|
});
|
|
1982
2167
|
case 2:
|
|
1983
2168
|
case "end":
|
|
1984
|
-
return
|
|
2169
|
+
return _context29.stop();
|
|
1985
2170
|
}
|
|
1986
|
-
},
|
|
2171
|
+
}, _callee29);
|
|
1987
2172
|
})));
|
|
1988
2173
|
});
|
|
2174
|
+
describe('resolveCallingBackend', function () {
|
|
2175
|
+
var createDevice = function createDevice(callingBehavior, entitlementKeys) {
|
|
2176
|
+
return {
|
|
2177
|
+
url: 'https://wdm.example.com/devices/123',
|
|
2178
|
+
userId: 'user-id',
|
|
2179
|
+
orgId: 'org-id',
|
|
2180
|
+
version: '1.0',
|
|
2181
|
+
callingBehavior: callingBehavior,
|
|
2182
|
+
features: {
|
|
2183
|
+
developer: {
|
|
2184
|
+
models: [],
|
|
2185
|
+
get: jest.fn()
|
|
2186
|
+
},
|
|
2187
|
+
entitlement: {
|
|
2188
|
+
models: entitlementKeys.map(function (key) {
|
|
2189
|
+
return {
|
|
2190
|
+
_values: {
|
|
2191
|
+
key: key
|
|
2192
|
+
}
|
|
2193
|
+
};
|
|
2194
|
+
})
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
};
|
|
2198
|
+
};
|
|
2199
|
+
it.each([['bc-sp-basic', _types.CALLING_BACKEND.WXC], ['bc-sp-standard', _types.CALLING_BACKEND.WXC]])('returns WXC when callingBehavior is NATIVE_WEBEX_TEAMS_CALLING and entitlement is %s', function (entitlement, expected) {
|
|
2200
|
+
var device = createDevice('NATIVE_WEBEX_TEAMS_CALLING', [entitlement]);
|
|
2201
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(expected);
|
|
2202
|
+
});
|
|
2203
|
+
it('returns BWRKS when callingBehavior is NATIVE_WEBEX_TEAMS_CALLING and entitlement is broadworks-connector', function () {
|
|
2204
|
+
var device = createDevice('NATIVE_WEBEX_TEAMS_CALLING', ['broadworks-connector']);
|
|
2205
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(_types.CALLING_BACKEND.BWRKS);
|
|
2206
|
+
});
|
|
2207
|
+
it('returns UCM when callingBehavior is NATIVE_SIP_CALL_TO_UCM', function () {
|
|
2208
|
+
var device = createDevice('NATIVE_SIP_CALL_TO_UCM', []);
|
|
2209
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(_types.CALLING_BACKEND.UCM);
|
|
2210
|
+
});
|
|
2211
|
+
it('returns INVALID when callingBehavior is unknown', function () {
|
|
2212
|
+
var device = createDevice('UNKNOWN_BEHAVIOR', []);
|
|
2213
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(_types.CALLING_BACKEND.INVALID);
|
|
2214
|
+
});
|
|
2215
|
+
it('returns INVALID when callingBehavior is NATIVE_WEBEX_TEAMS_CALLING but no matching entitlement', function () {
|
|
2216
|
+
var device = createDevice('NATIVE_WEBEX_TEAMS_CALLING', ['some-other-entitlement']);
|
|
2217
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(_types.CALLING_BACKEND.INVALID);
|
|
2218
|
+
});
|
|
2219
|
+
it('matches the first qualifying entitlement when multiple are present', function () {
|
|
2220
|
+
var device = createDevice('NATIVE_WEBEX_TEAMS_CALLING', ['broadworks-connector', 'bc-sp-basic']);
|
|
2221
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(_types.CALLING_BACKEND.BWRKS);
|
|
2222
|
+
});
|
|
2223
|
+
});
|
|
2224
|
+
describe('getCallingBackEnd', function () {
|
|
2225
|
+
it('passes webex.internal.device to resolveCallingBackend and returns its result', function () {
|
|
2226
|
+
var device = {
|
|
2227
|
+
url: 'https://wdm.example.com/devices/123',
|
|
2228
|
+
userId: 'user-id',
|
|
2229
|
+
orgId: 'org-id',
|
|
2230
|
+
version: '1.0',
|
|
2231
|
+
callingBehavior: 'NATIVE_SIP_CALL_TO_UCM',
|
|
2232
|
+
features: {
|
|
2233
|
+
developer: {
|
|
2234
|
+
models: [],
|
|
2235
|
+
get: jest.fn()
|
|
2236
|
+
},
|
|
2237
|
+
entitlement: {
|
|
2238
|
+
models: []
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
};
|
|
2242
|
+
var mockWebex = {
|
|
2243
|
+
internal: {
|
|
2244
|
+
device: device
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2247
|
+
var result = (0, _Utils.getCallingBackEnd)(mockWebex);
|
|
2248
|
+
expect(result).toBe((0, _Utils.resolveCallingBackend)(device));
|
|
2249
|
+
expect((0, _Utils.resolveCallingBackend)(device)).toBe(_types.CALLING_BACKEND.UCM);
|
|
2250
|
+
expect(result).toBe(_types.CALLING_BACKEND.UCM);
|
|
2251
|
+
});
|
|
2252
|
+
});
|
|
1989
2253
|
//# sourceMappingURL=Utils.test.js.map
|