@webex/calling 3.12.0-next.52 → 3.12.0-next.54
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/CallingClient/CallingClient.js +25 -78
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +322 -122
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +29 -2
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +88 -0
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/constants.js +1 -0
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/registration/register.js +10 -0
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +69 -0
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/utils/request.js +20 -0
- package/dist/CallingClient/utils/request.js.map +1 -1
- package/dist/CallingClient/utils/request.test.js +31 -0
- package/dist/CallingClient/utils/request.test.js.map +1 -1
- package/dist/module/CallingClient/CallingClient.js +17 -39
- package/dist/module/CallingClient/calling/callManager.js +13 -1
- package/dist/module/CallingClient/constants.js +1 -0
- package/dist/module/CallingClient/registration/register.js +3 -0
- package/dist/module/CallingClient/utils/request.js +7 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +1 -0
- package/dist/types/CallingClient/calling/callManager.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.map +1 -1
- package/dist/types/CallingClient/utils/request.d.ts +1 -0
- package/dist/types/CallingClient/utils/request.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2134,5 +2134,74 @@ describe('Registration Tests', function () {
|
|
|
2134
2134
|
}, _callee46);
|
|
2135
2135
|
})));
|
|
2136
2136
|
});
|
|
2137
|
+
describe('attemptRegistrationWithServers transport alignment', function () {
|
|
2138
|
+
var apiRequest;
|
|
2139
|
+
var setSocketEnabledSpy;
|
|
2140
|
+
beforeEach(function () {
|
|
2141
|
+
apiRequest = _request.APIRequest.getInstance({
|
|
2142
|
+
webex: webex
|
|
2143
|
+
});
|
|
2144
|
+
// Keep the actual transport on HTTP (no-op) so the registration flow stays simple;
|
|
2145
|
+
// we only assert which boolean the method derives from the server group's URL scheme.
|
|
2146
|
+
setSocketEnabledSpy = jest.spyOn(apiRequest, 'setSocketEnabled').mockImplementation(function () {});
|
|
2147
|
+
webex.request.mockResolvedValue(successPayload);
|
|
2148
|
+
});
|
|
2149
|
+
it('enables the WebSocket transport when the server group uses the wss:// scheme', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2150
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2151
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2152
|
+
case 0:
|
|
2153
|
+
_context47.next = 1;
|
|
2154
|
+
return reg.attemptRegistrationWithServers(_constants.REGISTRATION_UTIL, ['wss://mobius.example.com/api/v1/calling/web/']);
|
|
2155
|
+
case 1:
|
|
2156
|
+
expect(setSocketEnabledSpy).toHaveBeenCalledWith(true);
|
|
2157
|
+
case 2:
|
|
2158
|
+
case "end":
|
|
2159
|
+
return _context47.stop();
|
|
2160
|
+
}
|
|
2161
|
+
}, _callee47);
|
|
2162
|
+
})));
|
|
2163
|
+
it('falls back to the HTTP transport when the server group uses the https:// scheme', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2164
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2165
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2166
|
+
case 0:
|
|
2167
|
+
_context48.next = 1;
|
|
2168
|
+
return reg.attemptRegistrationWithServers(_constants.REGISTRATION_UTIL, ['https://mobius.example.com/api/v1/calling/web/']);
|
|
2169
|
+
case 1:
|
|
2170
|
+
expect(setSocketEnabledSpy).toHaveBeenCalledWith(false);
|
|
2171
|
+
case 2:
|
|
2172
|
+
case "end":
|
|
2173
|
+
return _context48.stop();
|
|
2174
|
+
}
|
|
2175
|
+
}, _callee48);
|
|
2176
|
+
})));
|
|
2177
|
+
it('does not change the transport when the server group is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2178
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
2179
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2180
|
+
case 0:
|
|
2181
|
+
_context49.next = 1;
|
|
2182
|
+
return reg.attemptRegistrationWithServers(_constants.REGISTRATION_UTIL, []);
|
|
2183
|
+
case 1:
|
|
2184
|
+
expect(setSocketEnabledSpy).not.toHaveBeenCalled();
|
|
2185
|
+
case 2:
|
|
2186
|
+
case "end":
|
|
2187
|
+
return _context49.stop();
|
|
2188
|
+
}
|
|
2189
|
+
}, _callee49);
|
|
2190
|
+
})));
|
|
2191
|
+
it('derives the transport from the first server in the group', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2192
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
2193
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2194
|
+
case 0:
|
|
2195
|
+
_context50.next = 1;
|
|
2196
|
+
return reg.attemptRegistrationWithServers(_constants.REGISTRATION_UTIL, ['wss://primary.example.com/api/v1/calling/web/', 'https://backup.example.com/api/v1/calling/web/']);
|
|
2197
|
+
case 1:
|
|
2198
|
+
expect(setSocketEnabledSpy).toHaveBeenCalledWith(true);
|
|
2199
|
+
case 2:
|
|
2200
|
+
case "end":
|
|
2201
|
+
return _context50.stop();
|
|
2202
|
+
}
|
|
2203
|
+
}, _callee50);
|
|
2204
|
+
})));
|
|
2205
|
+
});
|
|
2137
2206
|
});
|
|
2138
2207
|
//# sourceMappingURL=register.test.js.map
|