@webex/calling 3.4.0 → 3.5.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallHistory/CallHistory.js +103 -4
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +143 -0
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js +224 -1
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js +8 -2
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +1 -1
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/constants.js +1 -3
- package/dist/CallSettings/constants.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +11 -2
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +249 -193
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +81 -0
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +332 -217
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +2 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/registration/register.js +18 -13
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +242 -125
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +39 -27
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +64 -1
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Contacts/contactFixtures.js +26 -3
- package/dist/Contacts/contactFixtures.js.map +1 -1
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.js +2 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/common/Utils.js +10 -8
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +25 -1
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +5 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +23 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +57 -3
- package/dist/module/CallHistory/callHistoryFixtures.js +215 -0
- package/dist/module/CallHistory/constants.js +7 -1
- package/dist/module/CallSettings/UcmBackendConnector.js +5 -3
- package/dist/module/CallSettings/constants.js +0 -2
- package/dist/module/CallingClient/CallingClient.js +13 -2
- package/dist/module/CallingClient/calling/call.js +50 -0
- package/dist/module/CallingClient/constants.js +1 -0
- package/dist/module/CallingClient/registration/register.js +12 -6
- package/dist/module/Contacts/ContactsClient.js +28 -17
- package/dist/module/Contacts/contactFixtures.js +25 -2
- package/dist/module/Metrics/index.js +6 -2
- package/dist/module/common/Utils.js +7 -5
- package/dist/module/common/constants.js +4 -0
- package/dist/module/common/testUtil.js +24 -0
- package/dist/types/CallHistory/CallHistory.d.ts +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts +98 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
- package/dist/types/CallHistory/constants.d.ts +7 -1
- package/dist/types/CallHistory/constants.d.ts.map +1 -1
- package/dist/types/CallHistory/types.d.ts +9 -1
- package/dist/types/CallHistory/types.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/constants.d.ts +0 -2
- package/dist/types/CallSettings/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +1 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +1 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +1 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/contactFixtures.d.ts +28 -0
- package/dist/types/Contacts/contactFixtures.d.ts.map +1 -1
- package/dist/types/Contacts/types.d.ts +3 -3
- package/dist/types/Contacts/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +15 -0
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/common/Utils.d.ts +2 -2
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +4 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +20 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +12 -12
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -50,6 +50,62 @@ describe('CallingClient Tests', function () {
|
|
|
50
50
|
originalProcessNextTick(resolve);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
describe('CallingClient pick Mobius cluster using Service Host Tests', function () {
|
|
54
|
+
afterAll(function () {
|
|
55
|
+
callManager.removeAllListeners();
|
|
56
|
+
webex.internal.services['_serviceUrls']['mobius'] = 'https://mobius.aintgen-a-1.int.infra.webex.com/api/v1';
|
|
57
|
+
webex.internal.services['_hostCatalog'] = _callingClientFixtures.mockCatalogUS;
|
|
58
|
+
});
|
|
59
|
+
it('should set mobiusServiceHost correctly when URL is valid', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
60
|
+
var urlSpy, callingClient;
|
|
61
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
62
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
webex.internal.services._hostCatalog = _callingClientFixtures.mockCatalogEU;
|
|
65
|
+
webex.internal.services['_serviceUrls']['mobius'] = 'https://mobius-eu-central-1.prod.infra.webex.com/api/v1';
|
|
66
|
+
urlSpy = jest.spyOn(window, 'URL').mockImplementation(function (url) {
|
|
67
|
+
return new window.URL(url);
|
|
68
|
+
});
|
|
69
|
+
_context.next = 5;
|
|
70
|
+
return (0, _CallingClient.createClient)(webex, {
|
|
71
|
+
logger: {
|
|
72
|
+
level: _types.LOGGER.INFO
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
case 5:
|
|
76
|
+
callingClient = _context.sent;
|
|
77
|
+
expect(urlSpy).toHaveBeenCalledWith('https://mobius-eu-central-1.prod.infra.webex.com/api/v1');
|
|
78
|
+
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.mockEUServiceHosts);
|
|
79
|
+
urlSpy.mockRestore();
|
|
80
|
+
case 9:
|
|
81
|
+
case "end":
|
|
82
|
+
return _context.stop();
|
|
83
|
+
}
|
|
84
|
+
}, _callee);
|
|
85
|
+
})));
|
|
86
|
+
it('should use default mobius service host when Service URL is invalid', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
87
|
+
var callingClient;
|
|
88
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
89
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
90
|
+
case 0:
|
|
91
|
+
webex.internal.services._hostCatalog = _callingClientFixtures.mockCatalogUS;
|
|
92
|
+
webex.internal.services._serviceUrls.mobius = 'invalid-url';
|
|
93
|
+
_context2.next = 4;
|
|
94
|
+
return (0, _CallingClient.createClient)(webex, {
|
|
95
|
+
logger: {
|
|
96
|
+
level: _types.LOGGER.INFO
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
case 4:
|
|
100
|
+
callingClient = _context2.sent;
|
|
101
|
+
expect(callingClient['mobiusClusters']).toStrictEqual(_callingClientFixtures.mockUSServiceHosts);
|
|
102
|
+
case 6:
|
|
103
|
+
case "end":
|
|
104
|
+
return _context2.stop();
|
|
105
|
+
}
|
|
106
|
+
}, _callee2);
|
|
107
|
+
})));
|
|
108
|
+
});
|
|
53
109
|
describe('ServiceData tests', function () {
|
|
54
110
|
var callingClient;
|
|
55
111
|
afterEach(function () {
|
|
@@ -61,30 +117,30 @@ describe('CallingClient Tests', function () {
|
|
|
61
117
|
* No input sdk config to callingClient, it should default to service type
|
|
62
118
|
* calling and empty domain value.
|
|
63
119
|
*/
|
|
64
|
-
it('Verify valid calling serviceData with no input sdk config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
65
|
-
return _regenerator.default.wrap(function
|
|
66
|
-
while (1) switch (
|
|
120
|
+
it('Verify valid calling serviceData with no input sdk config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
121
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
122
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
67
123
|
case 0:
|
|
68
|
-
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
69
|
-
return _regenerator.default.wrap(function
|
|
70
|
-
while (1) switch (
|
|
124
|
+
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
125
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
126
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
71
127
|
case 0:
|
|
72
|
-
|
|
128
|
+
_context3.next = 2;
|
|
73
129
|
return (0, _CallingClient.createClient)(webex);
|
|
74
130
|
case 2:
|
|
75
|
-
callingClient =
|
|
131
|
+
callingClient = _context3.sent;
|
|
76
132
|
expect(callingClient).toBeTruthy();
|
|
77
133
|
case 4:
|
|
78
134
|
case "end":
|
|
79
|
-
return
|
|
135
|
+
return _context3.stop();
|
|
80
136
|
}
|
|
81
|
-
},
|
|
137
|
+
}, _callee3);
|
|
82
138
|
}))).not.toThrow(Error);
|
|
83
139
|
case 1:
|
|
84
140
|
case "end":
|
|
85
|
-
return
|
|
141
|
+
return _context4.stop();
|
|
86
142
|
}
|
|
87
|
-
},
|
|
143
|
+
}, _callee4);
|
|
88
144
|
})));
|
|
89
145
|
|
|
90
146
|
/**
|
|
@@ -94,38 +150,38 @@ describe('CallingClient Tests', function () {
|
|
|
94
150
|
* It should default to service type calling and empty domain value.
|
|
95
151
|
*
|
|
96
152
|
*/
|
|
97
|
-
it('Verify invalid empty service indicator, empty domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
153
|
+
it('Verify invalid empty service indicator, empty domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
98
154
|
var serviceDataObj;
|
|
99
|
-
return _regenerator.default.wrap(function
|
|
100
|
-
while (1) switch (
|
|
155
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
156
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
101
157
|
case 0:
|
|
102
158
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
103
159
|
serviceDataObj = {
|
|
104
160
|
indicator: '',
|
|
105
161
|
domain: ''
|
|
106
162
|
};
|
|
107
|
-
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
108
|
-
return _regenerator.default.wrap(function
|
|
109
|
-
while (1) switch (
|
|
163
|
+
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
164
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
165
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
110
166
|
case 0:
|
|
111
|
-
|
|
167
|
+
_context5.next = 2;
|
|
112
168
|
return (0, _CallingClient.createClient)(webex, {
|
|
113
169
|
serviceData: serviceDataObj
|
|
114
170
|
});
|
|
115
171
|
case 2:
|
|
116
|
-
callingClient =
|
|
172
|
+
callingClient = _context5.sent;
|
|
117
173
|
expect(callingClient).toBeTruthy();
|
|
118
174
|
case 4:
|
|
119
175
|
case "end":
|
|
120
|
-
return
|
|
176
|
+
return _context5.stop();
|
|
121
177
|
}
|
|
122
|
-
},
|
|
178
|
+
}, _callee5);
|
|
123
179
|
}))).not.toThrow(Error);
|
|
124
180
|
case 2:
|
|
125
181
|
case "end":
|
|
126
|
-
return
|
|
182
|
+
return _context6.stop();
|
|
127
183
|
}
|
|
128
|
-
},
|
|
184
|
+
}, _callee6);
|
|
129
185
|
})));
|
|
130
186
|
|
|
131
187
|
/**
|
|
@@ -136,36 +192,36 @@ describe('CallingClient Tests', function () {
|
|
|
136
192
|
*
|
|
137
193
|
* INDICATOR value MUST MATCH with one of the values in ServiceIndicator enum.
|
|
138
194
|
*/
|
|
139
|
-
it('Verify invalid service indicator, valid domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
195
|
+
it('Verify invalid service indicator, valid domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
140
196
|
var serviceDataObj;
|
|
141
|
-
return _regenerator.default.wrap(function
|
|
142
|
-
while (1) switch (
|
|
197
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
198
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
143
199
|
case 0:
|
|
144
200
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
145
201
|
serviceDataObj = {
|
|
146
202
|
indicator: 'test',
|
|
147
203
|
domain: 'test.example.com'
|
|
148
204
|
};
|
|
149
|
-
|
|
150
|
-
|
|
205
|
+
_context7.prev = 1;
|
|
206
|
+
_context7.next = 4;
|
|
151
207
|
return (0, _CallingClient.createClient)(webex, {
|
|
152
208
|
serviceData: serviceDataObj
|
|
153
209
|
});
|
|
154
210
|
case 4:
|
|
155
|
-
callingClient =
|
|
156
|
-
|
|
211
|
+
callingClient = _context7.sent;
|
|
212
|
+
_context7.next = 10;
|
|
157
213
|
break;
|
|
158
214
|
case 7:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
expect(
|
|
215
|
+
_context7.prev = 7;
|
|
216
|
+
_context7.t0 = _context7["catch"](1);
|
|
217
|
+
expect(_context7.t0.message).toEqual('Invalid service indicator, Allowed values are: calling,contactcenter');
|
|
162
218
|
case 10:
|
|
163
219
|
expect.assertions(1);
|
|
164
220
|
case 11:
|
|
165
221
|
case "end":
|
|
166
|
-
return
|
|
222
|
+
return _context7.stop();
|
|
167
223
|
}
|
|
168
|
-
},
|
|
224
|
+
}, _callee7, null, [[1, 7]]);
|
|
169
225
|
})));
|
|
170
226
|
|
|
171
227
|
/**
|
|
@@ -177,35 +233,35 @@ describe('CallingClient Tests', function () {
|
|
|
177
233
|
* DOMAIN field for service type calling is allowed to be empty but if it carries a non-empty
|
|
178
234
|
* string then it must be of valid domain type.
|
|
179
235
|
*/
|
|
180
|
-
it('CALLING: verify invalid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
236
|
+
it('CALLING: verify invalid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
181
237
|
var serviceDataObj;
|
|
182
|
-
return _regenerator.default.wrap(function
|
|
183
|
-
while (1) switch (
|
|
238
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
239
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
184
240
|
case 0:
|
|
185
241
|
serviceDataObj = {
|
|
186
242
|
indicator: _types2.ServiceIndicator.CALLING,
|
|
187
243
|
domain: 'test'
|
|
188
244
|
};
|
|
189
|
-
|
|
190
|
-
|
|
245
|
+
_context8.prev = 1;
|
|
246
|
+
_context8.next = 4;
|
|
191
247
|
return (0, _CallingClient.createClient)(webex, {
|
|
192
248
|
serviceData: serviceDataObj
|
|
193
249
|
});
|
|
194
250
|
case 4:
|
|
195
|
-
callingClient =
|
|
196
|
-
|
|
251
|
+
callingClient = _context8.sent;
|
|
252
|
+
_context8.next = 10;
|
|
197
253
|
break;
|
|
198
254
|
case 7:
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
expect(
|
|
255
|
+
_context8.prev = 7;
|
|
256
|
+
_context8.t0 = _context8["catch"](1);
|
|
257
|
+
expect(_context8.t0.message).toEqual('Invalid service domain.');
|
|
202
258
|
case 10:
|
|
203
259
|
expect.assertions(1);
|
|
204
260
|
case 11:
|
|
205
261
|
case "end":
|
|
206
|
-
return
|
|
262
|
+
return _context8.stop();
|
|
207
263
|
}
|
|
208
|
-
},
|
|
264
|
+
}, _callee8, null, [[1, 7]]);
|
|
209
265
|
})));
|
|
210
266
|
|
|
211
267
|
/**
|
|
@@ -216,37 +272,37 @@ describe('CallingClient Tests', function () {
|
|
|
216
272
|
*
|
|
217
273
|
* DOMAIN field for service type 'calling' is allowed to be empty.
|
|
218
274
|
*/
|
|
219
|
-
it('CALLING: verify valid empty service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
275
|
+
it('CALLING: verify valid empty service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
220
276
|
var serviceDataObj;
|
|
221
|
-
return _regenerator.default.wrap(function
|
|
222
|
-
while (1) switch (
|
|
277
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
278
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
223
279
|
case 0:
|
|
224
280
|
serviceDataObj = {
|
|
225
281
|
indicator: _types2.ServiceIndicator.CALLING,
|
|
226
282
|
domain: ''
|
|
227
283
|
};
|
|
228
|
-
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
229
|
-
return _regenerator.default.wrap(function
|
|
230
|
-
while (1) switch (
|
|
284
|
+
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
285
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
286
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
231
287
|
case 0:
|
|
232
|
-
|
|
288
|
+
_context9.next = 2;
|
|
233
289
|
return (0, _CallingClient.createClient)(webex, {
|
|
234
290
|
serviceData: serviceDataObj
|
|
235
291
|
});
|
|
236
292
|
case 2:
|
|
237
|
-
callingClient =
|
|
293
|
+
callingClient = _context9.sent;
|
|
238
294
|
expect(callingClient).toBeTruthy();
|
|
239
295
|
case 4:
|
|
240
296
|
case "end":
|
|
241
|
-
return
|
|
297
|
+
return _context9.stop();
|
|
242
298
|
}
|
|
243
|
-
},
|
|
299
|
+
}, _callee9);
|
|
244
300
|
}))).not.toThrow(Error);
|
|
245
301
|
case 2:
|
|
246
302
|
case "end":
|
|
247
|
-
return
|
|
303
|
+
return _context10.stop();
|
|
248
304
|
}
|
|
249
|
-
},
|
|
305
|
+
}, _callee10);
|
|
250
306
|
})));
|
|
251
307
|
|
|
252
308
|
/**
|
|
@@ -257,35 +313,35 @@ describe('CallingClient Tests', function () {
|
|
|
257
313
|
*
|
|
258
314
|
* DOMAIN field for service type 'contactcenter' must carry a non-empty valid domain type string.
|
|
259
315
|
*/
|
|
260
|
-
it('ContactCenter: verify empty invalid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
316
|
+
it('ContactCenter: verify empty invalid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
261
317
|
var serviceDataObj;
|
|
262
|
-
return _regenerator.default.wrap(function
|
|
263
|
-
while (1) switch (
|
|
318
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
319
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
264
320
|
case 0:
|
|
265
321
|
serviceDataObj = {
|
|
266
322
|
indicator: _types2.ServiceIndicator.CONTACT_CENTER,
|
|
267
323
|
domain: ''
|
|
268
324
|
};
|
|
269
|
-
|
|
270
|
-
|
|
325
|
+
_context11.prev = 1;
|
|
326
|
+
_context11.next = 4;
|
|
271
327
|
return (0, _CallingClient.createClient)(webex, {
|
|
272
328
|
serviceData: serviceDataObj
|
|
273
329
|
});
|
|
274
330
|
case 4:
|
|
275
|
-
callingClient =
|
|
276
|
-
|
|
331
|
+
callingClient = _context11.sent;
|
|
332
|
+
_context11.next = 10;
|
|
277
333
|
break;
|
|
278
334
|
case 7:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
expect(
|
|
335
|
+
_context11.prev = 7;
|
|
336
|
+
_context11.t0 = _context11["catch"](1);
|
|
337
|
+
expect(_context11.t0.message).toEqual('Invalid service domain.');
|
|
282
338
|
case 10:
|
|
283
339
|
expect.assertions(1);
|
|
284
340
|
case 11:
|
|
285
341
|
case "end":
|
|
286
|
-
return
|
|
342
|
+
return _context11.stop();
|
|
287
343
|
}
|
|
288
|
-
},
|
|
344
|
+
}, _callee11, null, [[1, 7]]);
|
|
289
345
|
})));
|
|
290
346
|
|
|
291
347
|
/**
|
|
@@ -296,58 +352,58 @@ describe('CallingClient Tests', function () {
|
|
|
296
352
|
*
|
|
297
353
|
* DOMAIN field for service type 'contactcenter' must carry a non-empty valid domain type string.
|
|
298
354
|
*/
|
|
299
|
-
it('ContactCenter: verify valid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
355
|
+
it('ContactCenter: verify valid service domain', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
300
356
|
var serviceDataObj;
|
|
301
|
-
return _regenerator.default.wrap(function
|
|
302
|
-
while (1) switch (
|
|
357
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
358
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
303
359
|
case 0:
|
|
304
360
|
serviceDataObj = {
|
|
305
361
|
indicator: _types2.ServiceIndicator.CONTACT_CENTER,
|
|
306
362
|
domain: 'test.example.com'
|
|
307
363
|
};
|
|
308
|
-
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
309
|
-
return _regenerator.default.wrap(function
|
|
310
|
-
while (1) switch (
|
|
364
|
+
expect( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
365
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
366
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
311
367
|
case 0:
|
|
312
|
-
|
|
368
|
+
_context12.next = 2;
|
|
313
369
|
return (0, _CallingClient.createClient)(webex, {
|
|
314
370
|
serviceData: serviceDataObj
|
|
315
371
|
});
|
|
316
372
|
case 2:
|
|
317
|
-
callingClient =
|
|
373
|
+
callingClient = _context12.sent;
|
|
318
374
|
expect(callingClient).toBeTruthy();
|
|
319
375
|
case 4:
|
|
320
376
|
case "end":
|
|
321
|
-
return
|
|
377
|
+
return _context12.stop();
|
|
322
378
|
}
|
|
323
|
-
},
|
|
379
|
+
}, _callee12);
|
|
324
380
|
}))).not.toThrow(Error);
|
|
325
381
|
case 2:
|
|
326
382
|
case "end":
|
|
327
|
-
return
|
|
383
|
+
return _context13.stop();
|
|
328
384
|
}
|
|
329
|
-
},
|
|
385
|
+
}, _callee13);
|
|
330
386
|
})));
|
|
331
|
-
it('Get current log level', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
332
|
-
return _regenerator.default.wrap(function
|
|
333
|
-
while (1) switch (
|
|
387
|
+
it('Get current log level', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
388
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
389
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
334
390
|
case 0:
|
|
335
|
-
|
|
391
|
+
_context14.next = 2;
|
|
336
392
|
return (0, _CallingClient.createClient)(webex, {
|
|
337
393
|
logger: {
|
|
338
394
|
level: _types.LOGGER.INFO
|
|
339
395
|
}
|
|
340
396
|
});
|
|
341
397
|
case 2:
|
|
342
|
-
callingClient =
|
|
398
|
+
callingClient = _context14.sent;
|
|
343
399
|
expect(callingClient).toBeTruthy();
|
|
344
400
|
expect(callingClient.getLoggingLevel).toBeTruthy();
|
|
345
401
|
expect(callingClient.getLoggingLevel()).toEqual(_types.LOGGER.INFO);
|
|
346
402
|
case 6:
|
|
347
403
|
case "end":
|
|
348
|
-
return
|
|
404
|
+
return _context14.stop();
|
|
349
405
|
}
|
|
350
|
-
},
|
|
406
|
+
}, _callee14);
|
|
351
407
|
})));
|
|
352
408
|
});
|
|
353
409
|
describe('Mobius Server discovery tests', function () {
|
|
@@ -360,19 +416,19 @@ describe('CallingClient Tests', function () {
|
|
|
360
416
|
callingClient = undefined;
|
|
361
417
|
jest.useRealTimers();
|
|
362
418
|
});
|
|
363
|
-
it('verify successful mobius server url discovery', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
364
|
-
return _regenerator.default.wrap(function
|
|
365
|
-
while (1) switch (
|
|
419
|
+
it('verify successful mobius server url discovery', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
420
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
421
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
366
422
|
case 0:
|
|
367
423
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
368
|
-
|
|
424
|
+
_context15.next = 3;
|
|
369
425
|
return (0, _CallingClient.createClient)(webex, {
|
|
370
426
|
logger: {
|
|
371
427
|
level: _types.LOGGER.INFO
|
|
372
428
|
}
|
|
373
429
|
});
|
|
374
430
|
case 3:
|
|
375
|
-
callingClient =
|
|
431
|
+
callingClient = _context15.sent;
|
|
376
432
|
expect(webex.request).toBeCalledTimes(3);
|
|
377
433
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
378
434
|
expect(handleErrorSpy).not.toBeCalled();
|
|
@@ -394,27 +450,27 @@ describe('CallingClient Tests', function () {
|
|
|
394
450
|
}));
|
|
395
451
|
case 10:
|
|
396
452
|
case "end":
|
|
397
|
-
return
|
|
453
|
+
return _context15.stop();
|
|
398
454
|
}
|
|
399
|
-
},
|
|
455
|
+
}, _callee15);
|
|
400
456
|
})));
|
|
401
|
-
it('case when region discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
457
|
+
it('case when region discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
402
458
|
var failurePayload;
|
|
403
|
-
return _regenerator.default.wrap(function
|
|
404
|
-
while (1) switch (
|
|
459
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
460
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
405
461
|
case 0:
|
|
406
462
|
failurePayload = {
|
|
407
463
|
statusCode: 500
|
|
408
464
|
};
|
|
409
465
|
webex.request.mockRejectedValueOnce(failurePayload);
|
|
410
|
-
|
|
466
|
+
_context16.next = 4;
|
|
411
467
|
return (0, _CallingClient.createClient)(webex, {
|
|
412
468
|
logger: {
|
|
413
469
|
level: _types.LOGGER.INFO
|
|
414
470
|
}
|
|
415
471
|
});
|
|
416
472
|
case 4:
|
|
417
|
-
callingClient =
|
|
473
|
+
callingClient = _context16.sent;
|
|
418
474
|
expect(webex.request).nthCalledWith(1, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
419
475
|
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
420
476
|
method: 'GET'
|
|
@@ -439,27 +495,27 @@ describe('CallingClient Tests', function () {
|
|
|
439
495
|
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
440
496
|
case 12:
|
|
441
497
|
case "end":
|
|
442
|
-
return
|
|
498
|
+
return _context16.stop();
|
|
443
499
|
}
|
|
444
|
-
},
|
|
500
|
+
}, _callee16);
|
|
445
501
|
})));
|
|
446
|
-
it('when region discovery succeeds but region based mobius url discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
502
|
+
it('when region discovery succeeds but region based mobius url discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
447
503
|
var failurePayload;
|
|
448
|
-
return _regenerator.default.wrap(function
|
|
449
|
-
while (1) switch (
|
|
504
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
505
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
450
506
|
case 0:
|
|
451
507
|
failurePayload = {
|
|
452
508
|
statusCode: 500
|
|
453
509
|
};
|
|
454
510
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
|
|
455
|
-
|
|
511
|
+
_context17.next = 4;
|
|
456
512
|
return (0, _CallingClient.createClient)(webex, {
|
|
457
513
|
logger: {
|
|
458
514
|
level: _types.LOGGER.INFO
|
|
459
515
|
}
|
|
460
516
|
});
|
|
461
517
|
case 4:
|
|
462
|
-
callingClient =
|
|
518
|
+
callingClient = _context17.sent;
|
|
463
519
|
expect(handleErrorSpy).toBeCalledWith(failurePayload, expect.anything(), {
|
|
464
520
|
file: _constants.CALLING_CLIENT_FILE,
|
|
465
521
|
method: 'getMobiusServers'
|
|
@@ -480,18 +536,18 @@ describe('CallingClient Tests', function () {
|
|
|
480
536
|
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
481
537
|
case 11:
|
|
482
538
|
case "end":
|
|
483
|
-
return
|
|
539
|
+
return _context17.stop();
|
|
484
540
|
}
|
|
485
|
-
},
|
|
541
|
+
}, _callee17);
|
|
486
542
|
})));
|
|
487
|
-
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
543
|
+
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
488
544
|
var infoSpy;
|
|
489
|
-
return _regenerator.default.wrap(function
|
|
490
|
-
while (1) switch (
|
|
545
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
546
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
491
547
|
case 0:
|
|
492
548
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
493
549
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
494
|
-
|
|
550
|
+
_context18.next = 4;
|
|
495
551
|
return (0, _CallingClient.createClient)(webex, {
|
|
496
552
|
discovery: {
|
|
497
553
|
region: 'AP-SOUTHEAST',
|
|
@@ -502,7 +558,7 @@ describe('CallingClient Tests', function () {
|
|
|
502
558
|
}
|
|
503
559
|
});
|
|
504
560
|
case 4:
|
|
505
|
-
callingClient =
|
|
561
|
+
callingClient = _context18.sent;
|
|
506
562
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
507
563
|
expect(infoSpy).toBeCalledWith('Updating region and country from the SDK config', {
|
|
508
564
|
file: 'CallingClient',
|
|
@@ -515,66 +571,66 @@ describe('CallingClient Tests', function () {
|
|
|
515
571
|
expect(handleErrorSpy).not.toBeCalled();
|
|
516
572
|
case 9:
|
|
517
573
|
case "end":
|
|
518
|
-
return
|
|
574
|
+
return _context18.stop();
|
|
519
575
|
}
|
|
520
|
-
},
|
|
576
|
+
}, _callee18);
|
|
521
577
|
})));
|
|
522
578
|
});
|
|
523
579
|
describe('Testing each cluster present withing host catalog', function () {
|
|
524
580
|
var mobiusCluster = ['mobius-eu-central-1.prod.infra.webex.com', 'mobius-us-east-1.int.infra.webex.com', 'mobius-eu-central-1.int.infra.webex.com'];
|
|
525
581
|
var checkCluster = /*#__PURE__*/function () {
|
|
526
|
-
var
|
|
582
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(mockServiceHosts, mockCatalog) {
|
|
527
583
|
var callingClient;
|
|
528
|
-
return _regenerator.default.wrap(function
|
|
529
|
-
while (1) switch (
|
|
584
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
585
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
530
586
|
case 0:
|
|
531
587
|
webex.internal.services._hostCatalog = mockCatalog;
|
|
532
|
-
|
|
588
|
+
_context19.next = 3;
|
|
533
589
|
return (0, _CallingClient.createClient)(webex, {
|
|
534
590
|
logger: {
|
|
535
591
|
level: _types.LOGGER.INFO
|
|
536
592
|
}
|
|
537
593
|
});
|
|
538
594
|
case 3:
|
|
539
|
-
callingClient =
|
|
595
|
+
callingClient = _context19.sent;
|
|
540
596
|
expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
|
|
541
597
|
case 5:
|
|
542
598
|
case "end":
|
|
543
|
-
return
|
|
599
|
+
return _context19.stop();
|
|
544
600
|
}
|
|
545
|
-
},
|
|
601
|
+
}, _callee19);
|
|
546
602
|
}));
|
|
547
603
|
return function checkCluster(_x, _x2) {
|
|
548
|
-
return
|
|
604
|
+
return _ref19.apply(this, arguments);
|
|
549
605
|
};
|
|
550
606
|
}();
|
|
551
607
|
it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
|
|
552
|
-
var
|
|
553
|
-
return _regenerator.default.wrap(function
|
|
554
|
-
while (1) switch (
|
|
608
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(clusterName) {
|
|
609
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
610
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
555
611
|
case 0:
|
|
556
|
-
|
|
557
|
-
|
|
612
|
+
_context20.t0 = clusterName;
|
|
613
|
+
_context20.next = _context20.t0 === 'mobius-eu-central-1.prod.infra.webex.com' ? 3 : _context20.t0 === 'mobius-us-east-1.int.infra.webex.com' ? 5 : _context20.t0 === 'mobius-eu-central-1.int.infra.webex.com' ? 7 : 9;
|
|
558
614
|
break;
|
|
559
615
|
case 3:
|
|
560
616
|
checkCluster(_callingClientFixtures.mockEUServiceHosts, _callingClientFixtures.mockCatalogEU);
|
|
561
|
-
return
|
|
617
|
+
return _context20.abrupt("break", 10);
|
|
562
618
|
case 5:
|
|
563
619
|
checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
|
|
564
|
-
return
|
|
620
|
+
return _context20.abrupt("break", 10);
|
|
565
621
|
case 7:
|
|
566
622
|
checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
|
|
567
|
-
return
|
|
623
|
+
return _context20.abrupt("break", 10);
|
|
568
624
|
case 9:
|
|
569
|
-
return
|
|
625
|
+
return _context20.abrupt("break", 10);
|
|
570
626
|
case 10:
|
|
571
627
|
case "end":
|
|
572
|
-
return
|
|
628
|
+
return _context20.stop();
|
|
573
629
|
}
|
|
574
|
-
},
|
|
630
|
+
}, _callee20);
|
|
575
631
|
}));
|
|
576
632
|
return function (_x3) {
|
|
577
|
-
return
|
|
633
|
+
return _ref20.apply(this, arguments);
|
|
578
634
|
};
|
|
579
635
|
}());
|
|
580
636
|
});
|
|
@@ -587,23 +643,23 @@ describe('CallingClient Tests', function () {
|
|
|
587
643
|
var deRegSpy;
|
|
588
644
|
var restartRegisterSpy;
|
|
589
645
|
var registerSpy;
|
|
590
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
591
|
-
return _regenerator.default.wrap(function
|
|
592
|
-
while (1) switch (
|
|
646
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
647
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
648
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
593
649
|
case 0:
|
|
594
650
|
jest.useFakeTimers();
|
|
595
651
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload).mockResolvedValueOnce(_callingClientFixtures.registrationPayload);
|
|
596
|
-
|
|
652
|
+
_context21.next = 4;
|
|
597
653
|
return (0, _CallingClient.createClient)(webex, {
|
|
598
654
|
logger: {
|
|
599
655
|
level: _types.LOGGER.INFO
|
|
600
656
|
}
|
|
601
657
|
});
|
|
602
658
|
case 4:
|
|
603
|
-
callingClient =
|
|
659
|
+
callingClient = _context21.sent;
|
|
604
660
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
605
661
|
reg = line.registration;
|
|
606
|
-
|
|
662
|
+
_context21.next = 9;
|
|
607
663
|
return line.register();
|
|
608
664
|
case 9:
|
|
609
665
|
deRegSpy = jest.spyOn(line.registration, 'deregister');
|
|
@@ -612,9 +668,9 @@ describe('CallingClient Tests', function () {
|
|
|
612
668
|
registerSpy = jest.spyOn(reg, 'attemptRegistrationWithServers');
|
|
613
669
|
case 13:
|
|
614
670
|
case "end":
|
|
615
|
-
return
|
|
671
|
+
return _context21.stop();
|
|
616
672
|
}
|
|
617
|
-
},
|
|
673
|
+
}, _callee21);
|
|
618
674
|
})));
|
|
619
675
|
afterEach(function () {
|
|
620
676
|
jest.clearAllTimers();
|
|
@@ -624,9 +680,9 @@ describe('CallingClient Tests', function () {
|
|
|
624
680
|
callingClient = undefined;
|
|
625
681
|
jest.useRealTimers();
|
|
626
682
|
});
|
|
627
|
-
it('detect a network flap in mercury connection', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
628
|
-
return _regenerator.default.wrap(function
|
|
629
|
-
while (1) switch (
|
|
683
|
+
it('detect a network flap in mercury connection', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
684
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
685
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
630
686
|
case 0:
|
|
631
687
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
632
688
|
|
|
@@ -643,7 +699,7 @@ describe('CallingClient Tests', function () {
|
|
|
643
699
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
644
700
|
webex.internal.mercury.connected = true;
|
|
645
701
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
646
|
-
|
|
702
|
+
_context22.next = 8;
|
|
647
703
|
return flushPromises();
|
|
648
704
|
case 8:
|
|
649
705
|
/* We should be detecting the network recovery */
|
|
@@ -658,14 +714,14 @@ describe('CallingClient Tests', function () {
|
|
|
658
714
|
expect(registerSpy).lastCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
659
715
|
case 14:
|
|
660
716
|
case "end":
|
|
661
|
-
return
|
|
717
|
+
return _context22.stop();
|
|
662
718
|
}
|
|
663
|
-
},
|
|
719
|
+
}, _callee22);
|
|
664
720
|
})));
|
|
665
|
-
it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
721
|
+
it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
666
722
|
var failurePayload, mockRegistrationBody, successPayload;
|
|
667
|
-
return _regenerator.default.wrap(function
|
|
668
|
-
while (1) switch (
|
|
723
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
724
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
669
725
|
case 0:
|
|
670
726
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
671
727
|
failurePayload = {
|
|
@@ -692,7 +748,7 @@ describe('CallingClient Tests', function () {
|
|
|
692
748
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
693
749
|
webex.internal.mercury.connected = true;
|
|
694
750
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
695
|
-
|
|
751
|
+
_context23.next = 12;
|
|
696
752
|
return flushPromises();
|
|
697
753
|
case 12:
|
|
698
754
|
/* We should be detecting the network recovery */
|
|
@@ -707,14 +763,14 @@ describe('CallingClient Tests', function () {
|
|
|
707
763
|
expect(registerSpy).lastCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
708
764
|
case 18:
|
|
709
765
|
case "end":
|
|
710
|
-
return
|
|
766
|
+
return _context23.stop();
|
|
711
767
|
}
|
|
712
|
-
},
|
|
768
|
+
}, _callee23);
|
|
713
769
|
})));
|
|
714
|
-
it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
770
|
+
it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
715
771
|
var handleConnectionRestoreSpy;
|
|
716
|
-
return _regenerator.default.wrap(function
|
|
717
|
-
while (1) switch (
|
|
772
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
773
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
718
774
|
case 0:
|
|
719
775
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
720
776
|
reg.setStatus(_types2.RegistrationStatus.IDLE);
|
|
@@ -732,7 +788,7 @@ describe('CallingClient Tests', function () {
|
|
|
732
788
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
733
789
|
webex.internal.mercury.connected = true;
|
|
734
790
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
735
|
-
|
|
791
|
+
_context24.next = 9;
|
|
736
792
|
return flushPromises();
|
|
737
793
|
case 9:
|
|
738
794
|
/* We should be detecting the network recovery */
|
|
@@ -748,13 +804,13 @@ describe('CallingClient Tests', function () {
|
|
|
748
804
|
expect(handleConnectionRestoreSpy).not.toBeCalledOnceWith();
|
|
749
805
|
case 11:
|
|
750
806
|
case "end":
|
|
751
|
-
return
|
|
807
|
+
return _context24.stop();
|
|
752
808
|
}
|
|
753
|
-
},
|
|
809
|
+
}, _callee24);
|
|
754
810
|
})));
|
|
755
|
-
it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
756
|
-
return _regenerator.default.wrap(function
|
|
757
|
-
while (1) switch (
|
|
811
|
+
it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
812
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
813
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
758
814
|
case 0:
|
|
759
815
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
760
816
|
|
|
@@ -765,7 +821,7 @@ describe('CallingClient Tests', function () {
|
|
|
765
821
|
/* Set mercury connection to be down and execute a delay of 2.5 seconds */
|
|
766
822
|
webex.internal.mercury.connected = false;
|
|
767
823
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
768
|
-
|
|
824
|
+
_context25.next = 7;
|
|
769
825
|
return flushPromises();
|
|
770
826
|
case 7:
|
|
771
827
|
/* We should be detecting the network flap */
|
|
@@ -777,7 +833,7 @@ describe('CallingClient Tests', function () {
|
|
|
777
833
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
778
834
|
webex.internal.mercury.connected = true;
|
|
779
835
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
780
|
-
|
|
836
|
+
_context25.next = 12;
|
|
781
837
|
return flushPromises();
|
|
782
838
|
case 12:
|
|
783
839
|
/* We should be detecting the network recovery */
|
|
@@ -788,28 +844,28 @@ describe('CallingClient Tests', function () {
|
|
|
788
844
|
expect(registerSpy).not.toBeCalledWith(true);
|
|
789
845
|
case 14:
|
|
790
846
|
case "end":
|
|
791
|
-
return
|
|
847
|
+
return _context25.stop();
|
|
792
848
|
}
|
|
793
|
-
},
|
|
849
|
+
}, _callee25);
|
|
794
850
|
})));
|
|
795
851
|
});
|
|
796
852
|
describe('Line creation tests', function () {
|
|
797
853
|
var callingClient;
|
|
798
854
|
var line;
|
|
799
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
800
|
-
return _regenerator.default.wrap(function
|
|
801
|
-
while (1) switch (
|
|
855
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
856
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
857
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
802
858
|
case 0:
|
|
803
|
-
|
|
859
|
+
_context26.next = 2;
|
|
804
860
|
return (0, _CallingClient.createClient)(webex);
|
|
805
861
|
case 2:
|
|
806
|
-
callingClient =
|
|
862
|
+
callingClient = _context26.sent;
|
|
807
863
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
808
864
|
case 4:
|
|
809
865
|
case "end":
|
|
810
|
-
return
|
|
866
|
+
return _context26.stop();
|
|
811
867
|
}
|
|
812
|
-
},
|
|
868
|
+
}, _callee26);
|
|
813
869
|
})));
|
|
814
870
|
afterEach(function () {
|
|
815
871
|
jest.clearAllTimers();
|
|
@@ -844,15 +900,15 @@ describe('CallingClient Tests', function () {
|
|
|
844
900
|
});
|
|
845
901
|
var callingClient;
|
|
846
902
|
var line;
|
|
847
|
-
beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
903
|
+
beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
848
904
|
var calls;
|
|
849
|
-
return _regenerator.default.wrap(function
|
|
850
|
-
while (1) switch (
|
|
905
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
906
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
851
907
|
case 0:
|
|
852
|
-
|
|
908
|
+
_context27.next = 2;
|
|
853
909
|
return (0, _CallingClient.createClient)(webex);
|
|
854
910
|
case 2:
|
|
855
|
-
callingClient =
|
|
911
|
+
callingClient = _context27.sent;
|
|
856
912
|
line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
|
|
857
913
|
calls = (0, _values.default)(callManager.getActiveCalls());
|
|
858
914
|
calls.forEach(function (call) {
|
|
@@ -860,9 +916,9 @@ describe('CallingClient Tests', function () {
|
|
|
860
916
|
});
|
|
861
917
|
case 6:
|
|
862
918
|
case "end":
|
|
863
|
-
return
|
|
919
|
+
return _context27.stop();
|
|
864
920
|
}
|
|
865
|
-
},
|
|
921
|
+
}, _callee27);
|
|
866
922
|
})));
|
|
867
923
|
afterAll(function () {
|
|
868
924
|
callingClient.removeAllListeners();
|
|
@@ -945,23 +1001,23 @@ describe('CallingClient Tests', function () {
|
|
|
945
1001
|
describe('Call Session Event test', function () {
|
|
946
1002
|
var mockOn = webex.internal.mercury.on;
|
|
947
1003
|
var callingClient;
|
|
948
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
949
|
-
return _regenerator.default.wrap(function
|
|
950
|
-
while (1) switch (
|
|
1004
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1005
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
1006
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
951
1007
|
case 0:
|
|
952
|
-
|
|
1008
|
+
_context28.next = 2;
|
|
953
1009
|
return (0, _CallingClient.createClient)(webex, {
|
|
954
1010
|
logger: {
|
|
955
1011
|
level: _types.LOGGER.INFO
|
|
956
1012
|
}
|
|
957
1013
|
});
|
|
958
1014
|
case 2:
|
|
959
|
-
callingClient =
|
|
1015
|
+
callingClient = _context28.sent;
|
|
960
1016
|
case 3:
|
|
961
1017
|
case "end":
|
|
962
|
-
return
|
|
1018
|
+
return _context28.stop();
|
|
963
1019
|
}
|
|
964
|
-
},
|
|
1020
|
+
}, _callee28);
|
|
965
1021
|
})));
|
|
966
1022
|
afterEach(function () {
|
|
967
1023
|
callingClient.removeAllListeners();
|