@webex/calling 3.10.0-next.1 → 3.10.0-next.10
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 +26 -20
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +109 -0
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +2 -1
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +160 -205
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +152 -290
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +14 -14
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +348 -258
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +8 -5
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Events/impl/index.js +1 -2
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +14 -12
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +2 -1
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/common/testUtil.js +2 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +7 -3
- package/dist/module/CallSettings/WxCallBackendConnector.js +3 -1
- package/dist/module/CallingClient/CallingClient.js +83 -121
- package/dist/module/CallingClient/calling/call.js +5 -5
- package/dist/module/Contacts/ContactsClient.js +9 -5
- package/dist/module/Events/impl/index.js +1 -2
- package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -1
- package/dist/module/Voicemail/UcmBackendConnector.js +2 -1
- package/dist/module/common/testUtil.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -0
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Events/impl/index.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +10 -0
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1309,15 +1309,15 @@ describe('State Machine handler tests', function () {
|
|
|
1309
1309
|
return (0, _testUtil.flushPromises)(2);
|
|
1310
1310
|
case 12:
|
|
1311
1311
|
expect(call.isConnected()).toBe(false);
|
|
1312
|
-
expect(call['mediaStateMachine'].state.value).toBe('
|
|
1313
|
-
expect(call['callStateMachine'].state.value).toBe('
|
|
1312
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1313
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1314
1314
|
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1315
1315
|
file: 'call',
|
|
1316
1316
|
method: 'handleRoapEstablished'
|
|
1317
1317
|
});
|
|
1318
|
-
expect(
|
|
1319
|
-
|
|
1320
|
-
|
|
1318
|
+
expect(warnSpy).toHaveBeenCalledWith('Call failed due to media issue', {
|
|
1319
|
+
file: 'call',
|
|
1320
|
+
method: 'handleRoapError'
|
|
1321
1321
|
});
|
|
1322
1322
|
case 17:
|
|
1323
1323
|
case "end":
|
|
@@ -1661,10 +1661,76 @@ describe('State Machine handler tests', function () {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
}, _callee31);
|
|
1663
1663
|
})));
|
|
1664
|
-
it('
|
|
1665
|
-
var statusPayload,
|
|
1664
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1665
|
+
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1666
1666
|
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1667
1667
|
while (1) switch (_context32.prev = _context32.next) {
|
|
1668
|
+
case 0:
|
|
1669
|
+
statusPayload = {
|
|
1670
|
+
statusCode: 403,
|
|
1671
|
+
body: mockStatusBody
|
|
1672
|
+
};
|
|
1673
|
+
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1674
|
+
postMediaSpy = jest.spyOn(call, 'postMedia').mockRejectedValueOnce(statusPayload); // Simulate inbound call flow
|
|
1675
|
+
call['direction'] = _types3.CallDirection.INBOUND;
|
|
1676
|
+
setupEvent = {
|
|
1677
|
+
type: 'E_RECV_CALL_SETUP',
|
|
1678
|
+
data: {
|
|
1679
|
+
seq: 1,
|
|
1680
|
+
messageType: 'OFFER'
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
call.sendCallStateMachineEvt(setupEvent);
|
|
1684
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
1685
|
+
connectEvent = {
|
|
1686
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
1687
|
+
};
|
|
1688
|
+
call.sendCallStateMachineEvt(connectEvent);
|
|
1689
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
1690
|
+
offerEvent = {
|
|
1691
|
+
type: 'E_RECV_ROAP_OFFER',
|
|
1692
|
+
data: {
|
|
1693
|
+
seq: 1,
|
|
1694
|
+
messageType: 'OFFER'
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
call.sendMediaStateMachineEvt(offerEvent);
|
|
1698
|
+
answerEvent = {
|
|
1699
|
+
type: 'E_SEND_ROAP_ANSWER',
|
|
1700
|
+
data: {
|
|
1701
|
+
seq: 1,
|
|
1702
|
+
messageType: 'ANSWER'
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
_context32.next = 15;
|
|
1706
|
+
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1707
|
+
case 15:
|
|
1708
|
+
_context32.next = 17;
|
|
1709
|
+
return (0, _testUtil.flushPromises)(2);
|
|
1710
|
+
case 17:
|
|
1711
|
+
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
1712
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to send MediaAnswer request', {
|
|
1713
|
+
file: 'call',
|
|
1714
|
+
method: 'handleOutgoingRoapAnswer'
|
|
1715
|
+
});
|
|
1716
|
+
expect(warnSpy).toHaveBeenCalledWith('Call failed due to media issue', {
|
|
1717
|
+
file: 'call',
|
|
1718
|
+
method: 'handleRoapError'
|
|
1719
|
+
});
|
|
1720
|
+
|
|
1721
|
+
// Final state should be torn down and cleared for unconnected call
|
|
1722
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_TEARDOWN');
|
|
1723
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1724
|
+
case 22:
|
|
1725
|
+
case "end":
|
|
1726
|
+
return _context32.stop();
|
|
1727
|
+
}
|
|
1728
|
+
}, _callee32);
|
|
1729
|
+
})));
|
|
1730
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1731
|
+
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1732
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1733
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1668
1734
|
case 0:
|
|
1669
1735
|
statusPayload = {
|
|
1670
1736
|
statusCode: 200,
|
|
@@ -1697,7 +1763,7 @@ describe('State Machine handler tests', function () {
|
|
|
1697
1763
|
seq: 1,
|
|
1698
1764
|
messageType: 'ANSWER'
|
|
1699
1765
|
};
|
|
1700
|
-
|
|
1766
|
+
_context33.next = 17;
|
|
1701
1767
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1702
1768
|
case 17:
|
|
1703
1769
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1719,7 +1785,7 @@ describe('State Machine handler tests', function () {
|
|
|
1719
1785
|
seq: 2,
|
|
1720
1786
|
messageType: 'OFFER_REQUEST'
|
|
1721
1787
|
};
|
|
1722
|
-
|
|
1788
|
+
_context33.next = 23;
|
|
1723
1789
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1724
1790
|
case 23:
|
|
1725
1791
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1769,7 +1835,7 @@ describe('State Machine handler tests', function () {
|
|
|
1769
1835
|
};
|
|
1770
1836
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1771
1837
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1772
|
-
|
|
1838
|
+
_context33.next = 49;
|
|
1773
1839
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1774
1840
|
case 49:
|
|
1775
1841
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1778,7 +1844,7 @@ describe('State Machine handler tests', function () {
|
|
|
1778
1844
|
seq: 3,
|
|
1779
1845
|
messageType: 'ANSWER'
|
|
1780
1846
|
};
|
|
1781
|
-
|
|
1847
|
+
_context33.next = 54;
|
|
1782
1848
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1783
1849
|
case 54:
|
|
1784
1850
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1797,7 +1863,7 @@ describe('State Machine handler tests', function () {
|
|
|
1797
1863
|
messageType: 'OK'
|
|
1798
1864
|
}
|
|
1799
1865
|
};
|
|
1800
|
-
|
|
1866
|
+
_context33.next = 63;
|
|
1801
1867
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1802
1868
|
case 63:
|
|
1803
1869
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1812,14 +1878,14 @@ describe('State Machine handler tests', function () {
|
|
|
1812
1878
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1813
1879
|
case 70:
|
|
1814
1880
|
case "end":
|
|
1815
|
-
return
|
|
1881
|
+
return _context33.stop();
|
|
1816
1882
|
}
|
|
1817
|
-
},
|
|
1883
|
+
}, _callee33);
|
|
1818
1884
|
})));
|
|
1819
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1885
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1820
1886
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1821
|
-
return _regenerator.default.wrap(function
|
|
1822
|
-
while (1) switch (
|
|
1887
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1888
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1823
1889
|
case 0:
|
|
1824
1890
|
mockStatusBody = {
|
|
1825
1891
|
device: {
|
|
@@ -1859,7 +1925,7 @@ describe('State Machine handler tests', function () {
|
|
|
1859
1925
|
seq: 1,
|
|
1860
1926
|
messageType: 'ANSWER'
|
|
1861
1927
|
};
|
|
1862
|
-
|
|
1928
|
+
_context34.next = 18;
|
|
1863
1929
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1864
1930
|
case 18:
|
|
1865
1931
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1881,7 +1947,7 @@ describe('State Machine handler tests', function () {
|
|
|
1881
1947
|
seq: 2,
|
|
1882
1948
|
messageType: 'OFFER_REQUEST'
|
|
1883
1949
|
};
|
|
1884
|
-
|
|
1950
|
+
_context34.next = 24;
|
|
1885
1951
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1886
1952
|
case 24:
|
|
1887
1953
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1931,7 +1997,7 @@ describe('State Machine handler tests', function () {
|
|
|
1931
1997
|
};
|
|
1932
1998
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1933
1999
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1934
|
-
|
|
2000
|
+
_context34.next = 50;
|
|
1935
2001
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1936
2002
|
case 50:
|
|
1937
2003
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1940,7 +2006,7 @@ describe('State Machine handler tests', function () {
|
|
|
1940
2006
|
seq: 3,
|
|
1941
2007
|
messageType: 'ANSWER'
|
|
1942
2008
|
};
|
|
1943
|
-
|
|
2009
|
+
_context34.next = 55;
|
|
1944
2010
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1945
2011
|
case 55:
|
|
1946
2012
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1957,7 +2023,7 @@ describe('State Machine handler tests', function () {
|
|
|
1957
2023
|
}
|
|
1958
2024
|
};
|
|
1959
2025
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1960
|
-
|
|
2026
|
+
_context34.next = 62;
|
|
1961
2027
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1962
2028
|
case 62:
|
|
1963
2029
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1973,14 +2039,14 @@ describe('State Machine handler tests', function () {
|
|
|
1973
2039
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1974
2040
|
case 70:
|
|
1975
2041
|
case "end":
|
|
1976
|
-
return
|
|
2042
|
+
return _context34.stop();
|
|
1977
2043
|
}
|
|
1978
|
-
},
|
|
2044
|
+
}, _callee34);
|
|
1979
2045
|
})));
|
|
1980
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2046
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1981
2047
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1982
|
-
return _regenerator.default.wrap(function
|
|
1983
|
-
while (1) switch (
|
|
2048
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
2049
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1984
2050
|
case 0:
|
|
1985
2051
|
statusPayload = {
|
|
1986
2052
|
statusCode: 200,
|
|
@@ -2047,9 +2113,33 @@ describe('State Machine handler tests', function () {
|
|
|
2047
2113
|
});
|
|
2048
2114
|
case 33:
|
|
2049
2115
|
case "end":
|
|
2050
|
-
return
|
|
2116
|
+
return _context35.stop();
|
|
2051
2117
|
}
|
|
2052
|
-
},
|
|
2118
|
+
}, _callee35);
|
|
2119
|
+
})));
|
|
2120
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
2121
|
+
var emitSpy, deleteSpy;
|
|
2122
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
2123
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2124
|
+
case 0:
|
|
2125
|
+
emitSpy = jest.spyOn(call, 'emit');
|
|
2126
|
+
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
2127
|
+
statusCode: 200
|
|
2128
|
+
});
|
|
2129
|
+
call.sendCallStateMachineEvt({
|
|
2130
|
+
type: 'E_RECV_CALL_DISCONNECT'
|
|
2131
|
+
});
|
|
2132
|
+
_context36.next = 5;
|
|
2133
|
+
return (0, _testUtil.flushPromises)(1);
|
|
2134
|
+
case 5:
|
|
2135
|
+
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
2136
|
+
expect(deleteSpy).toHaveBeenCalled();
|
|
2137
|
+
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2138
|
+
case 8:
|
|
2139
|
+
case "end":
|
|
2140
|
+
return _context36.stop();
|
|
2141
|
+
}
|
|
2142
|
+
}, _callee36);
|
|
2053
2143
|
})));
|
|
2054
2144
|
describe('Call event timers tests', function () {
|
|
2055
2145
|
var callManager;
|
|
@@ -2060,10 +2150,10 @@ describe('State Machine handler tests', function () {
|
|
|
2060
2150
|
afterEach(function () {
|
|
2061
2151
|
jest.clearAllTimers();
|
|
2062
2152
|
});
|
|
2063
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2153
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
2064
2154
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2065
|
-
return _regenerator.default.wrap(function
|
|
2066
|
-
while (1) switch (
|
|
2155
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
2156
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2067
2157
|
case 0:
|
|
2068
2158
|
statusPayload = {
|
|
2069
2159
|
statusCode: 200,
|
|
@@ -2080,7 +2170,7 @@ describe('State Machine handler tests', function () {
|
|
|
2080
2170
|
webex.request.mockReturnValue(statusPayload);
|
|
2081
2171
|
|
|
2082
2172
|
// handleOutgoingCallSetup is asynchronous
|
|
2083
|
-
|
|
2173
|
+
_context37.next = 9;
|
|
2084
2174
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2085
2175
|
case 9:
|
|
2086
2176
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2123,14 +2213,14 @@ describe('State Machine handler tests', function () {
|
|
|
2123
2213
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2124
2214
|
case 32:
|
|
2125
2215
|
case "end":
|
|
2126
|
-
return
|
|
2216
|
+
return _context37.stop();
|
|
2127
2217
|
}
|
|
2128
|
-
},
|
|
2218
|
+
}, _callee37);
|
|
2129
2219
|
})));
|
|
2130
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2220
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
2131
2221
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2132
|
-
return _regenerator.default.wrap(function
|
|
2133
|
-
while (1) switch (
|
|
2222
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
2223
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2134
2224
|
case 0:
|
|
2135
2225
|
statusPayload = {
|
|
2136
2226
|
statusCode: 200,
|
|
@@ -2149,7 +2239,7 @@ describe('State Machine handler tests', function () {
|
|
|
2149
2239
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2150
2240
|
|
|
2151
2241
|
// handleOutgoingCallSetup is asynchronous
|
|
2152
|
-
|
|
2242
|
+
_context38.next = 11;
|
|
2153
2243
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2154
2244
|
case 11:
|
|
2155
2245
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2161,9 +2251,9 @@ describe('State Machine handler tests', function () {
|
|
|
2161
2251
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2162
2252
|
case 18:
|
|
2163
2253
|
case "end":
|
|
2164
|
-
return
|
|
2254
|
+
return _context38.stop();
|
|
2165
2255
|
}
|
|
2166
|
-
},
|
|
2256
|
+
}, _callee38);
|
|
2167
2257
|
})));
|
|
2168
2258
|
});
|
|
2169
2259
|
});
|
|
@@ -2223,10 +2313,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2223
2313
|
beforeEach(function () {
|
|
2224
2314
|
call.removeAllListeners();
|
|
2225
2315
|
});
|
|
2226
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2316
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2227
2317
|
var responsePayload, warnSpy, roapEvent;
|
|
2228
|
-
return _regenerator.default.wrap(function
|
|
2229
|
-
while (1) switch (
|
|
2318
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
2319
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2230
2320
|
case 0:
|
|
2231
2321
|
expect.assertions(7);
|
|
2232
2322
|
responsePayload = {
|
|
@@ -2239,25 +2329,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2239
2329
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2240
2330
|
call['held'] = false;
|
|
2241
2331
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2242
|
-
var
|
|
2243
|
-
return _regenerator.default.wrap(function
|
|
2244
|
-
while (1) switch (
|
|
2332
|
+
var _ref40 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(correlationId) {
|
|
2333
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
2334
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2245
2335
|
case 0:
|
|
2246
2336
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2247
2337
|
case 1:
|
|
2248
2338
|
case "end":
|
|
2249
|
-
return
|
|
2339
|
+
return _context39.stop();
|
|
2250
2340
|
}
|
|
2251
|
-
},
|
|
2341
|
+
}, _callee39);
|
|
2252
2342
|
}));
|
|
2253
2343
|
return function (_x) {
|
|
2254
|
-
return
|
|
2344
|
+
return _ref40.apply(this, arguments);
|
|
2255
2345
|
};
|
|
2256
2346
|
}());
|
|
2257
|
-
|
|
2347
|
+
_context40.next = 10;
|
|
2258
2348
|
return call.doHoldResume();
|
|
2259
2349
|
case 10:
|
|
2260
|
-
|
|
2350
|
+
_context40.next = 12;
|
|
2261
2351
|
return (0, _testUtil.flushPromises)(2);
|
|
2262
2352
|
case 12:
|
|
2263
2353
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2273,11 +2363,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2273
2363
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2274
2364
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2275
2365
|
roapEvent.data.type = 'ANSWER';
|
|
2276
|
-
|
|
2366
|
+
_context40.next = 20;
|
|
2277
2367
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2278
2368
|
case 20:
|
|
2279
2369
|
roapEvent.data.type = 'OK';
|
|
2280
|
-
|
|
2370
|
+
_context40.next = 23;
|
|
2281
2371
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2282
2372
|
case 23:
|
|
2283
2373
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2292,14 +2382,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2292
2382
|
});
|
|
2293
2383
|
case 28:
|
|
2294
2384
|
case "end":
|
|
2295
|
-
return
|
|
2385
|
+
return _context40.stop();
|
|
2296
2386
|
}
|
|
2297
|
-
},
|
|
2387
|
+
}, _callee40);
|
|
2298
2388
|
})));
|
|
2299
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2389
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2300
2390
|
var responsePayload, warnSpy, roapEvent;
|
|
2301
|
-
return _regenerator.default.wrap(function
|
|
2302
|
-
while (1) switch (
|
|
2391
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2392
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2303
2393
|
case 0:
|
|
2304
2394
|
expect.assertions(8);
|
|
2305
2395
|
responsePayload = {
|
|
@@ -2312,26 +2402,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2312
2402
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2313
2403
|
call['held'] = false;
|
|
2314
2404
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2315
|
-
var
|
|
2316
|
-
return _regenerator.default.wrap(function
|
|
2317
|
-
while (1) switch (
|
|
2405
|
+
var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(correlationId) {
|
|
2406
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2407
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2318
2408
|
case 0:
|
|
2319
2409
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2320
2410
|
case 1:
|
|
2321
2411
|
case "end":
|
|
2322
|
-
return
|
|
2412
|
+
return _context41.stop();
|
|
2323
2413
|
}
|
|
2324
|
-
},
|
|
2414
|
+
}, _callee41);
|
|
2325
2415
|
}));
|
|
2326
2416
|
return function (_x2) {
|
|
2327
|
-
return
|
|
2417
|
+
return _ref42.apply(this, arguments);
|
|
2328
2418
|
};
|
|
2329
2419
|
}());
|
|
2330
2420
|
call.doHoldResume();
|
|
2331
|
-
|
|
2421
|
+
_context42.next = 11;
|
|
2332
2422
|
return _promise.default.resolve();
|
|
2333
2423
|
case 11:
|
|
2334
|
-
|
|
2424
|
+
_context42.next = 13;
|
|
2335
2425
|
return _promise.default.resolve();
|
|
2336
2426
|
case 13:
|
|
2337
2427
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2347,11 +2437,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2347
2437
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2348
2438
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2349
2439
|
roapEvent.data.type = 'ANSWER';
|
|
2350
|
-
|
|
2440
|
+
_context42.next = 22;
|
|
2351
2441
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2352
2442
|
case 22:
|
|
2353
2443
|
roapEvent.data.type = 'OK';
|
|
2354
|
-
|
|
2444
|
+
_context42.next = 25;
|
|
2355
2445
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2356
2446
|
case 25:
|
|
2357
2447
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2366,14 +2456,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2366
2456
|
});
|
|
2367
2457
|
case 30:
|
|
2368
2458
|
case "end":
|
|
2369
|
-
return
|
|
2459
|
+
return _context42.stop();
|
|
2370
2460
|
}
|
|
2371
|
-
},
|
|
2461
|
+
}, _callee42);
|
|
2372
2462
|
})));
|
|
2373
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2463
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2374
2464
|
var responsePayload;
|
|
2375
|
-
return _regenerator.default.wrap(function
|
|
2376
|
-
while (1) switch (
|
|
2465
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2466
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2377
2467
|
case 0:
|
|
2378
2468
|
expect.assertions(4);
|
|
2379
2469
|
responsePayload = {
|
|
@@ -2383,26 +2473,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2383
2473
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2384
2474
|
call['held'] = false;
|
|
2385
2475
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2386
|
-
var
|
|
2387
|
-
return _regenerator.default.wrap(function
|
|
2388
|
-
while (1) switch (
|
|
2476
|
+
var _ref44 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(errObj) {
|
|
2477
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2478
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2389
2479
|
case 0:
|
|
2390
2480
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2391
2481
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2392
2482
|
case 2:
|
|
2393
2483
|
case "end":
|
|
2394
|
-
return
|
|
2484
|
+
return _context43.stop();
|
|
2395
2485
|
}
|
|
2396
|
-
},
|
|
2486
|
+
}, _callee43);
|
|
2397
2487
|
}));
|
|
2398
2488
|
return function (_x3) {
|
|
2399
|
-
return
|
|
2489
|
+
return _ref44.apply(this, arguments);
|
|
2400
2490
|
};
|
|
2401
2491
|
}());
|
|
2402
|
-
|
|
2492
|
+
_context44.next = 7;
|
|
2403
2493
|
return call.doHoldResume();
|
|
2404
2494
|
case 7:
|
|
2405
|
-
|
|
2495
|
+
_context44.next = 9;
|
|
2406
2496
|
return (0, _testUtil.flushPromises)(2);
|
|
2407
2497
|
case 9:
|
|
2408
2498
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2412,14 +2502,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2412
2502
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2413
2503
|
case 11:
|
|
2414
2504
|
case "end":
|
|
2415
|
-
return
|
|
2505
|
+
return _context44.stop();
|
|
2416
2506
|
}
|
|
2417
|
-
},
|
|
2507
|
+
}, _callee44);
|
|
2418
2508
|
})));
|
|
2419
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2509
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2420
2510
|
var responsePayload, rejectPayload, roapEvent;
|
|
2421
|
-
return _regenerator.default.wrap(function
|
|
2422
|
-
while (1) switch (
|
|
2511
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2512
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2423
2513
|
case 0:
|
|
2424
2514
|
expect.assertions(5);
|
|
2425
2515
|
responsePayload = {
|
|
@@ -2433,24 +2523,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2433
2523
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2434
2524
|
call['held'] = false;
|
|
2435
2525
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2436
|
-
var
|
|
2437
|
-
return _regenerator.default.wrap(function
|
|
2438
|
-
while (1) switch (
|
|
2526
|
+
var _ref46 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(errObj) {
|
|
2527
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2528
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2439
2529
|
case 0:
|
|
2440
2530
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2441
2531
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2442
2532
|
case 2:
|
|
2443
2533
|
case "end":
|
|
2444
|
-
return
|
|
2534
|
+
return _context45.stop();
|
|
2445
2535
|
}
|
|
2446
|
-
},
|
|
2536
|
+
}, _callee45);
|
|
2447
2537
|
}));
|
|
2448
2538
|
return function (_x4) {
|
|
2449
|
-
return
|
|
2539
|
+
return _ref46.apply(this, arguments);
|
|
2450
2540
|
};
|
|
2451
2541
|
}());
|
|
2452
2542
|
call.doHoldResume();
|
|
2453
|
-
|
|
2543
|
+
_context46.next = 9;
|
|
2454
2544
|
return (0, _testUtil.flushPromises)(2);
|
|
2455
2545
|
case 9:
|
|
2456
2546
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2460,7 +2550,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2460
2550
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2461
2551
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2462
2552
|
roapEvent.data.type = 'ANSWER';
|
|
2463
|
-
|
|
2553
|
+
_context46.next = 15;
|
|
2464
2554
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2465
2555
|
case 15:
|
|
2466
2556
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2468,14 +2558,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2468
2558
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2469
2559
|
case 17:
|
|
2470
2560
|
case "end":
|
|
2471
|
-
return
|
|
2561
|
+
return _context46.stop();
|
|
2472
2562
|
}
|
|
2473
|
-
},
|
|
2563
|
+
}, _callee46);
|
|
2474
2564
|
})));
|
|
2475
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2565
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2476
2566
|
var responsePayload, warnSpy, roapEvent;
|
|
2477
|
-
return _regenerator.default.wrap(function
|
|
2478
|
-
while (1) switch (
|
|
2567
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2568
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2479
2569
|
case 0:
|
|
2480
2570
|
responsePayload = {
|
|
2481
2571
|
statusCode: 200,
|
|
@@ -2486,10 +2576,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2486
2576
|
jest.spyOn(global, 'clearTimeout');
|
|
2487
2577
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2488
2578
|
call['held'] = false;
|
|
2489
|
-
|
|
2579
|
+
_context47.next = 8;
|
|
2490
2580
|
return call.doHoldResume();
|
|
2491
2581
|
case 8:
|
|
2492
|
-
|
|
2582
|
+
_context47.next = 10;
|
|
2493
2583
|
return (0, _testUtil.flushPromises)(2);
|
|
2494
2584
|
case 10:
|
|
2495
2585
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2504,19 +2594,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2504
2594
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2505
2595
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2506
2596
|
roapEvent.data.type = 'ANSWER';
|
|
2507
|
-
|
|
2597
|
+
_context47.next = 17;
|
|
2508
2598
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2509
2599
|
case 17:
|
|
2510
2600
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2511
2601
|
statusCode: 403
|
|
2512
2602
|
});
|
|
2513
2603
|
roapEvent.data.type = 'OK';
|
|
2514
|
-
|
|
2604
|
+
_context47.next = 21;
|
|
2515
2605
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2516
2606
|
case 21:
|
|
2517
2607
|
/* this is for coverage */
|
|
2518
2608
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2519
|
-
|
|
2609
|
+
_context47.next = 24;
|
|
2520
2610
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2521
2611
|
case 24:
|
|
2522
2612
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2528,14 +2618,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2528
2618
|
});
|
|
2529
2619
|
case 27:
|
|
2530
2620
|
case "end":
|
|
2531
|
-
return
|
|
2621
|
+
return _context47.stop();
|
|
2532
2622
|
}
|
|
2533
|
-
},
|
|
2623
|
+
}, _callee47);
|
|
2534
2624
|
})));
|
|
2535
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2625
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2536
2626
|
var responsePayload, warnSpy, roapEvent;
|
|
2537
|
-
return _regenerator.default.wrap(function
|
|
2538
|
-
while (1) switch (
|
|
2627
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2628
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2539
2629
|
case 0:
|
|
2540
2630
|
responsePayload = {
|
|
2541
2631
|
statusCode: 200,
|
|
@@ -2546,10 +2636,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2546
2636
|
jest.spyOn(global, 'clearTimeout');
|
|
2547
2637
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2548
2638
|
call['held'] = true;
|
|
2549
|
-
|
|
2639
|
+
_context48.next = 8;
|
|
2550
2640
|
return call.doHoldResume();
|
|
2551
2641
|
case 8:
|
|
2552
|
-
|
|
2642
|
+
_context48.next = 10;
|
|
2553
2643
|
return (0, _testUtil.flushPromises)(2);
|
|
2554
2644
|
case 10:
|
|
2555
2645
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2564,14 +2654,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2564
2654
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2565
2655
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2566
2656
|
roapEvent.data.type = 'ANSWER';
|
|
2567
|
-
|
|
2657
|
+
_context48.next = 17;
|
|
2568
2658
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2569
2659
|
case 17:
|
|
2570
2660
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2571
2661
|
statusCode: 403
|
|
2572
2662
|
});
|
|
2573
2663
|
roapEvent.data.type = 'OK';
|
|
2574
|
-
|
|
2664
|
+
_context48.next = 21;
|
|
2575
2665
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2576
2666
|
case 21:
|
|
2577
2667
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2583,14 +2673,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2583
2673
|
});
|
|
2584
2674
|
case 24:
|
|
2585
2675
|
case "end":
|
|
2586
|
-
return
|
|
2676
|
+
return _context48.stop();
|
|
2587
2677
|
}
|
|
2588
|
-
},
|
|
2678
|
+
}, _callee48);
|
|
2589
2679
|
})));
|
|
2590
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2680
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2591
2681
|
var responsePayload, roapEvent;
|
|
2592
|
-
return _regenerator.default.wrap(function
|
|
2593
|
-
while (1) switch (
|
|
2682
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2683
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2594
2684
|
case 0:
|
|
2595
2685
|
expect.assertions(5);
|
|
2596
2686
|
responsePayload = {
|
|
@@ -2600,25 +2690,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2600
2690
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2601
2691
|
call['held'] = false;
|
|
2602
2692
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2603
|
-
var
|
|
2604
|
-
return _regenerator.default.wrap(function
|
|
2605
|
-
while (1) switch (
|
|
2693
|
+
var _ref50 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
|
|
2694
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2695
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2606
2696
|
case 0:
|
|
2607
2697
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2608
2698
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2609
2699
|
case 2:
|
|
2610
2700
|
case "end":
|
|
2611
|
-
return
|
|
2701
|
+
return _context49.stop();
|
|
2612
2702
|
}
|
|
2613
|
-
},
|
|
2703
|
+
}, _callee49);
|
|
2614
2704
|
}));
|
|
2615
2705
|
return function (_x5) {
|
|
2616
|
-
return
|
|
2706
|
+
return _ref50.apply(this, arguments);
|
|
2617
2707
|
};
|
|
2618
2708
|
}());
|
|
2619
2709
|
jest.runAllTimers();
|
|
2620
2710
|
call.doHoldResume();
|
|
2621
|
-
|
|
2711
|
+
_context50.next = 9;
|
|
2622
2712
|
return (0, _testUtil.flushPromises)(2);
|
|
2623
2713
|
case 9:
|
|
2624
2714
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2631,11 +2721,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2631
2721
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2632
2722
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2633
2723
|
roapEvent.data.type = 'ANSWER';
|
|
2634
|
-
|
|
2724
|
+
_context50.next = 15;
|
|
2635
2725
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2636
2726
|
case 15:
|
|
2637
2727
|
roapEvent.data.type = 'OK';
|
|
2638
|
-
|
|
2728
|
+
_context50.next = 18;
|
|
2639
2729
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2640
2730
|
case 18:
|
|
2641
2731
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2647,14 +2737,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2647
2737
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2648
2738
|
case 21:
|
|
2649
2739
|
case "end":
|
|
2650
|
-
return
|
|
2740
|
+
return _context50.stop();
|
|
2651
2741
|
}
|
|
2652
|
-
},
|
|
2742
|
+
}, _callee50);
|
|
2653
2743
|
})));
|
|
2654
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2744
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2655
2745
|
var responsePayload, warnSpy, roapEvent;
|
|
2656
|
-
return _regenerator.default.wrap(function
|
|
2657
|
-
while (1) switch (
|
|
2746
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2747
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2658
2748
|
case 0:
|
|
2659
2749
|
expect.assertions(7);
|
|
2660
2750
|
responsePayload = {
|
|
@@ -2667,25 +2757,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2667
2757
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2668
2758
|
call['held'] = true;
|
|
2669
2759
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2670
|
-
var
|
|
2671
|
-
return _regenerator.default.wrap(function
|
|
2672
|
-
while (1) switch (
|
|
2760
|
+
var _ref52 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51(correlationId) {
|
|
2761
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2762
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2673
2763
|
case 0:
|
|
2674
2764
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2675
2765
|
case 1:
|
|
2676
2766
|
case "end":
|
|
2677
|
-
return
|
|
2767
|
+
return _context51.stop();
|
|
2678
2768
|
}
|
|
2679
|
-
},
|
|
2769
|
+
}, _callee51);
|
|
2680
2770
|
}));
|
|
2681
2771
|
return function (_x6) {
|
|
2682
|
-
return
|
|
2772
|
+
return _ref52.apply(this, arguments);
|
|
2683
2773
|
};
|
|
2684
2774
|
}());
|
|
2685
|
-
|
|
2775
|
+
_context52.next = 10;
|
|
2686
2776
|
return call.doHoldResume();
|
|
2687
2777
|
case 10:
|
|
2688
|
-
|
|
2778
|
+
_context52.next = 12;
|
|
2689
2779
|
return (0, _testUtil.flushPromises)(2);
|
|
2690
2780
|
case 12:
|
|
2691
2781
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2701,11 +2791,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2701
2791
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2702
2792
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2703
2793
|
roapEvent.data.type = 'ANSWER';
|
|
2704
|
-
|
|
2794
|
+
_context52.next = 20;
|
|
2705
2795
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2706
2796
|
case 20:
|
|
2707
2797
|
roapEvent.data.type = 'OK';
|
|
2708
|
-
|
|
2798
|
+
_context52.next = 23;
|
|
2709
2799
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2710
2800
|
case 23:
|
|
2711
2801
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2720,14 +2810,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2720
2810
|
});
|
|
2721
2811
|
case 28:
|
|
2722
2812
|
case "end":
|
|
2723
|
-
return
|
|
2813
|
+
return _context52.stop();
|
|
2724
2814
|
}
|
|
2725
|
-
},
|
|
2815
|
+
}, _callee52);
|
|
2726
2816
|
})));
|
|
2727
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2817
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2728
2818
|
var responsePayload, warnSpy, roapEvent;
|
|
2729
|
-
return _regenerator.default.wrap(function
|
|
2730
|
-
while (1) switch (
|
|
2819
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2820
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2731
2821
|
case 0:
|
|
2732
2822
|
expect.assertions(7);
|
|
2733
2823
|
responsePayload = {
|
|
@@ -2740,26 +2830,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2740
2830
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2741
2831
|
call['held'] = true;
|
|
2742
2832
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2743
|
-
var
|
|
2744
|
-
return _regenerator.default.wrap(function
|
|
2745
|
-
while (1) switch (
|
|
2833
|
+
var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(correlationId) {
|
|
2834
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2835
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2746
2836
|
case 0:
|
|
2747
2837
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2748
2838
|
case 1:
|
|
2749
2839
|
case "end":
|
|
2750
|
-
return
|
|
2840
|
+
return _context53.stop();
|
|
2751
2841
|
}
|
|
2752
|
-
},
|
|
2842
|
+
}, _callee53);
|
|
2753
2843
|
}));
|
|
2754
2844
|
return function (_x7) {
|
|
2755
|
-
return
|
|
2845
|
+
return _ref54.apply(this, arguments);
|
|
2756
2846
|
};
|
|
2757
2847
|
}());
|
|
2758
2848
|
call.doHoldResume();
|
|
2759
|
-
|
|
2849
|
+
_context54.next = 11;
|
|
2760
2850
|
return _promise.default.resolve();
|
|
2761
2851
|
case 11:
|
|
2762
|
-
|
|
2852
|
+
_context54.next = 13;
|
|
2763
2853
|
return _promise.default.resolve();
|
|
2764
2854
|
case 13:
|
|
2765
2855
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2775,11 +2865,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2775
2865
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2776
2866
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2777
2867
|
roapEvent.data.type = 'ANSWER';
|
|
2778
|
-
|
|
2868
|
+
_context54.next = 21;
|
|
2779
2869
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2780
2870
|
case 21:
|
|
2781
2871
|
roapEvent.data.type = 'OK';
|
|
2782
|
-
|
|
2872
|
+
_context54.next = 24;
|
|
2783
2873
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2784
2874
|
case 24:
|
|
2785
2875
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2794,14 +2884,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2794
2884
|
});
|
|
2795
2885
|
case 29:
|
|
2796
2886
|
case "end":
|
|
2797
|
-
return
|
|
2887
|
+
return _context54.stop();
|
|
2798
2888
|
}
|
|
2799
|
-
},
|
|
2889
|
+
}, _callee54);
|
|
2800
2890
|
})));
|
|
2801
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2891
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
2802
2892
|
var responsePayload;
|
|
2803
|
-
return _regenerator.default.wrap(function
|
|
2804
|
-
while (1) switch (
|
|
2893
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2894
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2805
2895
|
case 0:
|
|
2806
2896
|
expect.assertions(4);
|
|
2807
2897
|
responsePayload = {
|
|
@@ -2811,26 +2901,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2811
2901
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2812
2902
|
call['held'] = true;
|
|
2813
2903
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2814
|
-
var
|
|
2815
|
-
return _regenerator.default.wrap(function
|
|
2816
|
-
while (1) switch (
|
|
2904
|
+
var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(errObj) {
|
|
2905
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2906
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2817
2907
|
case 0:
|
|
2818
2908
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2819
2909
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2820
2910
|
case 2:
|
|
2821
2911
|
case "end":
|
|
2822
|
-
return
|
|
2912
|
+
return _context55.stop();
|
|
2823
2913
|
}
|
|
2824
|
-
},
|
|
2914
|
+
}, _callee55);
|
|
2825
2915
|
}));
|
|
2826
2916
|
return function (_x8) {
|
|
2827
|
-
return
|
|
2917
|
+
return _ref56.apply(this, arguments);
|
|
2828
2918
|
};
|
|
2829
2919
|
}());
|
|
2830
|
-
|
|
2920
|
+
_context56.next = 7;
|
|
2831
2921
|
return call.doHoldResume();
|
|
2832
2922
|
case 7:
|
|
2833
|
-
|
|
2923
|
+
_context56.next = 9;
|
|
2834
2924
|
return (0, _testUtil.flushPromises)(2);
|
|
2835
2925
|
case 9:
|
|
2836
2926
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2841,14 +2931,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2841
2931
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2842
2932
|
case 11:
|
|
2843
2933
|
case "end":
|
|
2844
|
-
return
|
|
2934
|
+
return _context56.stop();
|
|
2845
2935
|
}
|
|
2846
|
-
},
|
|
2936
|
+
}, _callee56);
|
|
2847
2937
|
})));
|
|
2848
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2938
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2849
2939
|
var responsePayload, rejectPayload, roapEvent;
|
|
2850
|
-
return _regenerator.default.wrap(function
|
|
2851
|
-
while (1) switch (
|
|
2940
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2941
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2852
2942
|
case 0:
|
|
2853
2943
|
expect.assertions(5);
|
|
2854
2944
|
responsePayload = {
|
|
@@ -2862,24 +2952,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2862
2952
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2863
2953
|
call['held'] = true;
|
|
2864
2954
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2865
|
-
var
|
|
2866
|
-
return _regenerator.default.wrap(function
|
|
2867
|
-
while (1) switch (
|
|
2955
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(errObj) {
|
|
2956
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2957
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2868
2958
|
case 0:
|
|
2869
2959
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2870
2960
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2871
2961
|
case 2:
|
|
2872
2962
|
case "end":
|
|
2873
|
-
return
|
|
2963
|
+
return _context57.stop();
|
|
2874
2964
|
}
|
|
2875
|
-
},
|
|
2965
|
+
}, _callee57);
|
|
2876
2966
|
}));
|
|
2877
2967
|
return function (_x9) {
|
|
2878
|
-
return
|
|
2968
|
+
return _ref58.apply(this, arguments);
|
|
2879
2969
|
};
|
|
2880
2970
|
}());
|
|
2881
2971
|
call.doHoldResume();
|
|
2882
|
-
|
|
2972
|
+
_context58.next = 9;
|
|
2883
2973
|
return (0, _testUtil.flushPromises)(2);
|
|
2884
2974
|
case 9:
|
|
2885
2975
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2890,7 +2980,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2890
2980
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2891
2981
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2892
2982
|
roapEvent.data.type = 'ANSWER';
|
|
2893
|
-
|
|
2983
|
+
_context58.next = 15;
|
|
2894
2984
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2895
2985
|
case 15:
|
|
2896
2986
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2898,14 +2988,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2898
2988
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2899
2989
|
case 17:
|
|
2900
2990
|
case "end":
|
|
2901
|
-
return
|
|
2991
|
+
return _context58.stop();
|
|
2902
2992
|
}
|
|
2903
|
-
},
|
|
2993
|
+
}, _callee58);
|
|
2904
2994
|
})));
|
|
2905
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2995
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
2906
2996
|
var responsePayload, roapEvent;
|
|
2907
|
-
return _regenerator.default.wrap(function
|
|
2908
|
-
while (1) switch (
|
|
2997
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
2998
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2909
2999
|
case 0:
|
|
2910
3000
|
expect.assertions(5);
|
|
2911
3001
|
responsePayload = {
|
|
@@ -2915,24 +3005,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2915
3005
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2916
3006
|
call['held'] = true;
|
|
2917
3007
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2918
|
-
var
|
|
2919
|
-
return _regenerator.default.wrap(function
|
|
2920
|
-
while (1) switch (
|
|
3008
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(errObj) {
|
|
3009
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
3010
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2921
3011
|
case 0:
|
|
2922
3012
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2923
3013
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2924
3014
|
case 2:
|
|
2925
3015
|
case "end":
|
|
2926
|
-
return
|
|
3016
|
+
return _context59.stop();
|
|
2927
3017
|
}
|
|
2928
|
-
},
|
|
3018
|
+
}, _callee59);
|
|
2929
3019
|
}));
|
|
2930
3020
|
return function (_x0) {
|
|
2931
|
-
return
|
|
3021
|
+
return _ref60.apply(this, arguments);
|
|
2932
3022
|
};
|
|
2933
3023
|
}());
|
|
2934
3024
|
call.doHoldResume();
|
|
2935
|
-
|
|
3025
|
+
_context60.next = 8;
|
|
2936
3026
|
return (0, _testUtil.flushPromises)(2);
|
|
2937
3027
|
case 8:
|
|
2938
3028
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2945,11 +3035,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2945
3035
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2946
3036
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2947
3037
|
roapEvent.data.type = 'ANSWER';
|
|
2948
|
-
|
|
3038
|
+
_context60.next = 14;
|
|
2949
3039
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2950
3040
|
case 14:
|
|
2951
3041
|
roapEvent.data.type = 'OK';
|
|
2952
|
-
|
|
3042
|
+
_context60.next = 17;
|
|
2953
3043
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2954
3044
|
case 17:
|
|
2955
3045
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2959,9 +3049,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2959
3049
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2960
3050
|
case 20:
|
|
2961
3051
|
case "end":
|
|
2962
|
-
return
|
|
3052
|
+
return _context60.stop();
|
|
2963
3053
|
}
|
|
2964
|
-
},
|
|
3054
|
+
}, _callee60);
|
|
2965
3055
|
})));
|
|
2966
3056
|
});
|
|
2967
3057
|
describe('Call transfer tests', function () {
|
|
@@ -2994,10 +3084,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2994
3084
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2995
3085
|
secondCall['held'] = false;
|
|
2996
3086
|
});
|
|
2997
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3087
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
2998
3088
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2999
|
-
return _regenerator.default.wrap(function
|
|
3000
|
-
while (1) switch (
|
|
3089
|
+
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
3090
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3001
3091
|
case 0:
|
|
3002
3092
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3003
3093
|
responsePayload = {
|
|
@@ -3009,41 +3099,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3009
3099
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3010
3100
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3011
3101
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3012
|
-
var
|
|
3013
|
-
return _regenerator.default.wrap(function
|
|
3014
|
-
while (1) switch (
|
|
3102
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
|
|
3103
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
3104
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3015
3105
|
case 0:
|
|
3016
3106
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3017
3107
|
case 1:
|
|
3018
3108
|
case "end":
|
|
3019
|
-
return
|
|
3109
|
+
return _context61.stop();
|
|
3020
3110
|
}
|
|
3021
|
-
},
|
|
3111
|
+
}, _callee61);
|
|
3022
3112
|
}));
|
|
3023
3113
|
return function (_x1) {
|
|
3024
|
-
return
|
|
3114
|
+
return _ref62.apply(this, arguments);
|
|
3025
3115
|
};
|
|
3026
3116
|
}());
|
|
3027
3117
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3028
|
-
var
|
|
3029
|
-
return _regenerator.default.wrap(function
|
|
3030
|
-
while (1) switch (
|
|
3118
|
+
var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(correlationId) {
|
|
3119
|
+
return _regenerator.default.wrap(function _callee62$(_context62) {
|
|
3120
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3031
3121
|
case 0:
|
|
3032
3122
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3033
3123
|
case 1:
|
|
3034
3124
|
case "end":
|
|
3035
|
-
return
|
|
3125
|
+
return _context62.stop();
|
|
3036
3126
|
}
|
|
3037
|
-
},
|
|
3127
|
+
}, _callee62);
|
|
3038
3128
|
}));
|
|
3039
3129
|
return function (_x10) {
|
|
3040
|
-
return
|
|
3130
|
+
return _ref63.apply(this, arguments);
|
|
3041
3131
|
};
|
|
3042
3132
|
}());
|
|
3043
|
-
|
|
3133
|
+
_context63.next = 10;
|
|
3044
3134
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3045
3135
|
case 10:
|
|
3046
|
-
|
|
3136
|
+
_context63.next = 12;
|
|
3047
3137
|
return (0, _testUtil.flushPromises)(2);
|
|
3048
3138
|
case 12:
|
|
3049
3139
|
expect(requestSpy).toBeCalled();
|
|
@@ -3066,14 +3156,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3066
3156
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3067
3157
|
case 24:
|
|
3068
3158
|
case "end":
|
|
3069
|
-
return
|
|
3159
|
+
return _context63.stop();
|
|
3070
3160
|
}
|
|
3071
|
-
},
|
|
3161
|
+
}, _callee63);
|
|
3072
3162
|
})));
|
|
3073
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3163
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
|
|
3074
3164
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3075
|
-
return _regenerator.default.wrap(function
|
|
3076
|
-
while (1) switch (
|
|
3165
|
+
return _regenerator.default.wrap(function _callee65$(_context65) {
|
|
3166
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3077
3167
|
case 0:
|
|
3078
3168
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3079
3169
|
responsePayload = {
|
|
@@ -3085,25 +3175,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3085
3175
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3086
3176
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3087
3177
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3088
|
-
var
|
|
3089
|
-
return _regenerator.default.wrap(function
|
|
3090
|
-
while (1) switch (
|
|
3178
|
+
var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(correlationId) {
|
|
3179
|
+
return _regenerator.default.wrap(function _callee64$(_context64) {
|
|
3180
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3091
3181
|
case 0:
|
|
3092
3182
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3093
3183
|
case 1:
|
|
3094
3184
|
case "end":
|
|
3095
|
-
return
|
|
3185
|
+
return _context64.stop();
|
|
3096
3186
|
}
|
|
3097
|
-
},
|
|
3187
|
+
}, _callee64);
|
|
3098
3188
|
}));
|
|
3099
3189
|
return function (_x11) {
|
|
3100
|
-
return
|
|
3190
|
+
return _ref65.apply(this, arguments);
|
|
3101
3191
|
};
|
|
3102
3192
|
}());
|
|
3103
|
-
|
|
3193
|
+
_context65.next = 9;
|
|
3104
3194
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3105
3195
|
case 9:
|
|
3106
|
-
|
|
3196
|
+
_context65.next = 11;
|
|
3107
3197
|
return (0, _testUtil.flushPromises)(2);
|
|
3108
3198
|
case 11:
|
|
3109
3199
|
expect(requestSpy).toBeCalled();
|
|
@@ -3122,14 +3212,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3122
3212
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3123
3213
|
case 21:
|
|
3124
3214
|
case "end":
|
|
3125
|
-
return
|
|
3215
|
+
return _context65.stop();
|
|
3126
3216
|
}
|
|
3127
|
-
},
|
|
3217
|
+
}, _callee65);
|
|
3128
3218
|
})));
|
|
3129
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3219
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
|
|
3130
3220
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3131
|
-
return _regenerator.default.wrap(function
|
|
3132
|
-
while (1) switch (
|
|
3221
|
+
return _regenerator.default.wrap(function _callee66$(_context66) {
|
|
3222
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3133
3223
|
case 0:
|
|
3134
3224
|
responsePayload = {
|
|
3135
3225
|
statusCode: 403,
|
|
@@ -3140,10 +3230,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3140
3230
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3141
3231
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3142
3232
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3143
|
-
|
|
3233
|
+
_context66.next = 8;
|
|
3144
3234
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3145
3235
|
case 8:
|
|
3146
|
-
|
|
3236
|
+
_context66.next = 10;
|
|
3147
3237
|
return (0, _testUtil.flushPromises)(1);
|
|
3148
3238
|
case 10:
|
|
3149
3239
|
expect(requestSpy).toBeCalled();
|
|
@@ -3164,14 +3254,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3164
3254
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3165
3255
|
case 18:
|
|
3166
3256
|
case "end":
|
|
3167
|
-
return
|
|
3257
|
+
return _context66.stop();
|
|
3168
3258
|
}
|
|
3169
|
-
},
|
|
3259
|
+
}, _callee66);
|
|
3170
3260
|
})));
|
|
3171
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3261
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3172
3262
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3173
|
-
return _regenerator.default.wrap(function
|
|
3174
|
-
while (1) switch (
|
|
3263
|
+
return _regenerator.default.wrap(function _callee67$(_context67) {
|
|
3264
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3175
3265
|
case 0:
|
|
3176
3266
|
responsePayload = {
|
|
3177
3267
|
statusCode: 403,
|
|
@@ -3181,10 +3271,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3181
3271
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3182
3272
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3183
3273
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3184
|
-
|
|
3274
|
+
_context67.next = 7;
|
|
3185
3275
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3186
3276
|
case 7:
|
|
3187
|
-
|
|
3277
|
+
_context67.next = 9;
|
|
3188
3278
|
return (0, _testUtil.flushPromises)(2);
|
|
3189
3279
|
case 9:
|
|
3190
3280
|
expect(requestSpy).toBeCalled();
|
|
@@ -3205,18 +3295,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3205
3295
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3206
3296
|
case 18:
|
|
3207
3297
|
case "end":
|
|
3208
|
-
return
|
|
3298
|
+
return _context67.stop();
|
|
3209
3299
|
}
|
|
3210
|
-
},
|
|
3300
|
+
}, _callee67);
|
|
3211
3301
|
})));
|
|
3212
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3302
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
|
|
3213
3303
|
var requestSpy, warnSpy;
|
|
3214
|
-
return _regenerator.default.wrap(function
|
|
3215
|
-
while (1) switch (
|
|
3304
|
+
return _regenerator.default.wrap(function _callee68$(_context68) {
|
|
3305
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3216
3306
|
case 0:
|
|
3217
3307
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3218
3308
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3219
|
-
|
|
3309
|
+
_context68.next = 4;
|
|
3220
3310
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3221
3311
|
case 4:
|
|
3222
3312
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3228,18 +3318,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3228
3318
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3229
3319
|
case 10:
|
|
3230
3320
|
case "end":
|
|
3231
|
-
return
|
|
3321
|
+
return _context68.stop();
|
|
3232
3322
|
}
|
|
3233
|
-
},
|
|
3323
|
+
}, _callee68);
|
|
3234
3324
|
})));
|
|
3235
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3325
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
|
|
3236
3326
|
var requestSpy, warnSpy;
|
|
3237
|
-
return _regenerator.default.wrap(function
|
|
3238
|
-
while (1) switch (
|
|
3327
|
+
return _regenerator.default.wrap(function _callee69$(_context69) {
|
|
3328
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3239
3329
|
case 0:
|
|
3240
3330
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3241
3331
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3242
|
-
|
|
3332
|
+
_context69.next = 4;
|
|
3243
3333
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3244
3334
|
case 4:
|
|
3245
3335
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3251,9 +3341,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3251
3341
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3252
3342
|
case 10:
|
|
3253
3343
|
case "end":
|
|
3254
|
-
return
|
|
3344
|
+
return _context69.stop();
|
|
3255
3345
|
}
|
|
3256
|
-
},
|
|
3346
|
+
}, _callee69);
|
|
3257
3347
|
})));
|
|
3258
3348
|
});
|
|
3259
3349
|
});
|