@webex/calling 3.10.0-next.9 → 3.10.0-wxc-disconnect.1

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