@webex/calling 3.0.0-next.2 → 3.0.0-next.21
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/CHANGELOG.md +1403 -0
- package/dist/CallHistory/CallHistory.js +1 -3
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js +9 -0
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +0 -2
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +119 -62
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +161 -102
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +3 -23
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
- package/dist/CallingClient/calling/call.js +78 -33
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +483 -351
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +0 -9
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +1 -1
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/callingClientFixtures.js +107 -1
- package/dist/CallingClient/callingClientFixtures.js.map +1 -1
- package/dist/CallingClient/constants.js +14 -6
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +12 -12
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +9 -9
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js +4 -7
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/register.js +62 -80
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +28 -28
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +8 -2
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/types.js +3 -0
- package/dist/Contacts/types.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +2 -2
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Errors/index.js +7 -0
- package/dist/Errors/index.js.map +1 -1
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js +0 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.test.js +1 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +18 -21
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/types.js.map +1 -1
- package/dist/api.js +43 -20
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +13 -18
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +1 -1
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/testUtil.js +2 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/common/types.js +8 -7
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +233 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/callHistoryFixtures.js +9 -0
- package/dist/module/CallingClient/CallingClient.js +59 -42
- package/dist/module/CallingClient/calling/CallerId/index.js +3 -23
- package/dist/module/CallingClient/calling/call.js +54 -17
- package/dist/module/CallingClient/calling/callManager.js +0 -6
- package/dist/module/CallingClient/callingClientFixtures.js +119 -1
- package/dist/module/CallingClient/constants.js +8 -4
- package/dist/module/CallingClient/line/index.js +7 -10
- package/dist/module/CallingClient/line/types.js +0 -5
- package/dist/module/CallingClient/registration/register.js +28 -20
- package/dist/module/Contacts/ContactsClient.js +3 -0
- package/dist/module/Errors/catalog/CallingDeviceError.js +2 -2
- package/dist/module/Errors/catalog/LineError.js +2 -2
- package/dist/module/Errors/index.js +1 -0
- package/dist/module/api.js +6 -5
- package/dist/module/common/Utils.js +14 -19
- package/dist/module/common/testUtil.js +2 -1
- package/dist/module/common/types.js +6 -5
- package/dist/module/index.js +7 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
- package/dist/types/CallSettings/CallSettings.d.ts.map +1 -1
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts +2 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/types.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +2 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +0 -1
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +30 -30
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/callingClientFixtures.d.ts +69 -1
- package/dist/types/CallingClient/callingClientFixtures.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +7 -3
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +4 -5
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/line/types.d.ts +8 -13
- package/dist/types/CallingClient/line/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +3 -3
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +14 -14
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +6 -4
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +3 -2
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Contacts/types.d.ts +2 -0
- package/dist/types/Contacts/types.d.ts.map +1 -1
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts +4 -4
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts.map +1 -1
- package/dist/types/Errors/catalog/LineError.d.ts +4 -4
- package/dist/types/Errors/catalog/LineError.d.ts.map +1 -1
- package/dist/types/Errors/index.d.ts +1 -0
- package/dist/types/Errors/index.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -3
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +11 -0
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +2 -1
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/types.d.ts +10 -10
- package/dist/types/Voicemail/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +10 -10
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +3 -2
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -162,7 +162,8 @@ describe('Call Tests', function () {
|
|
|
162
162
|
mockStream = {
|
|
163
163
|
outputStream: {
|
|
164
164
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
165
|
-
}
|
|
165
|
+
},
|
|
166
|
+
on: jest.fn()
|
|
166
167
|
};
|
|
167
168
|
localAudioStream = mockStream;
|
|
168
169
|
call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
|
|
@@ -305,7 +306,8 @@ describe('Call Tests', function () {
|
|
|
305
306
|
mockStream = {
|
|
306
307
|
outputStream: {
|
|
307
308
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
308
|
-
}
|
|
309
|
+
},
|
|
310
|
+
on: jest.fn()
|
|
309
311
|
};
|
|
310
312
|
localAudioStream = mockStream;
|
|
311
313
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
@@ -336,7 +338,8 @@ describe('Call Tests', function () {
|
|
|
336
338
|
mockStream = {
|
|
337
339
|
outputStream: {
|
|
338
340
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
339
|
-
}
|
|
341
|
+
},
|
|
342
|
+
on: jest.fn()
|
|
340
343
|
};
|
|
341
344
|
localAudioStream = mockStream;
|
|
342
345
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
@@ -361,6 +364,135 @@ describe('Call Tests', function () {
|
|
|
361
364
|
}
|
|
362
365
|
}, _callee7);
|
|
363
366
|
})));
|
|
367
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
368
|
+
var mockStream, localAudioStream, warnSpy, call;
|
|
369
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
370
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
371
|
+
case 0:
|
|
372
|
+
mockStream = {
|
|
373
|
+
outputStream: {
|
|
374
|
+
getAudioTracks: jest.fn().mockReturnValue([])
|
|
375
|
+
},
|
|
376
|
+
on: jest.fn()
|
|
377
|
+
};
|
|
378
|
+
localAudioStream = mockStream;
|
|
379
|
+
webex.request.mockReturnValue({
|
|
380
|
+
statusCode: 200,
|
|
381
|
+
body: {
|
|
382
|
+
device: {
|
|
383
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
384
|
+
correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
|
|
385
|
+
},
|
|
386
|
+
callId: '8a67806f-fc4d-446b-a131-31e71ea5b020'
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
390
|
+
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
391
|
+
call.answer(localAudioStream);
|
|
392
|
+
_context8.next = 8;
|
|
393
|
+
return (0, Utils.waitForMsecs)(50);
|
|
394
|
+
case 8:
|
|
395
|
+
expect(warnSpy).toBeCalledTimes(2);
|
|
396
|
+
expect(warnSpy).toBeCalledWith("Did not find a local track while answering the call ".concat(call.getCorrelationId()), {
|
|
397
|
+
file: 'call',
|
|
398
|
+
method: 'answer'
|
|
399
|
+
});
|
|
400
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
401
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_IDLE');
|
|
402
|
+
expect(call.getDisconnectReason().code).toBe(_types5.DisconnectCode.MEDIA_INACTIVITY);
|
|
403
|
+
expect(call.getDisconnectReason().cause).toBe(_types5.DisconnectCause.MEDIA_INACTIVITY);
|
|
404
|
+
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
405
|
+
case 15:
|
|
406
|
+
case "end":
|
|
407
|
+
return _context8.stop();
|
|
408
|
+
}
|
|
409
|
+
}, _callee8);
|
|
410
|
+
})));
|
|
411
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
412
|
+
var mockStream, localAudioStream, warnSpy, call;
|
|
413
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
414
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
415
|
+
case 0:
|
|
416
|
+
mockStream = {
|
|
417
|
+
outputStream: {
|
|
418
|
+
getAudioTracks: jest.fn().mockReturnValue([])
|
|
419
|
+
},
|
|
420
|
+
on: jest.fn()
|
|
421
|
+
};
|
|
422
|
+
localAudioStream = mockStream;
|
|
423
|
+
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
424
|
+
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
425
|
+
call.dial(localAudioStream);
|
|
426
|
+
_context9.next = 7;
|
|
427
|
+
return (0, Utils.waitForMsecs)(50);
|
|
428
|
+
case 7:
|
|
429
|
+
expect(warnSpy).toBeCalledTimes(1);
|
|
430
|
+
expect(warnSpy).toBeCalledWith("Did not find a local track while dialing the call ".concat(call.getCorrelationId()), {
|
|
431
|
+
file: 'call',
|
|
432
|
+
method: 'dial'
|
|
433
|
+
});
|
|
434
|
+
expect(call['callStateMachine'].state.value).toBe('S_IDLE');
|
|
435
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_IDLE');
|
|
436
|
+
expect(webex.request).not.toBeCalledOnceWith();
|
|
437
|
+
case 12:
|
|
438
|
+
case "end":
|
|
439
|
+
return _context9.stop();
|
|
440
|
+
}
|
|
441
|
+
}, _callee9);
|
|
442
|
+
})));
|
|
443
|
+
it('update media after call creation with valid stream', function () {
|
|
444
|
+
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
445
|
+
var mockStream = {
|
|
446
|
+
outputStream: {
|
|
447
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
448
|
+
},
|
|
449
|
+
on: jest.fn()
|
|
450
|
+
};
|
|
451
|
+
var localAudioStream = mockStream;
|
|
452
|
+
var call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
|
|
453
|
+
call.dial(localAudioStream);
|
|
454
|
+
expect(mockTrack.enabled).toEqual(true);
|
|
455
|
+
var mockTrack2 = {
|
|
456
|
+
enabled: true
|
|
457
|
+
};
|
|
458
|
+
var mockStream2 = {
|
|
459
|
+
outputStream: {
|
|
460
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack2])
|
|
461
|
+
},
|
|
462
|
+
on: jest.fn()
|
|
463
|
+
};
|
|
464
|
+
var localAudioStream2 = mockStream2;
|
|
465
|
+
call.updateMedia(localAudioStream2);
|
|
466
|
+
expect(call['mediaConnection'].updateLocalTracks).toBeCalledOnceWith({
|
|
467
|
+
audio: mockTrack2
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
it('update media with invalid stream', function () {
|
|
471
|
+
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
472
|
+
var warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
473
|
+
var mockStream = {
|
|
474
|
+
outputStream: {
|
|
475
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
476
|
+
},
|
|
477
|
+
on: jest.fn()
|
|
478
|
+
};
|
|
479
|
+
var localAudioStream = mockStream;
|
|
480
|
+
var call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
|
|
481
|
+
call.dial(localAudioStream);
|
|
482
|
+
expect(mockTrack.enabled).toEqual(true);
|
|
483
|
+
var errorStream = {
|
|
484
|
+
outputStream: {
|
|
485
|
+
getAudioTracks: jest.fn().mockReturnValue([])
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
var localAudioStream2 = errorStream;
|
|
489
|
+
call.updateMedia(localAudioStream2);
|
|
490
|
+
expect(call['mediaConnection'].updateLocalTracks).not.toBeCalled();
|
|
491
|
+
expect(warnSpy).toBeCalledOnceWith("Did not find a local track while updating media for call ".concat(call.getCorrelationId(), ". Will not update media"), {
|
|
492
|
+
file: 'call',
|
|
493
|
+
method: 'updateMedia'
|
|
494
|
+
});
|
|
495
|
+
});
|
|
364
496
|
});
|
|
365
497
|
describe('State Machine handler tests', function () {
|
|
366
498
|
var deviceId = '55dfb53f-bed2-36da-8e85-cee7f02aa68e';
|
|
@@ -391,10 +523,10 @@ describe('State Machine handler tests', function () {
|
|
|
391
523
|
|
|
392
524
|
// afterEach(() => call.removeAllListeners());
|
|
393
525
|
|
|
394
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
526
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
395
527
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
396
|
-
return _regenerator.default.wrap(function
|
|
397
|
-
while (1) switch (
|
|
528
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
529
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
398
530
|
case 0:
|
|
399
531
|
statusPayload = {
|
|
400
532
|
statusCode: 200,
|
|
@@ -414,7 +546,7 @@ describe('State Machine handler tests', function () {
|
|
|
414
546
|
/* This is to flush all the promises from the Promise queue so that
|
|
415
547
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
416
548
|
*/
|
|
417
|
-
|
|
549
|
+
_context10.next = 11;
|
|
418
550
|
return (0, _testUtil.flushPromises)(3);
|
|
419
551
|
case 11:
|
|
420
552
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -425,14 +557,14 @@ describe('State Machine handler tests', function () {
|
|
|
425
557
|
});
|
|
426
558
|
case 14:
|
|
427
559
|
case "end":
|
|
428
|
-
return
|
|
560
|
+
return _context10.stop();
|
|
429
561
|
}
|
|
430
|
-
},
|
|
562
|
+
}, _callee10);
|
|
431
563
|
})));
|
|
432
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
564
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
433
565
|
var statusPayload, funcSpy;
|
|
434
|
-
return _regenerator.default.wrap(function
|
|
435
|
-
while (1) switch (
|
|
566
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
567
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
436
568
|
case 0:
|
|
437
569
|
expect.assertions(4);
|
|
438
570
|
statusPayload = {
|
|
@@ -456,24 +588,24 @@ describe('State Machine handler tests', function () {
|
|
|
456
588
|
/* This is to flush all the promises from the Promise queue so that
|
|
457
589
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
458
590
|
*/
|
|
459
|
-
|
|
591
|
+
_context11.next = 11;
|
|
460
592
|
return _promise.default.resolve();
|
|
461
593
|
case 11:
|
|
462
|
-
|
|
594
|
+
_context11.next = 13;
|
|
463
595
|
return _promise.default.resolve();
|
|
464
596
|
case 13:
|
|
465
597
|
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
466
598
|
expect(funcSpy).toBeCalledTimes(1);
|
|
467
599
|
case 15:
|
|
468
600
|
case "end":
|
|
469
|
-
return
|
|
601
|
+
return _context11.stop();
|
|
470
602
|
}
|
|
471
|
-
},
|
|
603
|
+
}, _callee11);
|
|
472
604
|
})));
|
|
473
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
605
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
474
606
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
475
|
-
return _regenerator.default.wrap(function
|
|
476
|
-
while (1) switch (
|
|
607
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
608
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
477
609
|
case 0:
|
|
478
610
|
statusPayload = {
|
|
479
611
|
statusCode: 200,
|
|
@@ -529,14 +661,14 @@ describe('State Machine handler tests', function () {
|
|
|
529
661
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
530
662
|
case 27:
|
|
531
663
|
case "end":
|
|
532
|
-
return
|
|
664
|
+
return _context12.stop();
|
|
533
665
|
}
|
|
534
|
-
},
|
|
666
|
+
}, _callee12);
|
|
535
667
|
})));
|
|
536
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
668
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
537
669
|
var statusPayload, dummyEvent;
|
|
538
|
-
return _regenerator.default.wrap(function
|
|
539
|
-
while (1) switch (
|
|
670
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
671
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
540
672
|
case 0:
|
|
541
673
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
542
674
|
statusPayload = {
|
|
@@ -554,7 +686,7 @@ describe('State Machine handler tests', function () {
|
|
|
554
686
|
webex.request.mockReturnValue(statusPayload);
|
|
555
687
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
556
688
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
557
|
-
|
|
689
|
+
_context13.next = 8;
|
|
558
690
|
return call['handleOutgoingCallConnect']({
|
|
559
691
|
type: 'E_SEND_CALL_CONNECT'
|
|
560
692
|
});
|
|
@@ -568,14 +700,14 @@ describe('State Machine handler tests', function () {
|
|
|
568
700
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
569
701
|
case 12:
|
|
570
702
|
case "end":
|
|
571
|
-
return
|
|
703
|
+
return _context13.stop();
|
|
572
704
|
}
|
|
573
|
-
},
|
|
705
|
+
}, _callee13);
|
|
574
706
|
})));
|
|
575
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
707
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
576
708
|
var warnSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
577
|
-
return _regenerator.default.wrap(function
|
|
578
|
-
while (1) switch (
|
|
709
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
710
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
579
711
|
case 0:
|
|
580
712
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
581
713
|
stateMachineSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
@@ -601,7 +733,7 @@ describe('State Machine handler tests', function () {
|
|
|
601
733
|
webex.request.mockRejectedValueOnce({
|
|
602
734
|
statusCode: 403
|
|
603
735
|
}).mockResolvedValue(statusPayload);
|
|
604
|
-
|
|
736
|
+
_context14.next = 12;
|
|
605
737
|
return call['handleOutgoingCallConnect']({
|
|
606
738
|
type: 'E_SEND_CALL_CONNECT'
|
|
607
739
|
});
|
|
@@ -618,14 +750,14 @@ describe('State Machine handler tests', function () {
|
|
|
618
750
|
});
|
|
619
751
|
case 18:
|
|
620
752
|
case "end":
|
|
621
|
-
return
|
|
753
|
+
return _context14.stop();
|
|
622
754
|
}
|
|
623
|
-
},
|
|
755
|
+
}, _callee14);
|
|
624
756
|
})));
|
|
625
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
757
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
626
758
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent;
|
|
627
|
-
return _regenerator.default.wrap(function
|
|
628
|
-
while (1) switch (
|
|
759
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
760
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
629
761
|
case 0:
|
|
630
762
|
statusPayload = {
|
|
631
763
|
statusCode: 200,
|
|
@@ -699,14 +831,14 @@ describe('State Machine handler tests', function () {
|
|
|
699
831
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
700
832
|
case 40:
|
|
701
833
|
case "end":
|
|
702
|
-
return
|
|
834
|
+
return _context15.stop();
|
|
703
835
|
}
|
|
704
|
-
},
|
|
836
|
+
}, _callee15);
|
|
705
837
|
})));
|
|
706
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
838
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
707
839
|
var statusPayload, dummyEvent;
|
|
708
|
-
return _regenerator.default.wrap(function
|
|
709
|
-
while (1) switch (
|
|
840
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
841
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
710
842
|
case 0:
|
|
711
843
|
statusPayload = {
|
|
712
844
|
statusCode: 200,
|
|
@@ -745,14 +877,14 @@ describe('State Machine handler tests', function () {
|
|
|
745
877
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
746
878
|
case 17:
|
|
747
879
|
case "end":
|
|
748
|
-
return
|
|
880
|
+
return _context16.stop();
|
|
749
881
|
}
|
|
750
|
-
},
|
|
882
|
+
}, _callee16);
|
|
751
883
|
})));
|
|
752
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
884
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
753
885
|
var statusPayload, dummyEvent;
|
|
754
|
-
return _regenerator.default.wrap(function
|
|
755
|
-
while (1) switch (
|
|
886
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
887
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
756
888
|
case 0:
|
|
757
889
|
statusPayload = {
|
|
758
890
|
statusCode: 403,
|
|
@@ -768,20 +900,20 @@ describe('State Machine handler tests', function () {
|
|
|
768
900
|
};
|
|
769
901
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
770
902
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
771
|
-
|
|
903
|
+
_context17.next = 6;
|
|
772
904
|
return (0, _testUtil.flushPromises)(3);
|
|
773
905
|
case 6:
|
|
774
906
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
775
907
|
case 7:
|
|
776
908
|
case "end":
|
|
777
|
-
return
|
|
909
|
+
return _context17.stop();
|
|
778
910
|
}
|
|
779
|
-
},
|
|
911
|
+
}, _callee17);
|
|
780
912
|
})));
|
|
781
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
913
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
782
914
|
var statusPayload, dummyEvent;
|
|
783
|
-
return _regenerator.default.wrap(function
|
|
784
|
-
while (1) switch (
|
|
915
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
916
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
785
917
|
case 0:
|
|
786
918
|
statusPayload = {
|
|
787
919
|
statusCode: 403,
|
|
@@ -798,10 +930,10 @@ describe('State Machine handler tests', function () {
|
|
|
798
930
|
call['earlyMedia'] = true;
|
|
799
931
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
800
932
|
webex.request.mockRejectedValue(statusPayload);
|
|
801
|
-
|
|
933
|
+
_context18.next = 8;
|
|
802
934
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
803
935
|
case 8:
|
|
804
|
-
|
|
936
|
+
_context18.next = 10;
|
|
805
937
|
return (0, _testUtil.flushPromises)(2);
|
|
806
938
|
case 10:
|
|
807
939
|
expect(call.isConnected()).toBe(false);
|
|
@@ -809,14 +941,14 @@ describe('State Machine handler tests', function () {
|
|
|
809
941
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
810
942
|
case 13:
|
|
811
943
|
case "end":
|
|
812
|
-
return
|
|
944
|
+
return _context18.stop();
|
|
813
945
|
}
|
|
814
|
-
},
|
|
946
|
+
}, _callee18);
|
|
815
947
|
})));
|
|
816
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
948
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
817
949
|
var statusPayload, dummyEvent;
|
|
818
|
-
return _regenerator.default.wrap(function
|
|
819
|
-
while (1) switch (
|
|
950
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
951
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
820
952
|
case 0:
|
|
821
953
|
statusPayload = {
|
|
822
954
|
statusCode: 403,
|
|
@@ -839,14 +971,14 @@ describe('State Machine handler tests', function () {
|
|
|
839
971
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
840
972
|
case 8:
|
|
841
973
|
case "end":
|
|
842
|
-
return
|
|
974
|
+
return _context19.stop();
|
|
843
975
|
}
|
|
844
|
-
},
|
|
976
|
+
}, _callee19);
|
|
845
977
|
})));
|
|
846
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
978
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
847
979
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
848
|
-
return _regenerator.default.wrap(function
|
|
849
|
-
while (1) switch (
|
|
980
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
981
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
850
982
|
case 0:
|
|
851
983
|
statusPayload = {
|
|
852
984
|
statusCode: 503,
|
|
@@ -868,7 +1000,7 @@ describe('State Machine handler tests', function () {
|
|
|
868
1000
|
}
|
|
869
1001
|
};
|
|
870
1002
|
call['connected'] = true;
|
|
871
|
-
|
|
1003
|
+
_context20.next = 8;
|
|
872
1004
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
873
1005
|
case 8:
|
|
874
1006
|
jest.advanceTimersByTime(1005);
|
|
@@ -880,14 +1012,14 @@ describe('State Machine handler tests', function () {
|
|
|
880
1012
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
881
1013
|
case 13:
|
|
882
1014
|
case "end":
|
|
883
|
-
return
|
|
1015
|
+
return _context20.stop();
|
|
884
1016
|
}
|
|
885
|
-
},
|
|
1017
|
+
}, _callee20);
|
|
886
1018
|
})));
|
|
887
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1019
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
888
1020
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
889
|
-
return _regenerator.default.wrap(function
|
|
890
|
-
while (1) switch (
|
|
1021
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
1022
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
891
1023
|
case 0:
|
|
892
1024
|
statusPayload = {
|
|
893
1025
|
statusCode: 503,
|
|
@@ -909,7 +1041,7 @@ describe('State Machine handler tests', function () {
|
|
|
909
1041
|
}
|
|
910
1042
|
};
|
|
911
1043
|
call['connected'] = false;
|
|
912
|
-
|
|
1044
|
+
_context21.next = 8;
|
|
913
1045
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
914
1046
|
case 8:
|
|
915
1047
|
jest.advanceTimersByTime(1005);
|
|
@@ -920,14 +1052,14 @@ describe('State Machine handler tests', function () {
|
|
|
920
1052
|
expect(stateMachineSpy).not.toBeCalled();
|
|
921
1053
|
case 12:
|
|
922
1054
|
case "end":
|
|
923
|
-
return
|
|
1055
|
+
return _context21.stop();
|
|
924
1056
|
}
|
|
925
|
-
},
|
|
1057
|
+
}, _callee21);
|
|
926
1058
|
})));
|
|
927
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1059
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
928
1060
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
929
|
-
return _regenerator.default.wrap(function
|
|
930
|
-
while (1) switch (
|
|
1061
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
1062
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
931
1063
|
case 0:
|
|
932
1064
|
statusPayload = {
|
|
933
1065
|
statusCode: 503,
|
|
@@ -949,7 +1081,7 @@ describe('State Machine handler tests', function () {
|
|
|
949
1081
|
};
|
|
950
1082
|
call['connected'] = true;
|
|
951
1083
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
952
|
-
|
|
1084
|
+
_context22.next = 9;
|
|
953
1085
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
954
1086
|
case 9:
|
|
955
1087
|
jest.advanceTimersByTime(1005);
|
|
@@ -961,14 +1093,14 @@ describe('State Machine handler tests', function () {
|
|
|
961
1093
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
962
1094
|
case 14:
|
|
963
1095
|
case "end":
|
|
964
|
-
return
|
|
1096
|
+
return _context22.stop();
|
|
965
1097
|
}
|
|
966
|
-
},
|
|
1098
|
+
}, _callee22);
|
|
967
1099
|
})));
|
|
968
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1100
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
969
1101
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
970
|
-
return _regenerator.default.wrap(function
|
|
971
|
-
while (1) switch (
|
|
1102
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
1103
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
972
1104
|
case 0:
|
|
973
1105
|
statusPayload = {
|
|
974
1106
|
statusCode: 503,
|
|
@@ -989,7 +1121,7 @@ describe('State Machine handler tests', function () {
|
|
|
989
1121
|
}
|
|
990
1122
|
};
|
|
991
1123
|
call['connected'] = false;
|
|
992
|
-
|
|
1124
|
+
_context23.next = 8;
|
|
993
1125
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
994
1126
|
case 8:
|
|
995
1127
|
jest.advanceTimersByTime(1005);
|
|
@@ -1001,14 +1133,14 @@ describe('State Machine handler tests', function () {
|
|
|
1001
1133
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1002
1134
|
case 13:
|
|
1003
1135
|
case "end":
|
|
1004
|
-
return
|
|
1136
|
+
return _context23.stop();
|
|
1005
1137
|
}
|
|
1006
|
-
},
|
|
1138
|
+
}, _callee23);
|
|
1007
1139
|
})));
|
|
1008
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1140
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1009
1141
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1010
|
-
return _regenerator.default.wrap(function
|
|
1011
|
-
while (1) switch (
|
|
1142
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
1143
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1012
1144
|
case 0:
|
|
1013
1145
|
statusPayload = {
|
|
1014
1146
|
statusCode: 200,
|
|
@@ -1033,14 +1165,14 @@ describe('State Machine handler tests', function () {
|
|
|
1033
1165
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1034
1166
|
case 11:
|
|
1035
1167
|
case "end":
|
|
1036
|
-
return
|
|
1168
|
+
return _context24.stop();
|
|
1037
1169
|
}
|
|
1038
|
-
},
|
|
1170
|
+
}, _callee24);
|
|
1039
1171
|
})));
|
|
1040
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1172
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1041
1173
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1042
|
-
return _regenerator.default.wrap(function
|
|
1043
|
-
while (1) switch (
|
|
1174
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
1175
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1044
1176
|
case 0:
|
|
1045
1177
|
statusPayload = {
|
|
1046
1178
|
statusCode: 503,
|
|
@@ -1062,7 +1194,7 @@ describe('State Machine handler tests', function () {
|
|
|
1062
1194
|
};
|
|
1063
1195
|
call['connected'] = true;
|
|
1064
1196
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1065
|
-
|
|
1197
|
+
_context25.next = 9;
|
|
1066
1198
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1067
1199
|
case 9:
|
|
1068
1200
|
jest.advanceTimersByTime(1005);
|
|
@@ -1074,14 +1206,14 @@ describe('State Machine handler tests', function () {
|
|
|
1074
1206
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1075
1207
|
case 14:
|
|
1076
1208
|
case "end":
|
|
1077
|
-
return
|
|
1209
|
+
return _context25.stop();
|
|
1078
1210
|
}
|
|
1079
|
-
},
|
|
1211
|
+
}, _callee25);
|
|
1080
1212
|
})));
|
|
1081
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1213
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1082
1214
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1083
|
-
return _regenerator.default.wrap(function
|
|
1084
|
-
while (1) switch (
|
|
1215
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
1216
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1085
1217
|
case 0:
|
|
1086
1218
|
statusPayload = {
|
|
1087
1219
|
statusCode: 403,
|
|
@@ -1104,14 +1236,14 @@ describe('State Machine handler tests', function () {
|
|
|
1104
1236
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1105
1237
|
case 9:
|
|
1106
1238
|
case "end":
|
|
1107
|
-
return
|
|
1239
|
+
return _context26.stop();
|
|
1108
1240
|
}
|
|
1109
|
-
},
|
|
1241
|
+
}, _callee26);
|
|
1110
1242
|
})));
|
|
1111
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1243
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1112
1244
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1113
|
-
return _regenerator.default.wrap(function
|
|
1114
|
-
while (1) switch (
|
|
1245
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
1246
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1115
1247
|
case 0:
|
|
1116
1248
|
statusPayload = {
|
|
1117
1249
|
statusCode: 200,
|
|
@@ -1129,7 +1261,7 @@ describe('State Machine handler tests', function () {
|
|
|
1129
1261
|
}
|
|
1130
1262
|
};
|
|
1131
1263
|
call['connected'] = false;
|
|
1132
|
-
|
|
1264
|
+
_context27.next = 8;
|
|
1133
1265
|
return call['handleRoapError']({}, errorEvent);
|
|
1134
1266
|
case 8:
|
|
1135
1267
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1145,14 +1277,14 @@ describe('State Machine handler tests', function () {
|
|
|
1145
1277
|
});
|
|
1146
1278
|
case 11:
|
|
1147
1279
|
case "end":
|
|
1148
|
-
return
|
|
1280
|
+
return _context27.stop();
|
|
1149
1281
|
}
|
|
1150
|
-
},
|
|
1282
|
+
}, _callee27);
|
|
1151
1283
|
})));
|
|
1152
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1284
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1153
1285
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1154
|
-
return _regenerator.default.wrap(function
|
|
1155
|
-
while (1) switch (
|
|
1286
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
1287
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1156
1288
|
case 0:
|
|
1157
1289
|
statusPayload = {
|
|
1158
1290
|
statusCode: 200,
|
|
@@ -1185,7 +1317,7 @@ describe('State Machine handler tests', function () {
|
|
|
1185
1317
|
seq: 1,
|
|
1186
1318
|
messageType: 'ANSWER'
|
|
1187
1319
|
};
|
|
1188
|
-
|
|
1320
|
+
_context28.next = 17;
|
|
1189
1321
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1190
1322
|
case 17:
|
|
1191
1323
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1207,7 +1339,7 @@ describe('State Machine handler tests', function () {
|
|
|
1207
1339
|
seq: 2,
|
|
1208
1340
|
messageType: 'OFFER_REQUEST'
|
|
1209
1341
|
};
|
|
1210
|
-
|
|
1342
|
+
_context28.next = 23;
|
|
1211
1343
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1212
1344
|
case 23:
|
|
1213
1345
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1257,7 +1389,7 @@ describe('State Machine handler tests', function () {
|
|
|
1257
1389
|
};
|
|
1258
1390
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1259
1391
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1260
|
-
|
|
1392
|
+
_context28.next = 49;
|
|
1261
1393
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1262
1394
|
case 49:
|
|
1263
1395
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1266,7 +1398,7 @@ describe('State Machine handler tests', function () {
|
|
|
1266
1398
|
seq: 3,
|
|
1267
1399
|
messageType: 'ANSWER'
|
|
1268
1400
|
};
|
|
1269
|
-
|
|
1401
|
+
_context28.next = 54;
|
|
1270
1402
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1271
1403
|
case 54:
|
|
1272
1404
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1285,7 +1417,7 @@ describe('State Machine handler tests', function () {
|
|
|
1285
1417
|
messageType: 'OK'
|
|
1286
1418
|
}
|
|
1287
1419
|
};
|
|
1288
|
-
|
|
1420
|
+
_context28.next = 63;
|
|
1289
1421
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1290
1422
|
case 63:
|
|
1291
1423
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1300,14 +1432,14 @@ describe('State Machine handler tests', function () {
|
|
|
1300
1432
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1301
1433
|
case 70:
|
|
1302
1434
|
case "end":
|
|
1303
|
-
return
|
|
1435
|
+
return _context28.stop();
|
|
1304
1436
|
}
|
|
1305
|
-
},
|
|
1437
|
+
}, _callee28);
|
|
1306
1438
|
})));
|
|
1307
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1439
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1308
1440
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1309
|
-
return _regenerator.default.wrap(function
|
|
1310
|
-
while (1) switch (
|
|
1441
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1442
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1311
1443
|
case 0:
|
|
1312
1444
|
mockStatusBody = {
|
|
1313
1445
|
device: {
|
|
@@ -1347,7 +1479,7 @@ describe('State Machine handler tests', function () {
|
|
|
1347
1479
|
seq: 1,
|
|
1348
1480
|
messageType: 'ANSWER'
|
|
1349
1481
|
};
|
|
1350
|
-
|
|
1482
|
+
_context29.next = 18;
|
|
1351
1483
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1352
1484
|
case 18:
|
|
1353
1485
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1369,7 +1501,7 @@ describe('State Machine handler tests', function () {
|
|
|
1369
1501
|
seq: 2,
|
|
1370
1502
|
messageType: 'OFFER_REQUEST'
|
|
1371
1503
|
};
|
|
1372
|
-
|
|
1504
|
+
_context29.next = 24;
|
|
1373
1505
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1374
1506
|
case 24:
|
|
1375
1507
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1419,7 +1551,7 @@ describe('State Machine handler tests', function () {
|
|
|
1419
1551
|
};
|
|
1420
1552
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1421
1553
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1422
|
-
|
|
1554
|
+
_context29.next = 50;
|
|
1423
1555
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1424
1556
|
case 50:
|
|
1425
1557
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1428,7 +1560,7 @@ describe('State Machine handler tests', function () {
|
|
|
1428
1560
|
seq: 3,
|
|
1429
1561
|
messageType: 'ANSWER'
|
|
1430
1562
|
};
|
|
1431
|
-
|
|
1563
|
+
_context29.next = 55;
|
|
1432
1564
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1433
1565
|
case 55:
|
|
1434
1566
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1445,7 +1577,7 @@ describe('State Machine handler tests', function () {
|
|
|
1445
1577
|
}
|
|
1446
1578
|
};
|
|
1447
1579
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1448
|
-
|
|
1580
|
+
_context29.next = 62;
|
|
1449
1581
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1450
1582
|
case 62:
|
|
1451
1583
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1461,14 +1593,14 @@ describe('State Machine handler tests', function () {
|
|
|
1461
1593
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1462
1594
|
case 70:
|
|
1463
1595
|
case "end":
|
|
1464
|
-
return
|
|
1596
|
+
return _context29.stop();
|
|
1465
1597
|
}
|
|
1466
|
-
},
|
|
1598
|
+
}, _callee29);
|
|
1467
1599
|
})));
|
|
1468
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1600
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1469
1601
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1470
|
-
return _regenerator.default.wrap(function
|
|
1471
|
-
while (1) switch (
|
|
1602
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1603
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1472
1604
|
case 0:
|
|
1473
1605
|
statusPayload = {
|
|
1474
1606
|
statusCode: 200,
|
|
@@ -1535,9 +1667,9 @@ describe('State Machine handler tests', function () {
|
|
|
1535
1667
|
});
|
|
1536
1668
|
case 33:
|
|
1537
1669
|
case "end":
|
|
1538
|
-
return
|
|
1670
|
+
return _context30.stop();
|
|
1539
1671
|
}
|
|
1540
|
-
},
|
|
1672
|
+
}, _callee30);
|
|
1541
1673
|
})));
|
|
1542
1674
|
});
|
|
1543
1675
|
describe('Supplementary Services tests', function () {
|
|
@@ -1596,10 +1728,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1596
1728
|
beforeEach(function () {
|
|
1597
1729
|
call.removeAllListeners();
|
|
1598
1730
|
});
|
|
1599
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1731
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1600
1732
|
var responsePayload, warnSpy, roapEvent;
|
|
1601
|
-
return _regenerator.default.wrap(function
|
|
1602
|
-
while (1) switch (
|
|
1733
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1734
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1603
1735
|
case 0:
|
|
1604
1736
|
expect.assertions(7);
|
|
1605
1737
|
responsePayload = {
|
|
@@ -1612,25 +1744,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1612
1744
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1613
1745
|
call['held'] = false;
|
|
1614
1746
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1615
|
-
var
|
|
1616
|
-
return _regenerator.default.wrap(function
|
|
1617
|
-
while (1) switch (
|
|
1747
|
+
var _ref32 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(correlationId) {
|
|
1748
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
1749
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1618
1750
|
case 0:
|
|
1619
1751
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1620
1752
|
case 1:
|
|
1621
1753
|
case "end":
|
|
1622
|
-
return
|
|
1754
|
+
return _context31.stop();
|
|
1623
1755
|
}
|
|
1624
|
-
},
|
|
1756
|
+
}, _callee31);
|
|
1625
1757
|
}));
|
|
1626
1758
|
return function (_x) {
|
|
1627
|
-
return
|
|
1759
|
+
return _ref32.apply(this, arguments);
|
|
1628
1760
|
};
|
|
1629
1761
|
}());
|
|
1630
|
-
|
|
1762
|
+
_context32.next = 10;
|
|
1631
1763
|
return call.doHoldResume();
|
|
1632
1764
|
case 10:
|
|
1633
|
-
|
|
1765
|
+
_context32.next = 12;
|
|
1634
1766
|
return (0, _testUtil.flushPromises)(2);
|
|
1635
1767
|
case 12:
|
|
1636
1768
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1646,11 +1778,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1646
1778
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1647
1779
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1648
1780
|
roapEvent.data.type = 'ANSWER';
|
|
1649
|
-
|
|
1781
|
+
_context32.next = 20;
|
|
1650
1782
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1651
1783
|
case 20:
|
|
1652
1784
|
roapEvent.data.type = 'OK';
|
|
1653
|
-
|
|
1785
|
+
_context32.next = 23;
|
|
1654
1786
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1655
1787
|
case 23:
|
|
1656
1788
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1665,14 +1797,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1665
1797
|
});
|
|
1666
1798
|
case 28:
|
|
1667
1799
|
case "end":
|
|
1668
|
-
return
|
|
1800
|
+
return _context32.stop();
|
|
1669
1801
|
}
|
|
1670
|
-
},
|
|
1802
|
+
}, _callee32);
|
|
1671
1803
|
})));
|
|
1672
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1804
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1673
1805
|
var responsePayload, warnSpy, roapEvent;
|
|
1674
|
-
return _regenerator.default.wrap(function
|
|
1675
|
-
while (1) switch (
|
|
1806
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1807
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1676
1808
|
case 0:
|
|
1677
1809
|
expect.assertions(8);
|
|
1678
1810
|
responsePayload = {
|
|
@@ -1685,26 +1817,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1685
1817
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1686
1818
|
call['held'] = false;
|
|
1687
1819
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1688
|
-
var
|
|
1689
|
-
return _regenerator.default.wrap(function
|
|
1690
|
-
while (1) switch (
|
|
1820
|
+
var _ref34 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(correlationId) {
|
|
1821
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1822
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1691
1823
|
case 0:
|
|
1692
1824
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1693
1825
|
case 1:
|
|
1694
1826
|
case "end":
|
|
1695
|
-
return
|
|
1827
|
+
return _context33.stop();
|
|
1696
1828
|
}
|
|
1697
|
-
},
|
|
1829
|
+
}, _callee33);
|
|
1698
1830
|
}));
|
|
1699
1831
|
return function (_x2) {
|
|
1700
|
-
return
|
|
1832
|
+
return _ref34.apply(this, arguments);
|
|
1701
1833
|
};
|
|
1702
1834
|
}());
|
|
1703
1835
|
call.doHoldResume();
|
|
1704
|
-
|
|
1836
|
+
_context34.next = 11;
|
|
1705
1837
|
return _promise.default.resolve();
|
|
1706
1838
|
case 11:
|
|
1707
|
-
|
|
1839
|
+
_context34.next = 13;
|
|
1708
1840
|
return _promise.default.resolve();
|
|
1709
1841
|
case 13:
|
|
1710
1842
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -1720,11 +1852,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1720
1852
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1721
1853
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1722
1854
|
roapEvent.data.type = 'ANSWER';
|
|
1723
|
-
|
|
1855
|
+
_context34.next = 22;
|
|
1724
1856
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1725
1857
|
case 22:
|
|
1726
1858
|
roapEvent.data.type = 'OK';
|
|
1727
|
-
|
|
1859
|
+
_context34.next = 25;
|
|
1728
1860
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1729
1861
|
case 25:
|
|
1730
1862
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -1739,14 +1871,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1739
1871
|
});
|
|
1740
1872
|
case 30:
|
|
1741
1873
|
case "end":
|
|
1742
|
-
return
|
|
1874
|
+
return _context34.stop();
|
|
1743
1875
|
}
|
|
1744
|
-
},
|
|
1876
|
+
}, _callee34);
|
|
1745
1877
|
})));
|
|
1746
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1878
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1747
1879
|
var responsePayload;
|
|
1748
|
-
return _regenerator.default.wrap(function
|
|
1749
|
-
while (1) switch (
|
|
1880
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
1881
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1750
1882
|
case 0:
|
|
1751
1883
|
expect.assertions(4);
|
|
1752
1884
|
responsePayload = {
|
|
@@ -1756,26 +1888,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1756
1888
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
1757
1889
|
call['held'] = false;
|
|
1758
1890
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1759
|
-
var
|
|
1760
|
-
return _regenerator.default.wrap(function
|
|
1761
|
-
while (1) switch (
|
|
1891
|
+
var _ref36 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(errObj) {
|
|
1892
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
1893
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1762
1894
|
case 0:
|
|
1763
1895
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
1764
1896
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
1765
1897
|
case 2:
|
|
1766
1898
|
case "end":
|
|
1767
|
-
return
|
|
1899
|
+
return _context35.stop();
|
|
1768
1900
|
}
|
|
1769
|
-
},
|
|
1901
|
+
}, _callee35);
|
|
1770
1902
|
}));
|
|
1771
1903
|
return function (_x3) {
|
|
1772
|
-
return
|
|
1904
|
+
return _ref36.apply(this, arguments);
|
|
1773
1905
|
};
|
|
1774
1906
|
}());
|
|
1775
|
-
|
|
1907
|
+
_context36.next = 7;
|
|
1776
1908
|
return call.doHoldResume();
|
|
1777
1909
|
case 7:
|
|
1778
|
-
|
|
1910
|
+
_context36.next = 9;
|
|
1779
1911
|
return (0, _testUtil.flushPromises)(2);
|
|
1780
1912
|
case 9:
|
|
1781
1913
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -1785,14 +1917,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1785
1917
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1786
1918
|
case 11:
|
|
1787
1919
|
case "end":
|
|
1788
|
-
return
|
|
1920
|
+
return _context36.stop();
|
|
1789
1921
|
}
|
|
1790
|
-
},
|
|
1922
|
+
}, _callee36);
|
|
1791
1923
|
})));
|
|
1792
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1924
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1793
1925
|
var responsePayload, rejectPayload, roapEvent;
|
|
1794
|
-
return _regenerator.default.wrap(function
|
|
1795
|
-
while (1) switch (
|
|
1926
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
1927
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1796
1928
|
case 0:
|
|
1797
1929
|
expect.assertions(5);
|
|
1798
1930
|
responsePayload = {
|
|
@@ -1806,24 +1938,24 @@ describe('Supplementary Services tests', function () {
|
|
|
1806
1938
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
1807
1939
|
call['held'] = false;
|
|
1808
1940
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1809
|
-
var
|
|
1810
|
-
return _regenerator.default.wrap(function
|
|
1811
|
-
while (1) switch (
|
|
1941
|
+
var _ref38 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(errObj) {
|
|
1942
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
1943
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1812
1944
|
case 0:
|
|
1813
1945
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
1814
1946
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
1815
1947
|
case 2:
|
|
1816
1948
|
case "end":
|
|
1817
|
-
return
|
|
1949
|
+
return _context37.stop();
|
|
1818
1950
|
}
|
|
1819
|
-
},
|
|
1951
|
+
}, _callee37);
|
|
1820
1952
|
}));
|
|
1821
1953
|
return function (_x4) {
|
|
1822
|
-
return
|
|
1954
|
+
return _ref38.apply(this, arguments);
|
|
1823
1955
|
};
|
|
1824
1956
|
}());
|
|
1825
1957
|
call.doHoldResume();
|
|
1826
|
-
|
|
1958
|
+
_context38.next = 9;
|
|
1827
1959
|
return (0, _testUtil.flushPromises)(2);
|
|
1828
1960
|
case 9:
|
|
1829
1961
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -1833,7 +1965,7 @@ describe('Supplementary Services tests', function () {
|
|
|
1833
1965
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1834
1966
|
/* We are intentionally failing the ROAP ANSWER */
|
|
1835
1967
|
roapEvent.data.type = 'ANSWER';
|
|
1836
|
-
|
|
1968
|
+
_context38.next = 15;
|
|
1837
1969
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1838
1970
|
case 15:
|
|
1839
1971
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -1841,14 +1973,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1841
1973
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1842
1974
|
case 17:
|
|
1843
1975
|
case "end":
|
|
1844
|
-
return
|
|
1976
|
+
return _context38.stop();
|
|
1845
1977
|
}
|
|
1846
|
-
},
|
|
1978
|
+
}, _callee38);
|
|
1847
1979
|
})));
|
|
1848
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1980
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1849
1981
|
var responsePayload, warnSpy, roapEvent;
|
|
1850
|
-
return _regenerator.default.wrap(function
|
|
1851
|
-
while (1) switch (
|
|
1982
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
1983
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1852
1984
|
case 0:
|
|
1853
1985
|
responsePayload = {
|
|
1854
1986
|
statusCode: 200,
|
|
@@ -1859,10 +1991,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1859
1991
|
jest.spyOn(global, 'clearTimeout');
|
|
1860
1992
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1861
1993
|
call['held'] = false;
|
|
1862
|
-
|
|
1994
|
+
_context39.next = 8;
|
|
1863
1995
|
return call.doHoldResume();
|
|
1864
1996
|
case 8:
|
|
1865
|
-
|
|
1997
|
+
_context39.next = 10;
|
|
1866
1998
|
return (0, _testUtil.flushPromises)(2);
|
|
1867
1999
|
case 10:
|
|
1868
2000
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1877,38 +2009,38 @@ describe('Supplementary Services tests', function () {
|
|
|
1877
2009
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1878
2010
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1879
2011
|
roapEvent.data.type = 'ANSWER';
|
|
1880
|
-
|
|
2012
|
+
_context39.next = 17;
|
|
1881
2013
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1882
2014
|
case 17:
|
|
1883
2015
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
1884
2016
|
statusCode: 403
|
|
1885
2017
|
});
|
|
1886
2018
|
roapEvent.data.type = 'OK';
|
|
1887
|
-
|
|
2019
|
+
_context39.next = 21;
|
|
1888
2020
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1889
2021
|
case 21:
|
|
1890
2022
|
/* this is for coverage */
|
|
1891
2023
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
1892
|
-
|
|
2024
|
+
_context39.next = 24;
|
|
1893
2025
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1894
2026
|
case 24:
|
|
1895
2027
|
expect(call.isHeld()).toStrictEqual(false);
|
|
1896
2028
|
/* We should return back to call established state */
|
|
1897
2029
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1898
|
-
expect(warnSpy).toHaveBeenCalledWith('
|
|
2030
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1899
2031
|
file: 'call',
|
|
1900
2032
|
method: 'handleRoapEstablished'
|
|
1901
2033
|
});
|
|
1902
2034
|
case 27:
|
|
1903
2035
|
case "end":
|
|
1904
|
-
return
|
|
2036
|
+
return _context39.stop();
|
|
1905
2037
|
}
|
|
1906
|
-
},
|
|
2038
|
+
}, _callee39);
|
|
1907
2039
|
})));
|
|
1908
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2040
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1909
2041
|
var responsePayload, warnSpy, roapEvent;
|
|
1910
|
-
return _regenerator.default.wrap(function
|
|
1911
|
-
while (1) switch (
|
|
2042
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
2043
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1912
2044
|
case 0:
|
|
1913
2045
|
responsePayload = {
|
|
1914
2046
|
statusCode: 200,
|
|
@@ -1919,10 +2051,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1919
2051
|
jest.spyOn(global, 'clearTimeout');
|
|
1920
2052
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1921
2053
|
call['held'] = true;
|
|
1922
|
-
|
|
2054
|
+
_context40.next = 8;
|
|
1923
2055
|
return call.doHoldResume();
|
|
1924
2056
|
case 8:
|
|
1925
|
-
|
|
2057
|
+
_context40.next = 10;
|
|
1926
2058
|
return (0, _testUtil.flushPromises)(2);
|
|
1927
2059
|
case 10:
|
|
1928
2060
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1937,33 +2069,33 @@ describe('Supplementary Services tests', function () {
|
|
|
1937
2069
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1938
2070
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1939
2071
|
roapEvent.data.type = 'ANSWER';
|
|
1940
|
-
|
|
2072
|
+
_context40.next = 17;
|
|
1941
2073
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1942
2074
|
case 17:
|
|
1943
2075
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
1944
2076
|
statusCode: 403
|
|
1945
2077
|
});
|
|
1946
2078
|
roapEvent.data.type = 'OK';
|
|
1947
|
-
|
|
2079
|
+
_context40.next = 21;
|
|
1948
2080
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1949
2081
|
case 21:
|
|
1950
2082
|
expect(call.isHeld()).toStrictEqual(true);
|
|
1951
2083
|
/* We should return back to call established state */
|
|
1952
2084
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1953
|
-
expect(warnSpy).toHaveBeenCalledWith('
|
|
2085
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1954
2086
|
file: 'call',
|
|
1955
2087
|
method: 'handleRoapEstablished'
|
|
1956
2088
|
});
|
|
1957
2089
|
case 24:
|
|
1958
2090
|
case "end":
|
|
1959
|
-
return
|
|
2091
|
+
return _context40.stop();
|
|
1960
2092
|
}
|
|
1961
|
-
},
|
|
2093
|
+
}, _callee40);
|
|
1962
2094
|
})));
|
|
1963
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2095
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
1964
2096
|
var responsePayload, roapEvent;
|
|
1965
|
-
return _regenerator.default.wrap(function
|
|
1966
|
-
while (1) switch (
|
|
2097
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2098
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
1967
2099
|
case 0:
|
|
1968
2100
|
expect.assertions(5);
|
|
1969
2101
|
responsePayload = {
|
|
@@ -1973,25 +2105,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1973
2105
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
1974
2106
|
call['held'] = false;
|
|
1975
2107
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1976
|
-
var
|
|
1977
|
-
return _regenerator.default.wrap(function
|
|
1978
|
-
while (1) switch (
|
|
2108
|
+
var _ref42 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(errObj) {
|
|
2109
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2110
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
1979
2111
|
case 0:
|
|
1980
2112
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
1981
2113
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
1982
2114
|
case 2:
|
|
1983
2115
|
case "end":
|
|
1984
|
-
return
|
|
2116
|
+
return _context41.stop();
|
|
1985
2117
|
}
|
|
1986
|
-
},
|
|
2118
|
+
}, _callee41);
|
|
1987
2119
|
}));
|
|
1988
2120
|
return function (_x5) {
|
|
1989
|
-
return
|
|
2121
|
+
return _ref42.apply(this, arguments);
|
|
1990
2122
|
};
|
|
1991
2123
|
}());
|
|
1992
2124
|
jest.runAllTimers();
|
|
1993
2125
|
call.doHoldResume();
|
|
1994
|
-
|
|
2126
|
+
_context42.next = 9;
|
|
1995
2127
|
return (0, _testUtil.flushPromises)(2);
|
|
1996
2128
|
case 9:
|
|
1997
2129
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2004,11 +2136,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2004
2136
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2005
2137
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2006
2138
|
roapEvent.data.type = 'ANSWER';
|
|
2007
|
-
|
|
2139
|
+
_context42.next = 15;
|
|
2008
2140
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2009
2141
|
case 15:
|
|
2010
2142
|
roapEvent.data.type = 'OK';
|
|
2011
|
-
|
|
2143
|
+
_context42.next = 18;
|
|
2012
2144
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2013
2145
|
case 18:
|
|
2014
2146
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2020,14 +2152,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2020
2152
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2021
2153
|
case 21:
|
|
2022
2154
|
case "end":
|
|
2023
|
-
return
|
|
2155
|
+
return _context42.stop();
|
|
2024
2156
|
}
|
|
2025
|
-
},
|
|
2157
|
+
}, _callee42);
|
|
2026
2158
|
})));
|
|
2027
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2159
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2028
2160
|
var responsePayload, warnSpy, roapEvent;
|
|
2029
|
-
return _regenerator.default.wrap(function
|
|
2030
|
-
while (1) switch (
|
|
2161
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2162
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2031
2163
|
case 0:
|
|
2032
2164
|
expect.assertions(7);
|
|
2033
2165
|
responsePayload = {
|
|
@@ -2040,25 +2172,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2040
2172
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2041
2173
|
call['held'] = true;
|
|
2042
2174
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2043
|
-
var
|
|
2044
|
-
return _regenerator.default.wrap(function
|
|
2045
|
-
while (1) switch (
|
|
2175
|
+
var _ref44 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(correlationId) {
|
|
2176
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2177
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2046
2178
|
case 0:
|
|
2047
2179
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2048
2180
|
case 1:
|
|
2049
2181
|
case "end":
|
|
2050
|
-
return
|
|
2182
|
+
return _context43.stop();
|
|
2051
2183
|
}
|
|
2052
|
-
},
|
|
2184
|
+
}, _callee43);
|
|
2053
2185
|
}));
|
|
2054
2186
|
return function (_x6) {
|
|
2055
|
-
return
|
|
2187
|
+
return _ref44.apply(this, arguments);
|
|
2056
2188
|
};
|
|
2057
2189
|
}());
|
|
2058
|
-
|
|
2190
|
+
_context44.next = 10;
|
|
2059
2191
|
return call.doHoldResume();
|
|
2060
2192
|
case 10:
|
|
2061
|
-
|
|
2193
|
+
_context44.next = 12;
|
|
2062
2194
|
return (0, _testUtil.flushPromises)(2);
|
|
2063
2195
|
case 12:
|
|
2064
2196
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2074,11 +2206,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2074
2206
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2075
2207
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2076
2208
|
roapEvent.data.type = 'ANSWER';
|
|
2077
|
-
|
|
2209
|
+
_context44.next = 20;
|
|
2078
2210
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2079
2211
|
case 20:
|
|
2080
2212
|
roapEvent.data.type = 'OK';
|
|
2081
|
-
|
|
2213
|
+
_context44.next = 23;
|
|
2082
2214
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2083
2215
|
case 23:
|
|
2084
2216
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2093,14 +2225,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2093
2225
|
});
|
|
2094
2226
|
case 28:
|
|
2095
2227
|
case "end":
|
|
2096
|
-
return
|
|
2228
|
+
return _context44.stop();
|
|
2097
2229
|
}
|
|
2098
|
-
},
|
|
2230
|
+
}, _callee44);
|
|
2099
2231
|
})));
|
|
2100
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2232
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2101
2233
|
var responsePayload, warnSpy, roapEvent;
|
|
2102
|
-
return _regenerator.default.wrap(function
|
|
2103
|
-
while (1) switch (
|
|
2234
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2235
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2104
2236
|
case 0:
|
|
2105
2237
|
expect.assertions(7);
|
|
2106
2238
|
responsePayload = {
|
|
@@ -2113,26 +2245,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2113
2245
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2114
2246
|
call['held'] = true;
|
|
2115
2247
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2116
|
-
var
|
|
2117
|
-
return _regenerator.default.wrap(function
|
|
2118
|
-
while (1) switch (
|
|
2248
|
+
var _ref46 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
|
|
2249
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2250
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2119
2251
|
case 0:
|
|
2120
2252
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2121
2253
|
case 1:
|
|
2122
2254
|
case "end":
|
|
2123
|
-
return
|
|
2255
|
+
return _context45.stop();
|
|
2124
2256
|
}
|
|
2125
|
-
},
|
|
2257
|
+
}, _callee45);
|
|
2126
2258
|
}));
|
|
2127
2259
|
return function (_x7) {
|
|
2128
|
-
return
|
|
2260
|
+
return _ref46.apply(this, arguments);
|
|
2129
2261
|
};
|
|
2130
2262
|
}());
|
|
2131
2263
|
call.doHoldResume();
|
|
2132
|
-
|
|
2264
|
+
_context46.next = 11;
|
|
2133
2265
|
return _promise.default.resolve();
|
|
2134
2266
|
case 11:
|
|
2135
|
-
|
|
2267
|
+
_context46.next = 13;
|
|
2136
2268
|
return _promise.default.resolve();
|
|
2137
2269
|
case 13:
|
|
2138
2270
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2148,11 +2280,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2148
2280
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2149
2281
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2150
2282
|
roapEvent.data.type = 'ANSWER';
|
|
2151
|
-
|
|
2283
|
+
_context46.next = 21;
|
|
2152
2284
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2153
2285
|
case 21:
|
|
2154
2286
|
roapEvent.data.type = 'OK';
|
|
2155
|
-
|
|
2287
|
+
_context46.next = 24;
|
|
2156
2288
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2157
2289
|
case 24:
|
|
2158
2290
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2167,14 +2299,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2167
2299
|
});
|
|
2168
2300
|
case 29:
|
|
2169
2301
|
case "end":
|
|
2170
|
-
return
|
|
2302
|
+
return _context46.stop();
|
|
2171
2303
|
}
|
|
2172
|
-
},
|
|
2304
|
+
}, _callee46);
|
|
2173
2305
|
})));
|
|
2174
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2306
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2175
2307
|
var responsePayload;
|
|
2176
|
-
return _regenerator.default.wrap(function
|
|
2177
|
-
while (1) switch (
|
|
2308
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2309
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2178
2310
|
case 0:
|
|
2179
2311
|
expect.assertions(4);
|
|
2180
2312
|
responsePayload = {
|
|
@@ -2184,26 +2316,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2184
2316
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2185
2317
|
call['held'] = true;
|
|
2186
2318
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2187
|
-
var
|
|
2188
|
-
return _regenerator.default.wrap(function
|
|
2189
|
-
while (1) switch (
|
|
2319
|
+
var _ref48 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(errObj) {
|
|
2320
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2321
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2190
2322
|
case 0:
|
|
2191
2323
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2192
2324
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2193
2325
|
case 2:
|
|
2194
2326
|
case "end":
|
|
2195
|
-
return
|
|
2327
|
+
return _context47.stop();
|
|
2196
2328
|
}
|
|
2197
|
-
},
|
|
2329
|
+
}, _callee47);
|
|
2198
2330
|
}));
|
|
2199
2331
|
return function (_x8) {
|
|
2200
|
-
return
|
|
2332
|
+
return _ref48.apply(this, arguments);
|
|
2201
2333
|
};
|
|
2202
2334
|
}());
|
|
2203
|
-
|
|
2335
|
+
_context48.next = 7;
|
|
2204
2336
|
return call.doHoldResume();
|
|
2205
2337
|
case 7:
|
|
2206
|
-
|
|
2338
|
+
_context48.next = 9;
|
|
2207
2339
|
return (0, _testUtil.flushPromises)(2);
|
|
2208
2340
|
case 9:
|
|
2209
2341
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2214,14 +2346,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2214
2346
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2215
2347
|
case 11:
|
|
2216
2348
|
case "end":
|
|
2217
|
-
return
|
|
2349
|
+
return _context48.stop();
|
|
2218
2350
|
}
|
|
2219
|
-
},
|
|
2351
|
+
}, _callee48);
|
|
2220
2352
|
})));
|
|
2221
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2353
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2222
2354
|
var responsePayload, rejectPayload, roapEvent;
|
|
2223
|
-
return _regenerator.default.wrap(function
|
|
2224
|
-
while (1) switch (
|
|
2355
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2356
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2225
2357
|
case 0:
|
|
2226
2358
|
expect.assertions(5);
|
|
2227
2359
|
responsePayload = {
|
|
@@ -2235,24 +2367,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2235
2367
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2236
2368
|
call['held'] = true;
|
|
2237
2369
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2238
|
-
var
|
|
2239
|
-
return _regenerator.default.wrap(function
|
|
2240
|
-
while (1) switch (
|
|
2370
|
+
var _ref50 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
|
|
2371
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2372
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2241
2373
|
case 0:
|
|
2242
2374
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2243
2375
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2244
2376
|
case 2:
|
|
2245
2377
|
case "end":
|
|
2246
|
-
return
|
|
2378
|
+
return _context49.stop();
|
|
2247
2379
|
}
|
|
2248
|
-
},
|
|
2380
|
+
}, _callee49);
|
|
2249
2381
|
}));
|
|
2250
2382
|
return function (_x9) {
|
|
2251
|
-
return
|
|
2383
|
+
return _ref50.apply(this, arguments);
|
|
2252
2384
|
};
|
|
2253
2385
|
}());
|
|
2254
2386
|
call.doHoldResume();
|
|
2255
|
-
|
|
2387
|
+
_context50.next = 9;
|
|
2256
2388
|
return (0, _testUtil.flushPromises)(2);
|
|
2257
2389
|
case 9:
|
|
2258
2390
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2263,7 +2395,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2263
2395
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2264
2396
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2265
2397
|
roapEvent.data.type = 'ANSWER';
|
|
2266
|
-
|
|
2398
|
+
_context50.next = 15;
|
|
2267
2399
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2268
2400
|
case 15:
|
|
2269
2401
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2271,14 +2403,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2271
2403
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2272
2404
|
case 17:
|
|
2273
2405
|
case "end":
|
|
2274
|
-
return
|
|
2406
|
+
return _context50.stop();
|
|
2275
2407
|
}
|
|
2276
|
-
},
|
|
2408
|
+
}, _callee50);
|
|
2277
2409
|
})));
|
|
2278
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2410
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2279
2411
|
var responsePayload, roapEvent;
|
|
2280
|
-
return _regenerator.default.wrap(function
|
|
2281
|
-
while (1) switch (
|
|
2412
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2413
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2282
2414
|
case 0:
|
|
2283
2415
|
expect.assertions(5);
|
|
2284
2416
|
responsePayload = {
|
|
@@ -2288,24 +2420,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2288
2420
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2289
2421
|
call['held'] = true;
|
|
2290
2422
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2291
|
-
var
|
|
2292
|
-
return _regenerator.default.wrap(function
|
|
2293
|
-
while (1) switch (
|
|
2423
|
+
var _ref52 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
|
|
2424
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2425
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2294
2426
|
case 0:
|
|
2295
2427
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2296
2428
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2297
2429
|
case 2:
|
|
2298
2430
|
case "end":
|
|
2299
|
-
return
|
|
2431
|
+
return _context51.stop();
|
|
2300
2432
|
}
|
|
2301
|
-
},
|
|
2433
|
+
}, _callee51);
|
|
2302
2434
|
}));
|
|
2303
2435
|
return function (_x10) {
|
|
2304
|
-
return
|
|
2436
|
+
return _ref52.apply(this, arguments);
|
|
2305
2437
|
};
|
|
2306
2438
|
}());
|
|
2307
2439
|
call.doHoldResume();
|
|
2308
|
-
|
|
2440
|
+
_context52.next = 8;
|
|
2309
2441
|
return (0, _testUtil.flushPromises)(2);
|
|
2310
2442
|
case 8:
|
|
2311
2443
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2318,11 +2450,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2318
2450
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2319
2451
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2320
2452
|
roapEvent.data.type = 'ANSWER';
|
|
2321
|
-
|
|
2453
|
+
_context52.next = 14;
|
|
2322
2454
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2323
2455
|
case 14:
|
|
2324
2456
|
roapEvent.data.type = 'OK';
|
|
2325
|
-
|
|
2457
|
+
_context52.next = 17;
|
|
2326
2458
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2327
2459
|
case 17:
|
|
2328
2460
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2332,9 +2464,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2332
2464
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2333
2465
|
case 20:
|
|
2334
2466
|
case "end":
|
|
2335
|
-
return
|
|
2467
|
+
return _context52.stop();
|
|
2336
2468
|
}
|
|
2337
|
-
},
|
|
2469
|
+
}, _callee52);
|
|
2338
2470
|
})));
|
|
2339
2471
|
});
|
|
2340
2472
|
describe('Call transfer tests', function () {
|
|
@@ -2366,10 +2498,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2366
2498
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2367
2499
|
secondCall['held'] = false;
|
|
2368
2500
|
});
|
|
2369
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2501
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2370
2502
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2371
|
-
return _regenerator.default.wrap(function
|
|
2372
|
-
while (1) switch (
|
|
2503
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2504
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2373
2505
|
case 0:
|
|
2374
2506
|
expect.assertions(9);
|
|
2375
2507
|
responsePayload = {
|
|
@@ -2381,41 +2513,41 @@ describe('Supplementary Services tests', function () {
|
|
|
2381
2513
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2382
2514
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2383
2515
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2384
|
-
var
|
|
2385
|
-
return _regenerator.default.wrap(function
|
|
2386
|
-
while (1) switch (
|
|
2516
|
+
var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(correlationId) {
|
|
2517
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2518
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2387
2519
|
case 0:
|
|
2388
2520
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2389
2521
|
case 1:
|
|
2390
2522
|
case "end":
|
|
2391
|
-
return
|
|
2523
|
+
return _context53.stop();
|
|
2392
2524
|
}
|
|
2393
|
-
},
|
|
2525
|
+
}, _callee53);
|
|
2394
2526
|
}));
|
|
2395
2527
|
return function (_x11) {
|
|
2396
|
-
return
|
|
2528
|
+
return _ref54.apply(this, arguments);
|
|
2397
2529
|
};
|
|
2398
2530
|
}());
|
|
2399
2531
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2400
|
-
var
|
|
2401
|
-
return _regenerator.default.wrap(function
|
|
2402
|
-
while (1) switch (
|
|
2532
|
+
var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(correlationId) {
|
|
2533
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2534
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2403
2535
|
case 0:
|
|
2404
2536
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
2405
2537
|
case 1:
|
|
2406
2538
|
case "end":
|
|
2407
|
-
return
|
|
2539
|
+
return _context54.stop();
|
|
2408
2540
|
}
|
|
2409
|
-
},
|
|
2541
|
+
}, _callee54);
|
|
2410
2542
|
}));
|
|
2411
2543
|
return function (_x12) {
|
|
2412
|
-
return
|
|
2544
|
+
return _ref55.apply(this, arguments);
|
|
2413
2545
|
};
|
|
2414
2546
|
}());
|
|
2415
|
-
|
|
2547
|
+
_context55.next = 10;
|
|
2416
2548
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2417
2549
|
case 10:
|
|
2418
|
-
|
|
2550
|
+
_context55.next = 12;
|
|
2419
2551
|
return (0, _testUtil.flushPromises)(2);
|
|
2420
2552
|
case 12:
|
|
2421
2553
|
expect(requestSpy).toBeCalled();
|
|
@@ -2435,14 +2567,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2435
2567
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2436
2568
|
case 21:
|
|
2437
2569
|
case "end":
|
|
2438
|
-
return
|
|
2570
|
+
return _context55.stop();
|
|
2439
2571
|
}
|
|
2440
|
-
},
|
|
2572
|
+
}, _callee55);
|
|
2441
2573
|
})));
|
|
2442
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2574
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2443
2575
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2444
|
-
return _regenerator.default.wrap(function
|
|
2445
|
-
while (1) switch (
|
|
2576
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2577
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2446
2578
|
case 0:
|
|
2447
2579
|
expect.assertions(7);
|
|
2448
2580
|
responsePayload = {
|
|
@@ -2454,25 +2586,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2454
2586
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2455
2587
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2456
2588
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2457
|
-
var
|
|
2458
|
-
return _regenerator.default.wrap(function
|
|
2459
|
-
while (1) switch (
|
|
2589
|
+
var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
|
|
2590
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2591
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2460
2592
|
case 0:
|
|
2461
2593
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2462
2594
|
case 1:
|
|
2463
2595
|
case "end":
|
|
2464
|
-
return
|
|
2596
|
+
return _context56.stop();
|
|
2465
2597
|
}
|
|
2466
|
-
},
|
|
2598
|
+
}, _callee56);
|
|
2467
2599
|
}));
|
|
2468
2600
|
return function (_x13) {
|
|
2469
|
-
return
|
|
2601
|
+
return _ref57.apply(this, arguments);
|
|
2470
2602
|
};
|
|
2471
2603
|
}());
|
|
2472
|
-
|
|
2604
|
+
_context57.next = 9;
|
|
2473
2605
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2474
2606
|
case 9:
|
|
2475
|
-
|
|
2607
|
+
_context57.next = 11;
|
|
2476
2608
|
return (0, _testUtil.flushPromises)(2);
|
|
2477
2609
|
case 11:
|
|
2478
2610
|
expect(requestSpy).toBeCalled();
|
|
@@ -2488,14 +2620,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2488
2620
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2489
2621
|
case 18:
|
|
2490
2622
|
case "end":
|
|
2491
|
-
return
|
|
2623
|
+
return _context57.stop();
|
|
2492
2624
|
}
|
|
2493
|
-
},
|
|
2625
|
+
}, _callee57);
|
|
2494
2626
|
})));
|
|
2495
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2627
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2496
2628
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2497
|
-
return _regenerator.default.wrap(function
|
|
2498
|
-
while (1) switch (
|
|
2629
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2630
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2499
2631
|
case 0:
|
|
2500
2632
|
responsePayload = {
|
|
2501
2633
|
statusCode: 403,
|
|
@@ -2505,10 +2637,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2505
2637
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2506
2638
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2507
2639
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2508
|
-
|
|
2640
|
+
_context58.next = 7;
|
|
2509
2641
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2510
2642
|
case 7:
|
|
2511
|
-
|
|
2643
|
+
_context58.next = 9;
|
|
2512
2644
|
return (0, _testUtil.flushPromises)(1);
|
|
2513
2645
|
case 9:
|
|
2514
2646
|
expect(requestSpy).toBeCalled();
|
|
@@ -2524,14 +2656,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2524
2656
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
2525
2657
|
case 16:
|
|
2526
2658
|
case "end":
|
|
2527
|
-
return
|
|
2659
|
+
return _context58.stop();
|
|
2528
2660
|
}
|
|
2529
|
-
},
|
|
2661
|
+
}, _callee58);
|
|
2530
2662
|
})));
|
|
2531
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2663
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
2532
2664
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2533
|
-
return _regenerator.default.wrap(function
|
|
2534
|
-
while (1) switch (
|
|
2665
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
2666
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2535
2667
|
case 0:
|
|
2536
2668
|
responsePayload = {
|
|
2537
2669
|
statusCode: 403,
|
|
@@ -2541,10 +2673,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2541
2673
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2542
2674
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2543
2675
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2544
|
-
|
|
2676
|
+
_context59.next = 7;
|
|
2545
2677
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2546
2678
|
case 7:
|
|
2547
|
-
|
|
2679
|
+
_context59.next = 9;
|
|
2548
2680
|
return (0, _testUtil.flushPromises)(2);
|
|
2549
2681
|
case 9:
|
|
2550
2682
|
expect(requestSpy).toBeCalled();
|
|
@@ -2561,18 +2693,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2561
2693
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
2562
2694
|
case 17:
|
|
2563
2695
|
case "end":
|
|
2564
|
-
return
|
|
2696
|
+
return _context59.stop();
|
|
2565
2697
|
}
|
|
2566
|
-
},
|
|
2698
|
+
}, _callee59);
|
|
2567
2699
|
})));
|
|
2568
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2700
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
2569
2701
|
var requestSpy, warnSpy;
|
|
2570
|
-
return _regenerator.default.wrap(function
|
|
2571
|
-
while (1) switch (
|
|
2702
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
2703
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2572
2704
|
case 0:
|
|
2573
2705
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2574
2706
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2575
|
-
|
|
2707
|
+
_context60.next = 4;
|
|
2576
2708
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
2577
2709
|
case 4:
|
|
2578
2710
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2583,18 +2715,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2583
2715
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2584
2716
|
case 9:
|
|
2585
2717
|
case "end":
|
|
2586
|
-
return
|
|
2718
|
+
return _context60.stop();
|
|
2587
2719
|
}
|
|
2588
|
-
},
|
|
2720
|
+
}, _callee60);
|
|
2589
2721
|
})));
|
|
2590
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2722
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
2591
2723
|
var requestSpy, warnSpy;
|
|
2592
|
-
return _regenerator.default.wrap(function
|
|
2593
|
-
while (1) switch (
|
|
2724
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
2725
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
2594
2726
|
case 0:
|
|
2595
2727
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2596
2728
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2597
|
-
|
|
2729
|
+
_context61.next = 4;
|
|
2598
2730
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
2599
2731
|
case 4:
|
|
2600
2732
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2605,9 +2737,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2605
2737
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2606
2738
|
case 9:
|
|
2607
2739
|
case "end":
|
|
2608
|
-
return
|
|
2740
|
+
return _context61.stop();
|
|
2609
2741
|
}
|
|
2610
|
-
},
|
|
2742
|
+
}, _callee61);
|
|
2611
2743
|
})));
|
|
2612
2744
|
});
|
|
2613
2745
|
});
|