@webex/calling 3.10.0-next.8 → 3.10.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallingClient/calling/call.js +13 -13
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +253 -229
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/module/CallingClient/calling/call.js +4 -4
- package/package.json +1 -1
|
@@ -2117,6 +2117,30 @@ describe('State Machine handler tests', function () {
|
|
|
2117
2117
|
}
|
|
2118
2118
|
}, _callee35);
|
|
2119
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);
|
|
2143
|
+
})));
|
|
2120
2144
|
describe('Call event timers tests', function () {
|
|
2121
2145
|
var callManager;
|
|
2122
2146
|
beforeEach(function () {
|
|
@@ -2126,10 +2150,10 @@ describe('State Machine handler tests', function () {
|
|
|
2126
2150
|
afterEach(function () {
|
|
2127
2151
|
jest.clearAllTimers();
|
|
2128
2152
|
});
|
|
2129
|
-
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() {
|
|
2130
2154
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2131
|
-
return _regenerator.default.wrap(function
|
|
2132
|
-
while (1) switch (
|
|
2155
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
2156
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2133
2157
|
case 0:
|
|
2134
2158
|
statusPayload = {
|
|
2135
2159
|
statusCode: 200,
|
|
@@ -2146,7 +2170,7 @@ describe('State Machine handler tests', function () {
|
|
|
2146
2170
|
webex.request.mockReturnValue(statusPayload);
|
|
2147
2171
|
|
|
2148
2172
|
// handleOutgoingCallSetup is asynchronous
|
|
2149
|
-
|
|
2173
|
+
_context37.next = 9;
|
|
2150
2174
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2151
2175
|
case 9:
|
|
2152
2176
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2189,14 +2213,14 @@ describe('State Machine handler tests', function () {
|
|
|
2189
2213
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2190
2214
|
case 32:
|
|
2191
2215
|
case "end":
|
|
2192
|
-
return
|
|
2216
|
+
return _context37.stop();
|
|
2193
2217
|
}
|
|
2194
|
-
},
|
|
2218
|
+
}, _callee37);
|
|
2195
2219
|
})));
|
|
2196
|
-
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() {
|
|
2197
2221
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2198
|
-
return _regenerator.default.wrap(function
|
|
2199
|
-
while (1) switch (
|
|
2222
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
2223
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2200
2224
|
case 0:
|
|
2201
2225
|
statusPayload = {
|
|
2202
2226
|
statusCode: 200,
|
|
@@ -2215,7 +2239,7 @@ describe('State Machine handler tests', function () {
|
|
|
2215
2239
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2216
2240
|
|
|
2217
2241
|
// handleOutgoingCallSetup is asynchronous
|
|
2218
|
-
|
|
2242
|
+
_context38.next = 11;
|
|
2219
2243
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2220
2244
|
case 11:
|
|
2221
2245
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2227,9 +2251,9 @@ describe('State Machine handler tests', function () {
|
|
|
2227
2251
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2228
2252
|
case 18:
|
|
2229
2253
|
case "end":
|
|
2230
|
-
return
|
|
2254
|
+
return _context38.stop();
|
|
2231
2255
|
}
|
|
2232
|
-
},
|
|
2256
|
+
}, _callee38);
|
|
2233
2257
|
})));
|
|
2234
2258
|
});
|
|
2235
2259
|
});
|
|
@@ -2289,10 +2313,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2289
2313
|
beforeEach(function () {
|
|
2290
2314
|
call.removeAllListeners();
|
|
2291
2315
|
});
|
|
2292
|
-
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() {
|
|
2293
2317
|
var responsePayload, warnSpy, roapEvent;
|
|
2294
|
-
return _regenerator.default.wrap(function
|
|
2295
|
-
while (1) switch (
|
|
2318
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
2319
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2296
2320
|
case 0:
|
|
2297
2321
|
expect.assertions(7);
|
|
2298
2322
|
responsePayload = {
|
|
@@ -2305,25 +2329,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2305
2329
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2306
2330
|
call['held'] = false;
|
|
2307
2331
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2308
|
-
var
|
|
2309
|
-
return _regenerator.default.wrap(function
|
|
2310
|
-
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) {
|
|
2311
2335
|
case 0:
|
|
2312
2336
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2313
2337
|
case 1:
|
|
2314
2338
|
case "end":
|
|
2315
|
-
return
|
|
2339
|
+
return _context39.stop();
|
|
2316
2340
|
}
|
|
2317
|
-
},
|
|
2341
|
+
}, _callee39);
|
|
2318
2342
|
}));
|
|
2319
2343
|
return function (_x) {
|
|
2320
|
-
return
|
|
2344
|
+
return _ref40.apply(this, arguments);
|
|
2321
2345
|
};
|
|
2322
2346
|
}());
|
|
2323
|
-
|
|
2347
|
+
_context40.next = 10;
|
|
2324
2348
|
return call.doHoldResume();
|
|
2325
2349
|
case 10:
|
|
2326
|
-
|
|
2350
|
+
_context40.next = 12;
|
|
2327
2351
|
return (0, _testUtil.flushPromises)(2);
|
|
2328
2352
|
case 12:
|
|
2329
2353
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2339,11 +2363,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2339
2363
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2340
2364
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2341
2365
|
roapEvent.data.type = 'ANSWER';
|
|
2342
|
-
|
|
2366
|
+
_context40.next = 20;
|
|
2343
2367
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2344
2368
|
case 20:
|
|
2345
2369
|
roapEvent.data.type = 'OK';
|
|
2346
|
-
|
|
2370
|
+
_context40.next = 23;
|
|
2347
2371
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2348
2372
|
case 23:
|
|
2349
2373
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2358,14 +2382,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2358
2382
|
});
|
|
2359
2383
|
case 28:
|
|
2360
2384
|
case "end":
|
|
2361
|
-
return
|
|
2385
|
+
return _context40.stop();
|
|
2362
2386
|
}
|
|
2363
|
-
},
|
|
2387
|
+
}, _callee40);
|
|
2364
2388
|
})));
|
|
2365
|
-
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() {
|
|
2366
2390
|
var responsePayload, warnSpy, roapEvent;
|
|
2367
|
-
return _regenerator.default.wrap(function
|
|
2368
|
-
while (1) switch (
|
|
2391
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2392
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2369
2393
|
case 0:
|
|
2370
2394
|
expect.assertions(8);
|
|
2371
2395
|
responsePayload = {
|
|
@@ -2378,26 +2402,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2378
2402
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2379
2403
|
call['held'] = false;
|
|
2380
2404
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2381
|
-
var
|
|
2382
|
-
return _regenerator.default.wrap(function
|
|
2383
|
-
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) {
|
|
2384
2408
|
case 0:
|
|
2385
2409
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2386
2410
|
case 1:
|
|
2387
2411
|
case "end":
|
|
2388
|
-
return
|
|
2412
|
+
return _context41.stop();
|
|
2389
2413
|
}
|
|
2390
|
-
},
|
|
2414
|
+
}, _callee41);
|
|
2391
2415
|
}));
|
|
2392
2416
|
return function (_x2) {
|
|
2393
|
-
return
|
|
2417
|
+
return _ref42.apply(this, arguments);
|
|
2394
2418
|
};
|
|
2395
2419
|
}());
|
|
2396
2420
|
call.doHoldResume();
|
|
2397
|
-
|
|
2421
|
+
_context42.next = 11;
|
|
2398
2422
|
return _promise.default.resolve();
|
|
2399
2423
|
case 11:
|
|
2400
|
-
|
|
2424
|
+
_context42.next = 13;
|
|
2401
2425
|
return _promise.default.resolve();
|
|
2402
2426
|
case 13:
|
|
2403
2427
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2413,11 +2437,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2413
2437
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2414
2438
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2415
2439
|
roapEvent.data.type = 'ANSWER';
|
|
2416
|
-
|
|
2440
|
+
_context42.next = 22;
|
|
2417
2441
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2418
2442
|
case 22:
|
|
2419
2443
|
roapEvent.data.type = 'OK';
|
|
2420
|
-
|
|
2444
|
+
_context42.next = 25;
|
|
2421
2445
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2422
2446
|
case 25:
|
|
2423
2447
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2432,14 +2456,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2432
2456
|
});
|
|
2433
2457
|
case 30:
|
|
2434
2458
|
case "end":
|
|
2435
|
-
return
|
|
2459
|
+
return _context42.stop();
|
|
2436
2460
|
}
|
|
2437
|
-
},
|
|
2461
|
+
}, _callee42);
|
|
2438
2462
|
})));
|
|
2439
|
-
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() {
|
|
2440
2464
|
var responsePayload;
|
|
2441
|
-
return _regenerator.default.wrap(function
|
|
2442
|
-
while (1) switch (
|
|
2465
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2466
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2443
2467
|
case 0:
|
|
2444
2468
|
expect.assertions(4);
|
|
2445
2469
|
responsePayload = {
|
|
@@ -2449,26 +2473,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2449
2473
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2450
2474
|
call['held'] = false;
|
|
2451
2475
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2452
|
-
var
|
|
2453
|
-
return _regenerator.default.wrap(function
|
|
2454
|
-
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) {
|
|
2455
2479
|
case 0:
|
|
2456
2480
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2457
2481
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2458
2482
|
case 2:
|
|
2459
2483
|
case "end":
|
|
2460
|
-
return
|
|
2484
|
+
return _context43.stop();
|
|
2461
2485
|
}
|
|
2462
|
-
},
|
|
2486
|
+
}, _callee43);
|
|
2463
2487
|
}));
|
|
2464
2488
|
return function (_x3) {
|
|
2465
|
-
return
|
|
2489
|
+
return _ref44.apply(this, arguments);
|
|
2466
2490
|
};
|
|
2467
2491
|
}());
|
|
2468
|
-
|
|
2492
|
+
_context44.next = 7;
|
|
2469
2493
|
return call.doHoldResume();
|
|
2470
2494
|
case 7:
|
|
2471
|
-
|
|
2495
|
+
_context44.next = 9;
|
|
2472
2496
|
return (0, _testUtil.flushPromises)(2);
|
|
2473
2497
|
case 9:
|
|
2474
2498
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2478,14 +2502,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2478
2502
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2479
2503
|
case 11:
|
|
2480
2504
|
case "end":
|
|
2481
|
-
return
|
|
2505
|
+
return _context44.stop();
|
|
2482
2506
|
}
|
|
2483
|
-
},
|
|
2507
|
+
}, _callee44);
|
|
2484
2508
|
})));
|
|
2485
|
-
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() {
|
|
2486
2510
|
var responsePayload, rejectPayload, roapEvent;
|
|
2487
|
-
return _regenerator.default.wrap(function
|
|
2488
|
-
while (1) switch (
|
|
2511
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2512
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2489
2513
|
case 0:
|
|
2490
2514
|
expect.assertions(5);
|
|
2491
2515
|
responsePayload = {
|
|
@@ -2499,24 +2523,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2499
2523
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2500
2524
|
call['held'] = false;
|
|
2501
2525
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2502
|
-
var
|
|
2503
|
-
return _regenerator.default.wrap(function
|
|
2504
|
-
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) {
|
|
2505
2529
|
case 0:
|
|
2506
2530
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2507
2531
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2508
2532
|
case 2:
|
|
2509
2533
|
case "end":
|
|
2510
|
-
return
|
|
2534
|
+
return _context45.stop();
|
|
2511
2535
|
}
|
|
2512
|
-
},
|
|
2536
|
+
}, _callee45);
|
|
2513
2537
|
}));
|
|
2514
2538
|
return function (_x4) {
|
|
2515
|
-
return
|
|
2539
|
+
return _ref46.apply(this, arguments);
|
|
2516
2540
|
};
|
|
2517
2541
|
}());
|
|
2518
2542
|
call.doHoldResume();
|
|
2519
|
-
|
|
2543
|
+
_context46.next = 9;
|
|
2520
2544
|
return (0, _testUtil.flushPromises)(2);
|
|
2521
2545
|
case 9:
|
|
2522
2546
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2526,7 +2550,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2526
2550
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2527
2551
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2528
2552
|
roapEvent.data.type = 'ANSWER';
|
|
2529
|
-
|
|
2553
|
+
_context46.next = 15;
|
|
2530
2554
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2531
2555
|
case 15:
|
|
2532
2556
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2534,14 +2558,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2534
2558
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2535
2559
|
case 17:
|
|
2536
2560
|
case "end":
|
|
2537
|
-
return
|
|
2561
|
+
return _context46.stop();
|
|
2538
2562
|
}
|
|
2539
|
-
},
|
|
2563
|
+
}, _callee46);
|
|
2540
2564
|
})));
|
|
2541
|
-
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() {
|
|
2542
2566
|
var responsePayload, warnSpy, roapEvent;
|
|
2543
|
-
return _regenerator.default.wrap(function
|
|
2544
|
-
while (1) switch (
|
|
2567
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2568
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2545
2569
|
case 0:
|
|
2546
2570
|
responsePayload = {
|
|
2547
2571
|
statusCode: 200,
|
|
@@ -2552,10 +2576,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2552
2576
|
jest.spyOn(global, 'clearTimeout');
|
|
2553
2577
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2554
2578
|
call['held'] = false;
|
|
2555
|
-
|
|
2579
|
+
_context47.next = 8;
|
|
2556
2580
|
return call.doHoldResume();
|
|
2557
2581
|
case 8:
|
|
2558
|
-
|
|
2582
|
+
_context47.next = 10;
|
|
2559
2583
|
return (0, _testUtil.flushPromises)(2);
|
|
2560
2584
|
case 10:
|
|
2561
2585
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2570,19 +2594,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2570
2594
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2571
2595
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2572
2596
|
roapEvent.data.type = 'ANSWER';
|
|
2573
|
-
|
|
2597
|
+
_context47.next = 17;
|
|
2574
2598
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2575
2599
|
case 17:
|
|
2576
2600
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2577
2601
|
statusCode: 403
|
|
2578
2602
|
});
|
|
2579
2603
|
roapEvent.data.type = 'OK';
|
|
2580
|
-
|
|
2604
|
+
_context47.next = 21;
|
|
2581
2605
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2582
2606
|
case 21:
|
|
2583
2607
|
/* this is for coverage */
|
|
2584
2608
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2585
|
-
|
|
2609
|
+
_context47.next = 24;
|
|
2586
2610
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2587
2611
|
case 24:
|
|
2588
2612
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2594,14 +2618,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2594
2618
|
});
|
|
2595
2619
|
case 27:
|
|
2596
2620
|
case "end":
|
|
2597
|
-
return
|
|
2621
|
+
return _context47.stop();
|
|
2598
2622
|
}
|
|
2599
|
-
},
|
|
2623
|
+
}, _callee47);
|
|
2600
2624
|
})));
|
|
2601
|
-
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() {
|
|
2602
2626
|
var responsePayload, warnSpy, roapEvent;
|
|
2603
|
-
return _regenerator.default.wrap(function
|
|
2604
|
-
while (1) switch (
|
|
2627
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2628
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2605
2629
|
case 0:
|
|
2606
2630
|
responsePayload = {
|
|
2607
2631
|
statusCode: 200,
|
|
@@ -2612,10 +2636,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2612
2636
|
jest.spyOn(global, 'clearTimeout');
|
|
2613
2637
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2614
2638
|
call['held'] = true;
|
|
2615
|
-
|
|
2639
|
+
_context48.next = 8;
|
|
2616
2640
|
return call.doHoldResume();
|
|
2617
2641
|
case 8:
|
|
2618
|
-
|
|
2642
|
+
_context48.next = 10;
|
|
2619
2643
|
return (0, _testUtil.flushPromises)(2);
|
|
2620
2644
|
case 10:
|
|
2621
2645
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2630,14 +2654,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2630
2654
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2631
2655
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2632
2656
|
roapEvent.data.type = 'ANSWER';
|
|
2633
|
-
|
|
2657
|
+
_context48.next = 17;
|
|
2634
2658
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2635
2659
|
case 17:
|
|
2636
2660
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2637
2661
|
statusCode: 403
|
|
2638
2662
|
});
|
|
2639
2663
|
roapEvent.data.type = 'OK';
|
|
2640
|
-
|
|
2664
|
+
_context48.next = 21;
|
|
2641
2665
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2642
2666
|
case 21:
|
|
2643
2667
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2649,14 +2673,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2649
2673
|
});
|
|
2650
2674
|
case 24:
|
|
2651
2675
|
case "end":
|
|
2652
|
-
return
|
|
2676
|
+
return _context48.stop();
|
|
2653
2677
|
}
|
|
2654
|
-
},
|
|
2678
|
+
}, _callee48);
|
|
2655
2679
|
})));
|
|
2656
|
-
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() {
|
|
2657
2681
|
var responsePayload, roapEvent;
|
|
2658
|
-
return _regenerator.default.wrap(function
|
|
2659
|
-
while (1) switch (
|
|
2682
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2683
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2660
2684
|
case 0:
|
|
2661
2685
|
expect.assertions(5);
|
|
2662
2686
|
responsePayload = {
|
|
@@ -2666,25 +2690,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2666
2690
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2667
2691
|
call['held'] = false;
|
|
2668
2692
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2669
|
-
var
|
|
2670
|
-
return _regenerator.default.wrap(function
|
|
2671
|
-
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) {
|
|
2672
2696
|
case 0:
|
|
2673
2697
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2674
2698
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2675
2699
|
case 2:
|
|
2676
2700
|
case "end":
|
|
2677
|
-
return
|
|
2701
|
+
return _context49.stop();
|
|
2678
2702
|
}
|
|
2679
|
-
},
|
|
2703
|
+
}, _callee49);
|
|
2680
2704
|
}));
|
|
2681
2705
|
return function (_x5) {
|
|
2682
|
-
return
|
|
2706
|
+
return _ref50.apply(this, arguments);
|
|
2683
2707
|
};
|
|
2684
2708
|
}());
|
|
2685
2709
|
jest.runAllTimers();
|
|
2686
2710
|
call.doHoldResume();
|
|
2687
|
-
|
|
2711
|
+
_context50.next = 9;
|
|
2688
2712
|
return (0, _testUtil.flushPromises)(2);
|
|
2689
2713
|
case 9:
|
|
2690
2714
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2697,11 +2721,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2697
2721
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2698
2722
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2699
2723
|
roapEvent.data.type = 'ANSWER';
|
|
2700
|
-
|
|
2724
|
+
_context50.next = 15;
|
|
2701
2725
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2702
2726
|
case 15:
|
|
2703
2727
|
roapEvent.data.type = 'OK';
|
|
2704
|
-
|
|
2728
|
+
_context50.next = 18;
|
|
2705
2729
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2706
2730
|
case 18:
|
|
2707
2731
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2713,14 +2737,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2713
2737
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2714
2738
|
case 21:
|
|
2715
2739
|
case "end":
|
|
2716
|
-
return
|
|
2740
|
+
return _context50.stop();
|
|
2717
2741
|
}
|
|
2718
|
-
},
|
|
2742
|
+
}, _callee50);
|
|
2719
2743
|
})));
|
|
2720
|
-
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() {
|
|
2721
2745
|
var responsePayload, warnSpy, roapEvent;
|
|
2722
|
-
return _regenerator.default.wrap(function
|
|
2723
|
-
while (1) switch (
|
|
2746
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2747
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2724
2748
|
case 0:
|
|
2725
2749
|
expect.assertions(7);
|
|
2726
2750
|
responsePayload = {
|
|
@@ -2733,25 +2757,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2733
2757
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2734
2758
|
call['held'] = true;
|
|
2735
2759
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2736
|
-
var
|
|
2737
|
-
return _regenerator.default.wrap(function
|
|
2738
|
-
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) {
|
|
2739
2763
|
case 0:
|
|
2740
2764
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2741
2765
|
case 1:
|
|
2742
2766
|
case "end":
|
|
2743
|
-
return
|
|
2767
|
+
return _context51.stop();
|
|
2744
2768
|
}
|
|
2745
|
-
},
|
|
2769
|
+
}, _callee51);
|
|
2746
2770
|
}));
|
|
2747
2771
|
return function (_x6) {
|
|
2748
|
-
return
|
|
2772
|
+
return _ref52.apply(this, arguments);
|
|
2749
2773
|
};
|
|
2750
2774
|
}());
|
|
2751
|
-
|
|
2775
|
+
_context52.next = 10;
|
|
2752
2776
|
return call.doHoldResume();
|
|
2753
2777
|
case 10:
|
|
2754
|
-
|
|
2778
|
+
_context52.next = 12;
|
|
2755
2779
|
return (0, _testUtil.flushPromises)(2);
|
|
2756
2780
|
case 12:
|
|
2757
2781
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2767,11 +2791,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2767
2791
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2768
2792
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2769
2793
|
roapEvent.data.type = 'ANSWER';
|
|
2770
|
-
|
|
2794
|
+
_context52.next = 20;
|
|
2771
2795
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2772
2796
|
case 20:
|
|
2773
2797
|
roapEvent.data.type = 'OK';
|
|
2774
|
-
|
|
2798
|
+
_context52.next = 23;
|
|
2775
2799
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2776
2800
|
case 23:
|
|
2777
2801
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2786,14 +2810,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2786
2810
|
});
|
|
2787
2811
|
case 28:
|
|
2788
2812
|
case "end":
|
|
2789
|
-
return
|
|
2813
|
+
return _context52.stop();
|
|
2790
2814
|
}
|
|
2791
|
-
},
|
|
2815
|
+
}, _callee52);
|
|
2792
2816
|
})));
|
|
2793
|
-
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() {
|
|
2794
2818
|
var responsePayload, warnSpy, roapEvent;
|
|
2795
|
-
return _regenerator.default.wrap(function
|
|
2796
|
-
while (1) switch (
|
|
2819
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2820
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2797
2821
|
case 0:
|
|
2798
2822
|
expect.assertions(7);
|
|
2799
2823
|
responsePayload = {
|
|
@@ -2806,26 +2830,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2806
2830
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2807
2831
|
call['held'] = true;
|
|
2808
2832
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2809
|
-
var
|
|
2810
|
-
return _regenerator.default.wrap(function
|
|
2811
|
-
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) {
|
|
2812
2836
|
case 0:
|
|
2813
2837
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2814
2838
|
case 1:
|
|
2815
2839
|
case "end":
|
|
2816
|
-
return
|
|
2840
|
+
return _context53.stop();
|
|
2817
2841
|
}
|
|
2818
|
-
},
|
|
2842
|
+
}, _callee53);
|
|
2819
2843
|
}));
|
|
2820
2844
|
return function (_x7) {
|
|
2821
|
-
return
|
|
2845
|
+
return _ref54.apply(this, arguments);
|
|
2822
2846
|
};
|
|
2823
2847
|
}());
|
|
2824
2848
|
call.doHoldResume();
|
|
2825
|
-
|
|
2849
|
+
_context54.next = 11;
|
|
2826
2850
|
return _promise.default.resolve();
|
|
2827
2851
|
case 11:
|
|
2828
|
-
|
|
2852
|
+
_context54.next = 13;
|
|
2829
2853
|
return _promise.default.resolve();
|
|
2830
2854
|
case 13:
|
|
2831
2855
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2841,11 +2865,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2841
2865
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2842
2866
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2843
2867
|
roapEvent.data.type = 'ANSWER';
|
|
2844
|
-
|
|
2868
|
+
_context54.next = 21;
|
|
2845
2869
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2846
2870
|
case 21:
|
|
2847
2871
|
roapEvent.data.type = 'OK';
|
|
2848
|
-
|
|
2872
|
+
_context54.next = 24;
|
|
2849
2873
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2850
2874
|
case 24:
|
|
2851
2875
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2860,14 +2884,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2860
2884
|
});
|
|
2861
2885
|
case 29:
|
|
2862
2886
|
case "end":
|
|
2863
|
-
return
|
|
2887
|
+
return _context54.stop();
|
|
2864
2888
|
}
|
|
2865
|
-
},
|
|
2889
|
+
}, _callee54);
|
|
2866
2890
|
})));
|
|
2867
|
-
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() {
|
|
2868
2892
|
var responsePayload;
|
|
2869
|
-
return _regenerator.default.wrap(function
|
|
2870
|
-
while (1) switch (
|
|
2893
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2894
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2871
2895
|
case 0:
|
|
2872
2896
|
expect.assertions(4);
|
|
2873
2897
|
responsePayload = {
|
|
@@ -2877,26 +2901,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2877
2901
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2878
2902
|
call['held'] = true;
|
|
2879
2903
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2880
|
-
var
|
|
2881
|
-
return _regenerator.default.wrap(function
|
|
2882
|
-
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) {
|
|
2883
2907
|
case 0:
|
|
2884
2908
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2885
2909
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2886
2910
|
case 2:
|
|
2887
2911
|
case "end":
|
|
2888
|
-
return
|
|
2912
|
+
return _context55.stop();
|
|
2889
2913
|
}
|
|
2890
|
-
},
|
|
2914
|
+
}, _callee55);
|
|
2891
2915
|
}));
|
|
2892
2916
|
return function (_x8) {
|
|
2893
|
-
return
|
|
2917
|
+
return _ref56.apply(this, arguments);
|
|
2894
2918
|
};
|
|
2895
2919
|
}());
|
|
2896
|
-
|
|
2920
|
+
_context56.next = 7;
|
|
2897
2921
|
return call.doHoldResume();
|
|
2898
2922
|
case 7:
|
|
2899
|
-
|
|
2923
|
+
_context56.next = 9;
|
|
2900
2924
|
return (0, _testUtil.flushPromises)(2);
|
|
2901
2925
|
case 9:
|
|
2902
2926
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2907,14 +2931,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2907
2931
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2908
2932
|
case 11:
|
|
2909
2933
|
case "end":
|
|
2910
|
-
return
|
|
2934
|
+
return _context56.stop();
|
|
2911
2935
|
}
|
|
2912
|
-
},
|
|
2936
|
+
}, _callee56);
|
|
2913
2937
|
})));
|
|
2914
|
-
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() {
|
|
2915
2939
|
var responsePayload, rejectPayload, roapEvent;
|
|
2916
|
-
return _regenerator.default.wrap(function
|
|
2917
|
-
while (1) switch (
|
|
2940
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2941
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2918
2942
|
case 0:
|
|
2919
2943
|
expect.assertions(5);
|
|
2920
2944
|
responsePayload = {
|
|
@@ -2928,24 +2952,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2928
2952
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2929
2953
|
call['held'] = true;
|
|
2930
2954
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2931
|
-
var
|
|
2932
|
-
return _regenerator.default.wrap(function
|
|
2933
|
-
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) {
|
|
2934
2958
|
case 0:
|
|
2935
2959
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2936
2960
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2937
2961
|
case 2:
|
|
2938
2962
|
case "end":
|
|
2939
|
-
return
|
|
2963
|
+
return _context57.stop();
|
|
2940
2964
|
}
|
|
2941
|
-
},
|
|
2965
|
+
}, _callee57);
|
|
2942
2966
|
}));
|
|
2943
2967
|
return function (_x9) {
|
|
2944
|
-
return
|
|
2968
|
+
return _ref58.apply(this, arguments);
|
|
2945
2969
|
};
|
|
2946
2970
|
}());
|
|
2947
2971
|
call.doHoldResume();
|
|
2948
|
-
|
|
2972
|
+
_context58.next = 9;
|
|
2949
2973
|
return (0, _testUtil.flushPromises)(2);
|
|
2950
2974
|
case 9:
|
|
2951
2975
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2956,7 +2980,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2956
2980
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2957
2981
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2958
2982
|
roapEvent.data.type = 'ANSWER';
|
|
2959
|
-
|
|
2983
|
+
_context58.next = 15;
|
|
2960
2984
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2961
2985
|
case 15:
|
|
2962
2986
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2964,14 +2988,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2964
2988
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2965
2989
|
case 17:
|
|
2966
2990
|
case "end":
|
|
2967
|
-
return
|
|
2991
|
+
return _context58.stop();
|
|
2968
2992
|
}
|
|
2969
|
-
},
|
|
2993
|
+
}, _callee58);
|
|
2970
2994
|
})));
|
|
2971
|
-
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() {
|
|
2972
2996
|
var responsePayload, roapEvent;
|
|
2973
|
-
return _regenerator.default.wrap(function
|
|
2974
|
-
while (1) switch (
|
|
2997
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
2998
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2975
2999
|
case 0:
|
|
2976
3000
|
expect.assertions(5);
|
|
2977
3001
|
responsePayload = {
|
|
@@ -2981,24 +3005,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2981
3005
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2982
3006
|
call['held'] = true;
|
|
2983
3007
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2984
|
-
var
|
|
2985
|
-
return _regenerator.default.wrap(function
|
|
2986
|
-
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) {
|
|
2987
3011
|
case 0:
|
|
2988
3012
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2989
3013
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2990
3014
|
case 2:
|
|
2991
3015
|
case "end":
|
|
2992
|
-
return
|
|
3016
|
+
return _context59.stop();
|
|
2993
3017
|
}
|
|
2994
|
-
},
|
|
3018
|
+
}, _callee59);
|
|
2995
3019
|
}));
|
|
2996
3020
|
return function (_x0) {
|
|
2997
|
-
return
|
|
3021
|
+
return _ref60.apply(this, arguments);
|
|
2998
3022
|
};
|
|
2999
3023
|
}());
|
|
3000
3024
|
call.doHoldResume();
|
|
3001
|
-
|
|
3025
|
+
_context60.next = 8;
|
|
3002
3026
|
return (0, _testUtil.flushPromises)(2);
|
|
3003
3027
|
case 8:
|
|
3004
3028
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3011,11 +3035,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3011
3035
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3012
3036
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3013
3037
|
roapEvent.data.type = 'ANSWER';
|
|
3014
|
-
|
|
3038
|
+
_context60.next = 14;
|
|
3015
3039
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3016
3040
|
case 14:
|
|
3017
3041
|
roapEvent.data.type = 'OK';
|
|
3018
|
-
|
|
3042
|
+
_context60.next = 17;
|
|
3019
3043
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3020
3044
|
case 17:
|
|
3021
3045
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3025,9 +3049,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3025
3049
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3026
3050
|
case 20:
|
|
3027
3051
|
case "end":
|
|
3028
|
-
return
|
|
3052
|
+
return _context60.stop();
|
|
3029
3053
|
}
|
|
3030
|
-
},
|
|
3054
|
+
}, _callee60);
|
|
3031
3055
|
})));
|
|
3032
3056
|
});
|
|
3033
3057
|
describe('Call transfer tests', function () {
|
|
@@ -3060,10 +3084,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3060
3084
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3061
3085
|
secondCall['held'] = false;
|
|
3062
3086
|
});
|
|
3063
|
-
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() {
|
|
3064
3088
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3065
|
-
return _regenerator.default.wrap(function
|
|
3066
|
-
while (1) switch (
|
|
3089
|
+
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
3090
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3067
3091
|
case 0:
|
|
3068
3092
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3069
3093
|
responsePayload = {
|
|
@@ -3075,41 +3099,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3075
3099
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3076
3100
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3077
3101
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3078
|
-
var
|
|
3079
|
-
return _regenerator.default.wrap(function
|
|
3080
|
-
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) {
|
|
3081
3105
|
case 0:
|
|
3082
3106
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3083
3107
|
case 1:
|
|
3084
3108
|
case "end":
|
|
3085
|
-
return
|
|
3109
|
+
return _context61.stop();
|
|
3086
3110
|
}
|
|
3087
|
-
},
|
|
3111
|
+
}, _callee61);
|
|
3088
3112
|
}));
|
|
3089
3113
|
return function (_x1) {
|
|
3090
|
-
return
|
|
3114
|
+
return _ref62.apply(this, arguments);
|
|
3091
3115
|
};
|
|
3092
3116
|
}());
|
|
3093
3117
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3094
|
-
var
|
|
3095
|
-
return _regenerator.default.wrap(function
|
|
3096
|
-
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) {
|
|
3097
3121
|
case 0:
|
|
3098
3122
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3099
3123
|
case 1:
|
|
3100
3124
|
case "end":
|
|
3101
|
-
return
|
|
3125
|
+
return _context62.stop();
|
|
3102
3126
|
}
|
|
3103
|
-
},
|
|
3127
|
+
}, _callee62);
|
|
3104
3128
|
}));
|
|
3105
3129
|
return function (_x10) {
|
|
3106
|
-
return
|
|
3130
|
+
return _ref63.apply(this, arguments);
|
|
3107
3131
|
};
|
|
3108
3132
|
}());
|
|
3109
|
-
|
|
3133
|
+
_context63.next = 10;
|
|
3110
3134
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3111
3135
|
case 10:
|
|
3112
|
-
|
|
3136
|
+
_context63.next = 12;
|
|
3113
3137
|
return (0, _testUtil.flushPromises)(2);
|
|
3114
3138
|
case 12:
|
|
3115
3139
|
expect(requestSpy).toBeCalled();
|
|
@@ -3132,14 +3156,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3132
3156
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3133
3157
|
case 24:
|
|
3134
3158
|
case "end":
|
|
3135
|
-
return
|
|
3159
|
+
return _context63.stop();
|
|
3136
3160
|
}
|
|
3137
|
-
},
|
|
3161
|
+
}, _callee63);
|
|
3138
3162
|
})));
|
|
3139
|
-
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() {
|
|
3140
3164
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3141
|
-
return _regenerator.default.wrap(function
|
|
3142
|
-
while (1) switch (
|
|
3165
|
+
return _regenerator.default.wrap(function _callee65$(_context65) {
|
|
3166
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3143
3167
|
case 0:
|
|
3144
3168
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3145
3169
|
responsePayload = {
|
|
@@ -3151,25 +3175,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3151
3175
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3152
3176
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3153
3177
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3154
|
-
var
|
|
3155
|
-
return _regenerator.default.wrap(function
|
|
3156
|
-
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) {
|
|
3157
3181
|
case 0:
|
|
3158
3182
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3159
3183
|
case 1:
|
|
3160
3184
|
case "end":
|
|
3161
|
-
return
|
|
3185
|
+
return _context64.stop();
|
|
3162
3186
|
}
|
|
3163
|
-
},
|
|
3187
|
+
}, _callee64);
|
|
3164
3188
|
}));
|
|
3165
3189
|
return function (_x11) {
|
|
3166
|
-
return
|
|
3190
|
+
return _ref65.apply(this, arguments);
|
|
3167
3191
|
};
|
|
3168
3192
|
}());
|
|
3169
|
-
|
|
3193
|
+
_context65.next = 9;
|
|
3170
3194
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3171
3195
|
case 9:
|
|
3172
|
-
|
|
3196
|
+
_context65.next = 11;
|
|
3173
3197
|
return (0, _testUtil.flushPromises)(2);
|
|
3174
3198
|
case 11:
|
|
3175
3199
|
expect(requestSpy).toBeCalled();
|
|
@@ -3188,14 +3212,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3188
3212
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3189
3213
|
case 21:
|
|
3190
3214
|
case "end":
|
|
3191
|
-
return
|
|
3215
|
+
return _context65.stop();
|
|
3192
3216
|
}
|
|
3193
|
-
},
|
|
3217
|
+
}, _callee65);
|
|
3194
3218
|
})));
|
|
3195
|
-
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() {
|
|
3196
3220
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3197
|
-
return _regenerator.default.wrap(function
|
|
3198
|
-
while (1) switch (
|
|
3221
|
+
return _regenerator.default.wrap(function _callee66$(_context66) {
|
|
3222
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3199
3223
|
case 0:
|
|
3200
3224
|
responsePayload = {
|
|
3201
3225
|
statusCode: 403,
|
|
@@ -3206,10 +3230,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3206
3230
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3207
3231
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3208
3232
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3209
|
-
|
|
3233
|
+
_context66.next = 8;
|
|
3210
3234
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3211
3235
|
case 8:
|
|
3212
|
-
|
|
3236
|
+
_context66.next = 10;
|
|
3213
3237
|
return (0, _testUtil.flushPromises)(1);
|
|
3214
3238
|
case 10:
|
|
3215
3239
|
expect(requestSpy).toBeCalled();
|
|
@@ -3230,14 +3254,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3230
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));
|
|
3231
3255
|
case 18:
|
|
3232
3256
|
case "end":
|
|
3233
|
-
return
|
|
3257
|
+
return _context66.stop();
|
|
3234
3258
|
}
|
|
3235
|
-
},
|
|
3259
|
+
}, _callee66);
|
|
3236
3260
|
})));
|
|
3237
|
-
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() {
|
|
3238
3262
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3239
|
-
return _regenerator.default.wrap(function
|
|
3240
|
-
while (1) switch (
|
|
3263
|
+
return _regenerator.default.wrap(function _callee67$(_context67) {
|
|
3264
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3241
3265
|
case 0:
|
|
3242
3266
|
responsePayload = {
|
|
3243
3267
|
statusCode: 403,
|
|
@@ -3247,10 +3271,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3247
3271
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3248
3272
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3249
3273
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3250
|
-
|
|
3274
|
+
_context67.next = 7;
|
|
3251
3275
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3252
3276
|
case 7:
|
|
3253
|
-
|
|
3277
|
+
_context67.next = 9;
|
|
3254
3278
|
return (0, _testUtil.flushPromises)(2);
|
|
3255
3279
|
case 9:
|
|
3256
3280
|
expect(requestSpy).toBeCalled();
|
|
@@ -3271,18 +3295,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3271
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));
|
|
3272
3296
|
case 18:
|
|
3273
3297
|
case "end":
|
|
3274
|
-
return
|
|
3298
|
+
return _context67.stop();
|
|
3275
3299
|
}
|
|
3276
|
-
},
|
|
3300
|
+
}, _callee67);
|
|
3277
3301
|
})));
|
|
3278
|
-
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() {
|
|
3279
3303
|
var requestSpy, warnSpy;
|
|
3280
|
-
return _regenerator.default.wrap(function
|
|
3281
|
-
while (1) switch (
|
|
3304
|
+
return _regenerator.default.wrap(function _callee68$(_context68) {
|
|
3305
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3282
3306
|
case 0:
|
|
3283
3307
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3284
3308
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3285
|
-
|
|
3309
|
+
_context68.next = 4;
|
|
3286
3310
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3287
3311
|
case 4:
|
|
3288
3312
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3294,18 +3318,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3294
3318
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3295
3319
|
case 10:
|
|
3296
3320
|
case "end":
|
|
3297
|
-
return
|
|
3321
|
+
return _context68.stop();
|
|
3298
3322
|
}
|
|
3299
|
-
},
|
|
3323
|
+
}, _callee68);
|
|
3300
3324
|
})));
|
|
3301
|
-
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() {
|
|
3302
3326
|
var requestSpy, warnSpy;
|
|
3303
|
-
return _regenerator.default.wrap(function
|
|
3304
|
-
while (1) switch (
|
|
3327
|
+
return _regenerator.default.wrap(function _callee69$(_context69) {
|
|
3328
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3305
3329
|
case 0:
|
|
3306
3330
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3307
3331
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3308
|
-
|
|
3332
|
+
_context69.next = 4;
|
|
3309
3333
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3310
3334
|
case 4:
|
|
3311
3335
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3317,9 +3341,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3317
3341
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3318
3342
|
case 10:
|
|
3319
3343
|
case "end":
|
|
3320
|
-
return
|
|
3344
|
+
return _context69.stop();
|
|
3321
3345
|
}
|
|
3322
|
-
},
|
|
3346
|
+
}, _callee69);
|
|
3323
3347
|
})));
|
|
3324
3348
|
});
|
|
3325
3349
|
});
|