@webex/calling 3.12.0-next.41 → 3.12.0-next.43
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/registration/register.js +2 -1
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +146 -74
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/utils/mobiusSocketMapper.js +1 -1
- package/dist/CallingClient/utils/mobiusSocketMapper.js.map +1 -1
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js +13 -3
- package/dist/CallingClient/utils/mobiusSocketMapper.test.js.map +1 -1
- package/dist/module/CallingClient/registration/register.js +2 -1
- package/dist/module/CallingClient/utils/mobiusSocketMapper.js +1 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1696,7 +1696,7 @@ describe('Registration Tests', function () {
|
|
|
1696
1696
|
})));
|
|
1697
1697
|
it('checks for keep-alive failure with 429', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1698
1698
|
var _reg$deviceInfo$devic;
|
|
1699
|
-
var keepaliveSpy, postMessageSpy, clearTimerSpy, retry429Spy;
|
|
1699
|
+
var keepaliveSpy, postMessageSpy, clearTimerSpy, retry429Spy, keepaliveInterval, retryAfter, adjustedResumeDelayMs;
|
|
1700
1700
|
return _regenerator.default.wrap(function (_context35) {
|
|
1701
1701
|
while (1) switch (_context35.prev = _context35.next) {
|
|
1702
1702
|
case 0:
|
|
@@ -1707,13 +1707,17 @@ describe('Registration Tests', function () {
|
|
|
1707
1707
|
postMessageSpy = jest.spyOn(Worker.prototype, 'postMessage');
|
|
1708
1708
|
clearTimerSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
1709
1709
|
retry429Spy = jest.spyOn(reg, 'handle429Retry');
|
|
1710
|
+
keepaliveInterval = reg.deviceInfo.keepaliveInterval; // Choose a retryAfter strictly greater than keepaliveInterval so the
|
|
1711
|
+
// adjusted resume delay (retryAfter - keepaliveInterval) is positive and verifiable.
|
|
1712
|
+
retryAfter = keepaliveInterval + 30;
|
|
1713
|
+
adjustedResumeDelayMs = (retryAfter - keepaliveInterval) * _constants.SEC_TO_MSEC_MFACTOR;
|
|
1710
1714
|
reg.webWorker.onmessage({
|
|
1711
1715
|
data: {
|
|
1712
1716
|
type: _types.WorkerMessageType.KEEPALIVE_FAILURE,
|
|
1713
1717
|
err: {
|
|
1714
1718
|
statusCode: 429,
|
|
1715
1719
|
headers: {
|
|
1716
|
-
'retry-after':
|
|
1720
|
+
'retry-after': retryAfter
|
|
1717
1721
|
}
|
|
1718
1722
|
},
|
|
1719
1723
|
keepAliveRetryCount: 1
|
|
@@ -1729,23 +1733,33 @@ describe('Registration Tests', function () {
|
|
|
1729
1733
|
expect(handleErrorSpy).toBeCalledOnceWith({
|
|
1730
1734
|
statusCode: 429,
|
|
1731
1735
|
headers: {
|
|
1732
|
-
'retry-after':
|
|
1736
|
+
'retry-after': retryAfter
|
|
1733
1737
|
}
|
|
1734
1738
|
}, expect.anything(), {
|
|
1735
1739
|
file: _constants.REGISTRATION_FILE,
|
|
1736
1740
|
method: _constants.KEEPALIVE_UTIL
|
|
1737
1741
|
}, expect.anything());
|
|
1738
|
-
expect(retry429Spy).toBeCalledOnceWith(
|
|
1742
|
+
expect(retry429Spy).toBeCalledOnceWith(retryAfter, 'startKeepaliveTimer');
|
|
1739
1743
|
expect(clearTimerSpy).toBeCalledTimes(1);
|
|
1740
1744
|
expect(reg.reconnectPending).toStrictEqual(false);
|
|
1741
1745
|
expect(reg.keepaliveTimer).toBe(undefined);
|
|
1742
1746
|
expect(reg.webWorker).toBeUndefined();
|
|
1743
|
-
|
|
1747
|
+
|
|
1748
|
+
// Resume timer must NOT fire before the adjusted (retryAfter - keepaliveInterval) interval.
|
|
1749
|
+
jest.advanceTimersByTime(adjustedResumeDelayMs - 1);
|
|
1744
1750
|
_context35.next = 3;
|
|
1745
1751
|
return flushPromises();
|
|
1746
1752
|
case 3:
|
|
1747
|
-
expect(keepaliveSpy).
|
|
1748
|
-
expect(
|
|
1753
|
+
expect(keepaliveSpy).not.toBeCalled();
|
|
1754
|
+
expect(reg.webWorker).toBeUndefined();
|
|
1755
|
+
|
|
1756
|
+
// Advance the remaining 1ms to hit the exact adjusted timeout; keepalive must resume now.
|
|
1757
|
+
jest.advanceTimersByTime(1);
|
|
1758
|
+
_context35.next = 4;
|
|
1759
|
+
return flushPromises();
|
|
1760
|
+
case 4:
|
|
1761
|
+
expect(keepaliveSpy).toBeCalledOnceWith((_reg$deviceInfo$devic = reg.deviceInfo.device) === null || _reg$deviceInfo$devic === void 0 ? void 0 : _reg$deviceInfo$devic.uri, keepaliveInterval, 'UNKNOWN');
|
|
1762
|
+
expect(logSpy).toBeCalledWith("Resuming keepalive after ".concat(retryAfter, " seconds"), {
|
|
1749
1763
|
file: _constants.REGISTRATION_FILE,
|
|
1750
1764
|
method: 'handle429Retry'
|
|
1751
1765
|
});
|
|
@@ -1755,18 +1769,76 @@ describe('Registration Tests', function () {
|
|
|
1755
1769
|
interval: expect.any(Number),
|
|
1756
1770
|
retryCountThreshold: expect.any(Number)
|
|
1757
1771
|
}));
|
|
1758
|
-
case
|
|
1772
|
+
case 5:
|
|
1759
1773
|
case "end":
|
|
1760
1774
|
return _context35.stop();
|
|
1761
1775
|
}
|
|
1762
1776
|
}, _callee35);
|
|
1763
1777
|
})));
|
|
1764
|
-
it
|
|
1778
|
+
it.each([{
|
|
1779
|
+
description: 'retryAfter less than keepaliveInterval -> negative delay fires immediately',
|
|
1780
|
+
retryAfterDelta: -10
|
|
1781
|
+
}, {
|
|
1782
|
+
description: 'retryAfter equal to keepaliveInterval -> zero delay fires immediately',
|
|
1783
|
+
retryAfterDelta: 0
|
|
1784
|
+
}])('adjusts retry-after with keepaliveInterval on 429 keepalive failure ($description)', /*#__PURE__*/function () {
|
|
1785
|
+
var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(_ref36) {
|
|
1786
|
+
var _reg$deviceInfo$devic2;
|
|
1787
|
+
var retryAfterDelta, keepaliveSpy, keepaliveInterval, retryAfter;
|
|
1788
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
1789
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1790
|
+
case 0:
|
|
1791
|
+
retryAfterDelta = _ref36.retryAfterDelta;
|
|
1792
|
+
_context36.next = 1;
|
|
1793
|
+
return beforeEachSetupForKeepalive();
|
|
1794
|
+
case 1:
|
|
1795
|
+
keepaliveSpy = jest.spyOn(reg, 'startKeepaliveTimer');
|
|
1796
|
+
keepaliveInterval = reg.deviceInfo.keepaliveInterval;
|
|
1797
|
+
retryAfter = keepaliveInterval + retryAfterDelta;
|
|
1798
|
+
reg.webWorker.onmessage({
|
|
1799
|
+
data: {
|
|
1800
|
+
type: _types.WorkerMessageType.KEEPALIVE_FAILURE,
|
|
1801
|
+
err: {
|
|
1802
|
+
statusCode: 429,
|
|
1803
|
+
headers: {
|
|
1804
|
+
'retry-after': retryAfter
|
|
1805
|
+
}
|
|
1806
|
+
},
|
|
1807
|
+
keepAliveRetryCount: 1
|
|
1808
|
+
}
|
|
1809
|
+
});
|
|
1810
|
+
_context36.next = 2;
|
|
1811
|
+
return flushPromises();
|
|
1812
|
+
case 2:
|
|
1813
|
+
expect(reg.webWorker).toBeUndefined();
|
|
1814
|
+
expect(keepaliveSpy).not.toBeCalled();
|
|
1815
|
+
|
|
1816
|
+
// With a non-positive adjusted delay, the timer should fire on the next tick.
|
|
1817
|
+
jest.advanceTimersByTime(0);
|
|
1818
|
+
_context36.next = 3;
|
|
1819
|
+
return flushPromises();
|
|
1820
|
+
case 3:
|
|
1821
|
+
expect(keepaliveSpy).toBeCalledOnceWith((_reg$deviceInfo$devic2 = reg.deviceInfo.device) === null || _reg$deviceInfo$devic2 === void 0 ? void 0 : _reg$deviceInfo$devic2.uri, keepaliveInterval, 'UNKNOWN');
|
|
1822
|
+
expect(logSpy).toBeCalledWith("Resuming keepalive after ".concat(retryAfter, " seconds"), {
|
|
1823
|
+
file: _constants.REGISTRATION_FILE,
|
|
1824
|
+
method: 'handle429Retry'
|
|
1825
|
+
});
|
|
1826
|
+
case 4:
|
|
1827
|
+
case "end":
|
|
1828
|
+
return _context36.stop();
|
|
1829
|
+
}
|
|
1830
|
+
}, _callee36);
|
|
1831
|
+
}));
|
|
1832
|
+
return function (_x) {
|
|
1833
|
+
return _ref37.apply(this, arguments);
|
|
1834
|
+
};
|
|
1835
|
+
}());
|
|
1836
|
+
it('ensure retryAfter is set when 429 occurs during failover retry', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1765
1837
|
var retry429Spy;
|
|
1766
|
-
return _regenerator.default.wrap(function (
|
|
1767
|
-
while (1) switch (
|
|
1838
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
1839
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1768
1840
|
case 0:
|
|
1769
|
-
|
|
1841
|
+
_context37.next = 1;
|
|
1770
1842
|
return beforeEachSetupForKeepalive();
|
|
1771
1843
|
case 1:
|
|
1772
1844
|
// Simulate loss of registration so failover path attempts a new registration
|
|
@@ -1777,11 +1849,11 @@ describe('Registration Tests', function () {
|
|
|
1777
1849
|
webex.request.mockRejectedValueOnce(failurePayload429One);
|
|
1778
1850
|
|
|
1779
1851
|
// Directly schedule the failover attempt
|
|
1780
|
-
|
|
1852
|
+
_context37.next = 2;
|
|
1781
1853
|
return reg.startFailoverTimer();
|
|
1782
1854
|
case 2:
|
|
1783
1855
|
jest.advanceTimersByTime(33 * _constants.SEC_TO_MSEC_MFACTOR);
|
|
1784
|
-
|
|
1856
|
+
_context37.next = 3;
|
|
1785
1857
|
return flushPromises();
|
|
1786
1858
|
case 3:
|
|
1787
1859
|
expect(retry429Spy).toBeCalledWith(failurePayload429One.headers['retry-after'], 'startFailoverTimer');
|
|
@@ -1789,16 +1861,16 @@ describe('Registration Tests', function () {
|
|
|
1789
1861
|
jest.useRealTimers();
|
|
1790
1862
|
case 4:
|
|
1791
1863
|
case "end":
|
|
1792
|
-
return
|
|
1864
|
+
return _context37.stop();
|
|
1793
1865
|
}
|
|
1794
|
-
},
|
|
1866
|
+
}, _callee37);
|
|
1795
1867
|
})));
|
|
1796
|
-
it('sets retryAfter when reconnectOnFailure caller receives 429 after keepalive threshold miss', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1868
|
+
it('sets retryAfter when reconnectOnFailure caller receives 429 after keepalive threshold miss', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1797
1869
|
var retry429Spy, threshold;
|
|
1798
|
-
return _regenerator.default.wrap(function (
|
|
1799
|
-
while (1) switch (
|
|
1870
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
1871
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1800
1872
|
case 0:
|
|
1801
|
-
|
|
1873
|
+
_context38.next = 1;
|
|
1802
1874
|
return beforeEachSetupForKeepalive();
|
|
1803
1875
|
case 1:
|
|
1804
1876
|
retry429Spy = jest.spyOn(reg, 'handle429Retry'); // On reconnectOnFailure(RECONNECT_ON_FAILURE_UTIL) first restore attempt, make registration respond with 429 (retry-after: 20)
|
|
@@ -1821,7 +1893,7 @@ describe('Registration Tests', function () {
|
|
|
1821
1893
|
keepAliveRetryCount: threshold
|
|
1822
1894
|
}
|
|
1823
1895
|
});
|
|
1824
|
-
|
|
1896
|
+
_context38.next = 2;
|
|
1825
1897
|
return flushPromises();
|
|
1826
1898
|
case 2:
|
|
1827
1899
|
// handle429Retry is called with caller 'reconnectOnFailure' → else branch executes and sets retryAfter
|
|
@@ -1829,25 +1901,25 @@ describe('Registration Tests', function () {
|
|
|
1829
1901
|
expect(reg.retryAfter).toEqual(undefined); // Clear retryAfter after 429 retry
|
|
1830
1902
|
case 3:
|
|
1831
1903
|
case "end":
|
|
1832
|
-
return
|
|
1904
|
+
return _context38.stop();
|
|
1833
1905
|
}
|
|
1834
|
-
},
|
|
1906
|
+
}, _callee38);
|
|
1835
1907
|
})));
|
|
1836
1908
|
});
|
|
1837
1909
|
describe('Primary server status checks', function () {
|
|
1838
|
-
it('success: primary server status to be up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1910
|
+
it('success: primary server status to be up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1839
1911
|
var pingSuccessPayload, status;
|
|
1840
|
-
return _regenerator.default.wrap(function (
|
|
1841
|
-
while (1) switch (
|
|
1912
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
1913
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1842
1914
|
case 0:
|
|
1843
1915
|
pingSuccessPayload = {
|
|
1844
1916
|
statusCode: 200
|
|
1845
1917
|
};
|
|
1846
1918
|
webex.request.mockResolvedValue(pingSuccessPayload);
|
|
1847
|
-
|
|
1919
|
+
_context39.next = 1;
|
|
1848
1920
|
return reg.isPrimaryActive();
|
|
1849
1921
|
case 1:
|
|
1850
|
-
status =
|
|
1922
|
+
status = _context39.sent;
|
|
1851
1923
|
expect(webex.request).toBeCalledWith(_objectSpread({
|
|
1852
1924
|
method: 'GET',
|
|
1853
1925
|
uri: "https://mobius-dfw.webex.com/api/v1/ping"
|
|
@@ -1855,23 +1927,23 @@ describe('Registration Tests', function () {
|
|
|
1855
1927
|
expect(status).toEqual(true);
|
|
1856
1928
|
case 2:
|
|
1857
1929
|
case "end":
|
|
1858
|
-
return
|
|
1930
|
+
return _context39.stop();
|
|
1859
1931
|
}
|
|
1860
|
-
},
|
|
1932
|
+
}, _callee39);
|
|
1861
1933
|
})));
|
|
1862
|
-
it('failed: primary server status to be down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1934
|
+
it('failed: primary server status to be down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1863
1935
|
var pingFailurePayload, status;
|
|
1864
|
-
return _regenerator.default.wrap(function (
|
|
1865
|
-
while (1) switch (
|
|
1936
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
1937
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1866
1938
|
case 0:
|
|
1867
1939
|
pingFailurePayload = {
|
|
1868
1940
|
statusCode: 500
|
|
1869
1941
|
};
|
|
1870
1942
|
webex.request.mockResolvedValue(pingFailurePayload);
|
|
1871
|
-
|
|
1943
|
+
_context40.next = 1;
|
|
1872
1944
|
return reg.isPrimaryActive();
|
|
1873
1945
|
case 1:
|
|
1874
|
-
status =
|
|
1946
|
+
status = _context40.sent;
|
|
1875
1947
|
expect(webex.request).toBeCalledWith(_objectSpread({
|
|
1876
1948
|
method: 'GET',
|
|
1877
1949
|
uri: "https://mobius-dfw.webex.com/api/v1/ping"
|
|
@@ -1879,9 +1951,9 @@ describe('Registration Tests', function () {
|
|
|
1879
1951
|
expect(status).toEqual(false);
|
|
1880
1952
|
case 2:
|
|
1881
1953
|
case "end":
|
|
1882
|
-
return
|
|
1954
|
+
return _context40.stop();
|
|
1883
1955
|
}
|
|
1884
|
-
},
|
|
1956
|
+
}, _callee40);
|
|
1885
1957
|
})));
|
|
1886
1958
|
});
|
|
1887
1959
|
describe('handleRegistrationDownEvent tests', function () {
|
|
@@ -1901,20 +1973,20 @@ describe('Registration Tests', function () {
|
|
|
1901
1973
|
}
|
|
1902
1974
|
}
|
|
1903
1975
|
};
|
|
1904
|
-
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1905
|
-
return _regenerator.default.wrap(function (
|
|
1906
|
-
while (1) switch (
|
|
1976
|
+
beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
1977
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
1978
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
1907
1979
|
case 0:
|
|
1908
1980
|
postRegistrationSpy.mockResolvedValueOnce(successPayload);
|
|
1909
|
-
|
|
1981
|
+
_context41.next = 1;
|
|
1910
1982
|
return reg.triggerRegistration();
|
|
1911
1983
|
case 1:
|
|
1912
1984
|
expect(reg.getStatus()).toBe(_types.RegistrationStatus.ACTIVE);
|
|
1913
1985
|
case 2:
|
|
1914
1986
|
case "end":
|
|
1915
|
-
return
|
|
1987
|
+
return _context41.stop();
|
|
1916
1988
|
}
|
|
1917
|
-
},
|
|
1989
|
+
}, _callee41);
|
|
1918
1990
|
})));
|
|
1919
1991
|
afterEach(function () {
|
|
1920
1992
|
var calls = (0, _values.default)(reg.callManager.getActiveCalls());
|
|
@@ -1923,10 +1995,10 @@ describe('Registration Tests', function () {
|
|
|
1923
1995
|
});
|
|
1924
1996
|
reg.callManager.callCollection = {};
|
|
1925
1997
|
});
|
|
1926
|
-
it('runs cleanup immediately when no active calls are present (socket disabled)', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1998
|
+
it('runs cleanup immediately when no active calls are present (socket disabled)', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
1927
1999
|
var clearKeepaliveSpy, setStatusSpy, disconnectSocketSpy;
|
|
1928
|
-
return _regenerator.default.wrap(function (
|
|
1929
|
-
while (1) switch (
|
|
2000
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2001
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
1930
2002
|
case 0:
|
|
1931
2003
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
1932
2004
|
setStatusSpy = jest.spyOn(reg, 'setStatus');
|
|
@@ -1935,7 +2007,7 @@ describe('Registration Tests', function () {
|
|
|
1935
2007
|
}), 'disconnectFromMobiusSocket');
|
|
1936
2008
|
lineEmitter.mockClear();
|
|
1937
2009
|
expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(0);
|
|
1938
|
-
|
|
2010
|
+
_context42.next = 1;
|
|
1939
2011
|
return reg.handleRegistrationDownEvent(registrationDownEvent);
|
|
1940
2012
|
case 1:
|
|
1941
2013
|
expect(clearKeepaliveSpy).toHaveBeenCalled();
|
|
@@ -1950,14 +2022,14 @@ describe('Registration Tests', function () {
|
|
|
1950
2022
|
expect(lineEmitter).toHaveBeenCalledWith(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1951
2023
|
case 2:
|
|
1952
2024
|
case "end":
|
|
1953
|
-
return
|
|
2025
|
+
return _context42.stop();
|
|
1954
2026
|
}
|
|
1955
|
-
},
|
|
2027
|
+
}, _callee42);
|
|
1956
2028
|
})));
|
|
1957
|
-
it('ends the active call and still runs cleanup when an active call is present', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2029
|
+
it('ends the active call and still runs cleanup when an active call is present', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
1958
2030
|
var clearKeepaliveSpy, setStatusSpy, activeCall, endSpy;
|
|
1959
|
-
return _regenerator.default.wrap(function (
|
|
1960
|
-
while (1) switch (
|
|
2031
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2032
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
1961
2033
|
case 0:
|
|
1962
2034
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
1963
2035
|
setStatusSpy = jest.spyOn(reg, 'setStatus');
|
|
@@ -1965,7 +2037,7 @@ describe('Registration Tests', function () {
|
|
|
1965
2037
|
endSpy = jest.spyOn(activeCall, 'end');
|
|
1966
2038
|
expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(1);
|
|
1967
2039
|
lineEmitter.mockClear();
|
|
1968
|
-
|
|
2040
|
+
_context43.next = 1;
|
|
1969
2041
|
return reg.handleRegistrationDownEvent(registrationDownEvent);
|
|
1970
2042
|
case 1:
|
|
1971
2043
|
expect(endSpy).toHaveBeenCalledTimes(1);
|
|
@@ -1975,18 +2047,18 @@ describe('Registration Tests', function () {
|
|
|
1975
2047
|
expect(lineEmitter).toHaveBeenCalledWith(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1976
2048
|
case 2:
|
|
1977
2049
|
case "end":
|
|
1978
|
-
return
|
|
2050
|
+
return _context43.stop();
|
|
1979
2051
|
}
|
|
1980
|
-
},
|
|
2052
|
+
}, _callee43);
|
|
1981
2053
|
})));
|
|
1982
|
-
it('runs cleanup without calling end when no active call is present on re-invocation', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2054
|
+
it('runs cleanup without calling end when no active call is present on re-invocation', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
1983
2055
|
var clearKeepaliveSpy, setStatusSpy;
|
|
1984
|
-
return _regenerator.default.wrap(function (
|
|
1985
|
-
while (1) switch (
|
|
2056
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2057
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
1986
2058
|
case 0:
|
|
1987
2059
|
clearKeepaliveSpy = jest.spyOn(reg, 'clearKeepaliveTimer');
|
|
1988
2060
|
setStatusSpy = jest.spyOn(reg, 'setStatus');
|
|
1989
|
-
|
|
2061
|
+
_context44.next = 1;
|
|
1990
2062
|
return reg.handleRegistrationDownEvent(registrationDownEvent);
|
|
1991
2063
|
case 1:
|
|
1992
2064
|
expect(reg.getStatus()).toBe(_types.RegistrationStatus.INACTIVE);
|
|
@@ -1994,7 +2066,7 @@ describe('Registration Tests', function () {
|
|
|
1994
2066
|
setStatusSpy.mockClear();
|
|
1995
2067
|
lineEmitter.mockClear();
|
|
1996
2068
|
expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(0);
|
|
1997
|
-
|
|
2069
|
+
_context44.next = 2;
|
|
1998
2070
|
return reg.handleRegistrationDownEvent(registrationDownEvent);
|
|
1999
2071
|
case 2:
|
|
2000
2072
|
expect(clearKeepaliveSpy).toHaveBeenCalled();
|
|
@@ -2003,14 +2075,14 @@ describe('Registration Tests', function () {
|
|
|
2003
2075
|
expect(lineEmitter).toHaveBeenCalledWith(_types4.LINE_EVENTS.UNREGISTERED);
|
|
2004
2076
|
case 3:
|
|
2005
2077
|
case "end":
|
|
2006
|
-
return
|
|
2078
|
+
return _context44.stop();
|
|
2007
2079
|
}
|
|
2008
|
-
},
|
|
2080
|
+
}, _callee44);
|
|
2009
2081
|
})));
|
|
2010
|
-
it('disconnects the Mobius WebSocket when socket is enabled', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2082
|
+
it('disconnects the Mobius WebSocket when socket is enabled', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2011
2083
|
var apiRequest, disconnectSocketSpy;
|
|
2012
|
-
return _regenerator.default.wrap(function (
|
|
2013
|
-
while (1) switch (
|
|
2084
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2085
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2014
2086
|
case 0:
|
|
2015
2087
|
apiRequest = _request.APIRequest.getInstance({
|
|
2016
2088
|
webex: webex
|
|
@@ -2019,7 +2091,7 @@ describe('Registration Tests', function () {
|
|
|
2019
2091
|
disconnectSocketSpy = jest.spyOn(apiRequest, 'disconnectFromMobiusSocket').mockResolvedValue();
|
|
2020
2092
|
lineEmitter.mockClear();
|
|
2021
2093
|
expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(0);
|
|
2022
|
-
|
|
2094
|
+
_context45.next = 1;
|
|
2023
2095
|
return reg.handleRegistrationDownEvent(registrationDownEvent);
|
|
2024
2096
|
case 1:
|
|
2025
2097
|
expect(disconnectSocketSpy).toHaveBeenCalledWith({
|
|
@@ -2030,14 +2102,14 @@ describe('Registration Tests', function () {
|
|
|
2030
2102
|
expect(lineEmitter).toHaveBeenCalledWith(_types4.LINE_EVENTS.UNREGISTERED);
|
|
2031
2103
|
case 2:
|
|
2032
2104
|
case "end":
|
|
2033
|
-
return
|
|
2105
|
+
return _context45.stop();
|
|
2034
2106
|
}
|
|
2035
|
-
},
|
|
2107
|
+
}, _callee45);
|
|
2036
2108
|
})));
|
|
2037
|
-
it('still emits UNREGISTERED when socket disconnect fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2109
|
+
it('still emits UNREGISTERED when socket disconnect fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2038
2110
|
var apiRequest, disconnectSocketSpy;
|
|
2039
|
-
return _regenerator.default.wrap(function (
|
|
2040
|
-
while (1) switch (
|
|
2111
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2112
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2041
2113
|
case 0:
|
|
2042
2114
|
apiRequest = _request.APIRequest.getInstance({
|
|
2043
2115
|
webex: webex
|
|
@@ -2045,7 +2117,7 @@ describe('Registration Tests', function () {
|
|
|
2045
2117
|
jest.spyOn(apiRequest, 'isSocketEnabled').mockReturnValue(true);
|
|
2046
2118
|
disconnectSocketSpy = jest.spyOn(apiRequest, 'disconnectFromMobiusSocket').mockRejectedValue(new Error('socket teardown failed'));
|
|
2047
2119
|
lineEmitter.mockClear();
|
|
2048
|
-
|
|
2120
|
+
_context46.next = 1;
|
|
2049
2121
|
return reg.handleRegistrationDownEvent(registrationDownEvent);
|
|
2050
2122
|
case 1:
|
|
2051
2123
|
expect(disconnectSocketSpy).toHaveBeenCalled();
|
|
@@ -2057,9 +2129,9 @@ describe('Registration Tests', function () {
|
|
|
2057
2129
|
expect(lineEmitter).toHaveBeenCalledWith(_types4.LINE_EVENTS.UNREGISTERED);
|
|
2058
2130
|
case 2:
|
|
2059
2131
|
case "end":
|
|
2060
|
-
return
|
|
2132
|
+
return _context46.stop();
|
|
2061
2133
|
}
|
|
2062
|
-
},
|
|
2134
|
+
}, _callee46);
|
|
2063
2135
|
})));
|
|
2064
2136
|
});
|
|
2065
2137
|
});
|