@webex/calling 3.0.0-next.2 → 3.0.0-next.20
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 +59 -32
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +430 -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 +41 -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 +1 -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 +29 -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,82 @@ 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 dialling 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
|
+
})));
|
|
364
443
|
});
|
|
365
444
|
describe('State Machine handler tests', function () {
|
|
366
445
|
var deviceId = '55dfb53f-bed2-36da-8e85-cee7f02aa68e';
|
|
@@ -391,10 +470,10 @@ describe('State Machine handler tests', function () {
|
|
|
391
470
|
|
|
392
471
|
// afterEach(() => call.removeAllListeners());
|
|
393
472
|
|
|
394
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
473
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
395
474
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
396
|
-
return _regenerator.default.wrap(function
|
|
397
|
-
while (1) switch (
|
|
475
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
476
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
398
477
|
case 0:
|
|
399
478
|
statusPayload = {
|
|
400
479
|
statusCode: 200,
|
|
@@ -414,7 +493,7 @@ describe('State Machine handler tests', function () {
|
|
|
414
493
|
/* This is to flush all the promises from the Promise queue so that
|
|
415
494
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
416
495
|
*/
|
|
417
|
-
|
|
496
|
+
_context10.next = 11;
|
|
418
497
|
return (0, _testUtil.flushPromises)(3);
|
|
419
498
|
case 11:
|
|
420
499
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -425,14 +504,14 @@ describe('State Machine handler tests', function () {
|
|
|
425
504
|
});
|
|
426
505
|
case 14:
|
|
427
506
|
case "end":
|
|
428
|
-
return
|
|
507
|
+
return _context10.stop();
|
|
429
508
|
}
|
|
430
|
-
},
|
|
509
|
+
}, _callee10);
|
|
431
510
|
})));
|
|
432
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
511
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
433
512
|
var statusPayload, funcSpy;
|
|
434
|
-
return _regenerator.default.wrap(function
|
|
435
|
-
while (1) switch (
|
|
513
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
514
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
436
515
|
case 0:
|
|
437
516
|
expect.assertions(4);
|
|
438
517
|
statusPayload = {
|
|
@@ -456,24 +535,24 @@ describe('State Machine handler tests', function () {
|
|
|
456
535
|
/* This is to flush all the promises from the Promise queue so that
|
|
457
536
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
458
537
|
*/
|
|
459
|
-
|
|
538
|
+
_context11.next = 11;
|
|
460
539
|
return _promise.default.resolve();
|
|
461
540
|
case 11:
|
|
462
|
-
|
|
541
|
+
_context11.next = 13;
|
|
463
542
|
return _promise.default.resolve();
|
|
464
543
|
case 13:
|
|
465
544
|
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
466
545
|
expect(funcSpy).toBeCalledTimes(1);
|
|
467
546
|
case 15:
|
|
468
547
|
case "end":
|
|
469
|
-
return
|
|
548
|
+
return _context11.stop();
|
|
470
549
|
}
|
|
471
|
-
},
|
|
550
|
+
}, _callee11);
|
|
472
551
|
})));
|
|
473
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
552
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
474
553
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
475
|
-
return _regenerator.default.wrap(function
|
|
476
|
-
while (1) switch (
|
|
554
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
555
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
477
556
|
case 0:
|
|
478
557
|
statusPayload = {
|
|
479
558
|
statusCode: 200,
|
|
@@ -529,14 +608,14 @@ describe('State Machine handler tests', function () {
|
|
|
529
608
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
530
609
|
case 27:
|
|
531
610
|
case "end":
|
|
532
|
-
return
|
|
611
|
+
return _context12.stop();
|
|
533
612
|
}
|
|
534
|
-
},
|
|
613
|
+
}, _callee12);
|
|
535
614
|
})));
|
|
536
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
615
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
537
616
|
var statusPayload, dummyEvent;
|
|
538
|
-
return _regenerator.default.wrap(function
|
|
539
|
-
while (1) switch (
|
|
617
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
618
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
540
619
|
case 0:
|
|
541
620
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
542
621
|
statusPayload = {
|
|
@@ -554,7 +633,7 @@ describe('State Machine handler tests', function () {
|
|
|
554
633
|
webex.request.mockReturnValue(statusPayload);
|
|
555
634
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
556
635
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
557
|
-
|
|
636
|
+
_context13.next = 8;
|
|
558
637
|
return call['handleOutgoingCallConnect']({
|
|
559
638
|
type: 'E_SEND_CALL_CONNECT'
|
|
560
639
|
});
|
|
@@ -568,14 +647,14 @@ describe('State Machine handler tests', function () {
|
|
|
568
647
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
569
648
|
case 12:
|
|
570
649
|
case "end":
|
|
571
|
-
return
|
|
650
|
+
return _context13.stop();
|
|
572
651
|
}
|
|
573
|
-
},
|
|
652
|
+
}, _callee13);
|
|
574
653
|
})));
|
|
575
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
654
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
576
655
|
var warnSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
577
|
-
return _regenerator.default.wrap(function
|
|
578
|
-
while (1) switch (
|
|
656
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
657
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
579
658
|
case 0:
|
|
580
659
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
581
660
|
stateMachineSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
@@ -601,7 +680,7 @@ describe('State Machine handler tests', function () {
|
|
|
601
680
|
webex.request.mockRejectedValueOnce({
|
|
602
681
|
statusCode: 403
|
|
603
682
|
}).mockResolvedValue(statusPayload);
|
|
604
|
-
|
|
683
|
+
_context14.next = 12;
|
|
605
684
|
return call['handleOutgoingCallConnect']({
|
|
606
685
|
type: 'E_SEND_CALL_CONNECT'
|
|
607
686
|
});
|
|
@@ -618,14 +697,14 @@ describe('State Machine handler tests', function () {
|
|
|
618
697
|
});
|
|
619
698
|
case 18:
|
|
620
699
|
case "end":
|
|
621
|
-
return
|
|
700
|
+
return _context14.stop();
|
|
622
701
|
}
|
|
623
|
-
},
|
|
702
|
+
}, _callee14);
|
|
624
703
|
})));
|
|
625
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
704
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
626
705
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent;
|
|
627
|
-
return _regenerator.default.wrap(function
|
|
628
|
-
while (1) switch (
|
|
706
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
707
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
629
708
|
case 0:
|
|
630
709
|
statusPayload = {
|
|
631
710
|
statusCode: 200,
|
|
@@ -699,14 +778,14 @@ describe('State Machine handler tests', function () {
|
|
|
699
778
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
700
779
|
case 40:
|
|
701
780
|
case "end":
|
|
702
|
-
return
|
|
781
|
+
return _context15.stop();
|
|
703
782
|
}
|
|
704
|
-
},
|
|
783
|
+
}, _callee15);
|
|
705
784
|
})));
|
|
706
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
785
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
707
786
|
var statusPayload, dummyEvent;
|
|
708
|
-
return _regenerator.default.wrap(function
|
|
709
|
-
while (1) switch (
|
|
787
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
788
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
710
789
|
case 0:
|
|
711
790
|
statusPayload = {
|
|
712
791
|
statusCode: 200,
|
|
@@ -745,14 +824,14 @@ describe('State Machine handler tests', function () {
|
|
|
745
824
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
746
825
|
case 17:
|
|
747
826
|
case "end":
|
|
748
|
-
return
|
|
827
|
+
return _context16.stop();
|
|
749
828
|
}
|
|
750
|
-
},
|
|
829
|
+
}, _callee16);
|
|
751
830
|
})));
|
|
752
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
831
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
753
832
|
var statusPayload, dummyEvent;
|
|
754
|
-
return _regenerator.default.wrap(function
|
|
755
|
-
while (1) switch (
|
|
833
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
834
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
756
835
|
case 0:
|
|
757
836
|
statusPayload = {
|
|
758
837
|
statusCode: 403,
|
|
@@ -768,20 +847,20 @@ describe('State Machine handler tests', function () {
|
|
|
768
847
|
};
|
|
769
848
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
770
849
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
771
|
-
|
|
850
|
+
_context17.next = 6;
|
|
772
851
|
return (0, _testUtil.flushPromises)(3);
|
|
773
852
|
case 6:
|
|
774
853
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
775
854
|
case 7:
|
|
776
855
|
case "end":
|
|
777
|
-
return
|
|
856
|
+
return _context17.stop();
|
|
778
857
|
}
|
|
779
|
-
},
|
|
858
|
+
}, _callee17);
|
|
780
859
|
})));
|
|
781
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
860
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
782
861
|
var statusPayload, dummyEvent;
|
|
783
|
-
return _regenerator.default.wrap(function
|
|
784
|
-
while (1) switch (
|
|
862
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
863
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
785
864
|
case 0:
|
|
786
865
|
statusPayload = {
|
|
787
866
|
statusCode: 403,
|
|
@@ -798,10 +877,10 @@ describe('State Machine handler tests', function () {
|
|
|
798
877
|
call['earlyMedia'] = true;
|
|
799
878
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
800
879
|
webex.request.mockRejectedValue(statusPayload);
|
|
801
|
-
|
|
880
|
+
_context18.next = 8;
|
|
802
881
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
803
882
|
case 8:
|
|
804
|
-
|
|
883
|
+
_context18.next = 10;
|
|
805
884
|
return (0, _testUtil.flushPromises)(2);
|
|
806
885
|
case 10:
|
|
807
886
|
expect(call.isConnected()).toBe(false);
|
|
@@ -809,14 +888,14 @@ describe('State Machine handler tests', function () {
|
|
|
809
888
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
810
889
|
case 13:
|
|
811
890
|
case "end":
|
|
812
|
-
return
|
|
891
|
+
return _context18.stop();
|
|
813
892
|
}
|
|
814
|
-
},
|
|
893
|
+
}, _callee18);
|
|
815
894
|
})));
|
|
816
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
895
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
817
896
|
var statusPayload, dummyEvent;
|
|
818
|
-
return _regenerator.default.wrap(function
|
|
819
|
-
while (1) switch (
|
|
897
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
898
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
820
899
|
case 0:
|
|
821
900
|
statusPayload = {
|
|
822
901
|
statusCode: 403,
|
|
@@ -839,14 +918,14 @@ describe('State Machine handler tests', function () {
|
|
|
839
918
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
840
919
|
case 8:
|
|
841
920
|
case "end":
|
|
842
|
-
return
|
|
921
|
+
return _context19.stop();
|
|
843
922
|
}
|
|
844
|
-
},
|
|
923
|
+
}, _callee19);
|
|
845
924
|
})));
|
|
846
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
925
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
847
926
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
848
|
-
return _regenerator.default.wrap(function
|
|
849
|
-
while (1) switch (
|
|
927
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
928
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
850
929
|
case 0:
|
|
851
930
|
statusPayload = {
|
|
852
931
|
statusCode: 503,
|
|
@@ -868,7 +947,7 @@ describe('State Machine handler tests', function () {
|
|
|
868
947
|
}
|
|
869
948
|
};
|
|
870
949
|
call['connected'] = true;
|
|
871
|
-
|
|
950
|
+
_context20.next = 8;
|
|
872
951
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
873
952
|
case 8:
|
|
874
953
|
jest.advanceTimersByTime(1005);
|
|
@@ -880,14 +959,14 @@ describe('State Machine handler tests', function () {
|
|
|
880
959
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
881
960
|
case 13:
|
|
882
961
|
case "end":
|
|
883
|
-
return
|
|
962
|
+
return _context20.stop();
|
|
884
963
|
}
|
|
885
|
-
},
|
|
964
|
+
}, _callee20);
|
|
886
965
|
})));
|
|
887
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
966
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
888
967
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
889
|
-
return _regenerator.default.wrap(function
|
|
890
|
-
while (1) switch (
|
|
968
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
969
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
891
970
|
case 0:
|
|
892
971
|
statusPayload = {
|
|
893
972
|
statusCode: 503,
|
|
@@ -909,7 +988,7 @@ describe('State Machine handler tests', function () {
|
|
|
909
988
|
}
|
|
910
989
|
};
|
|
911
990
|
call['connected'] = false;
|
|
912
|
-
|
|
991
|
+
_context21.next = 8;
|
|
913
992
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
914
993
|
case 8:
|
|
915
994
|
jest.advanceTimersByTime(1005);
|
|
@@ -920,14 +999,14 @@ describe('State Machine handler tests', function () {
|
|
|
920
999
|
expect(stateMachineSpy).not.toBeCalled();
|
|
921
1000
|
case 12:
|
|
922
1001
|
case "end":
|
|
923
|
-
return
|
|
1002
|
+
return _context21.stop();
|
|
924
1003
|
}
|
|
925
|
-
},
|
|
1004
|
+
}, _callee21);
|
|
926
1005
|
})));
|
|
927
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1006
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
928
1007
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
929
|
-
return _regenerator.default.wrap(function
|
|
930
|
-
while (1) switch (
|
|
1008
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
1009
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
931
1010
|
case 0:
|
|
932
1011
|
statusPayload = {
|
|
933
1012
|
statusCode: 503,
|
|
@@ -949,7 +1028,7 @@ describe('State Machine handler tests', function () {
|
|
|
949
1028
|
};
|
|
950
1029
|
call['connected'] = true;
|
|
951
1030
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
952
|
-
|
|
1031
|
+
_context22.next = 9;
|
|
953
1032
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
954
1033
|
case 9:
|
|
955
1034
|
jest.advanceTimersByTime(1005);
|
|
@@ -961,14 +1040,14 @@ describe('State Machine handler tests', function () {
|
|
|
961
1040
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
962
1041
|
case 14:
|
|
963
1042
|
case "end":
|
|
964
|
-
return
|
|
1043
|
+
return _context22.stop();
|
|
965
1044
|
}
|
|
966
|
-
},
|
|
1045
|
+
}, _callee22);
|
|
967
1046
|
})));
|
|
968
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1047
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
969
1048
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
970
|
-
return _regenerator.default.wrap(function
|
|
971
|
-
while (1) switch (
|
|
1049
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
1050
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
972
1051
|
case 0:
|
|
973
1052
|
statusPayload = {
|
|
974
1053
|
statusCode: 503,
|
|
@@ -989,7 +1068,7 @@ describe('State Machine handler tests', function () {
|
|
|
989
1068
|
}
|
|
990
1069
|
};
|
|
991
1070
|
call['connected'] = false;
|
|
992
|
-
|
|
1071
|
+
_context23.next = 8;
|
|
993
1072
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
994
1073
|
case 8:
|
|
995
1074
|
jest.advanceTimersByTime(1005);
|
|
@@ -1001,14 +1080,14 @@ describe('State Machine handler tests', function () {
|
|
|
1001
1080
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1002
1081
|
case 13:
|
|
1003
1082
|
case "end":
|
|
1004
|
-
return
|
|
1083
|
+
return _context23.stop();
|
|
1005
1084
|
}
|
|
1006
|
-
},
|
|
1085
|
+
}, _callee23);
|
|
1007
1086
|
})));
|
|
1008
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1087
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1009
1088
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1010
|
-
return _regenerator.default.wrap(function
|
|
1011
|
-
while (1) switch (
|
|
1089
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
1090
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1012
1091
|
case 0:
|
|
1013
1092
|
statusPayload = {
|
|
1014
1093
|
statusCode: 200,
|
|
@@ -1033,14 +1112,14 @@ describe('State Machine handler tests', function () {
|
|
|
1033
1112
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1034
1113
|
case 11:
|
|
1035
1114
|
case "end":
|
|
1036
|
-
return
|
|
1115
|
+
return _context24.stop();
|
|
1037
1116
|
}
|
|
1038
|
-
},
|
|
1117
|
+
}, _callee24);
|
|
1039
1118
|
})));
|
|
1040
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1119
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1041
1120
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1042
|
-
return _regenerator.default.wrap(function
|
|
1043
|
-
while (1) switch (
|
|
1121
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
1122
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1044
1123
|
case 0:
|
|
1045
1124
|
statusPayload = {
|
|
1046
1125
|
statusCode: 503,
|
|
@@ -1062,7 +1141,7 @@ describe('State Machine handler tests', function () {
|
|
|
1062
1141
|
};
|
|
1063
1142
|
call['connected'] = true;
|
|
1064
1143
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1065
|
-
|
|
1144
|
+
_context25.next = 9;
|
|
1066
1145
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1067
1146
|
case 9:
|
|
1068
1147
|
jest.advanceTimersByTime(1005);
|
|
@@ -1074,14 +1153,14 @@ describe('State Machine handler tests', function () {
|
|
|
1074
1153
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1075
1154
|
case 14:
|
|
1076
1155
|
case "end":
|
|
1077
|
-
return
|
|
1156
|
+
return _context25.stop();
|
|
1078
1157
|
}
|
|
1079
|
-
},
|
|
1158
|
+
}, _callee25);
|
|
1080
1159
|
})));
|
|
1081
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1160
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1082
1161
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1083
|
-
return _regenerator.default.wrap(function
|
|
1084
|
-
while (1) switch (
|
|
1162
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
1163
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1085
1164
|
case 0:
|
|
1086
1165
|
statusPayload = {
|
|
1087
1166
|
statusCode: 403,
|
|
@@ -1104,14 +1183,14 @@ describe('State Machine handler tests', function () {
|
|
|
1104
1183
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1105
1184
|
case 9:
|
|
1106
1185
|
case "end":
|
|
1107
|
-
return
|
|
1186
|
+
return _context26.stop();
|
|
1108
1187
|
}
|
|
1109
|
-
},
|
|
1188
|
+
}, _callee26);
|
|
1110
1189
|
})));
|
|
1111
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1190
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1112
1191
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1113
|
-
return _regenerator.default.wrap(function
|
|
1114
|
-
while (1) switch (
|
|
1192
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
1193
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1115
1194
|
case 0:
|
|
1116
1195
|
statusPayload = {
|
|
1117
1196
|
statusCode: 200,
|
|
@@ -1129,7 +1208,7 @@ describe('State Machine handler tests', function () {
|
|
|
1129
1208
|
}
|
|
1130
1209
|
};
|
|
1131
1210
|
call['connected'] = false;
|
|
1132
|
-
|
|
1211
|
+
_context27.next = 8;
|
|
1133
1212
|
return call['handleRoapError']({}, errorEvent);
|
|
1134
1213
|
case 8:
|
|
1135
1214
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1145,14 +1224,14 @@ describe('State Machine handler tests', function () {
|
|
|
1145
1224
|
});
|
|
1146
1225
|
case 11:
|
|
1147
1226
|
case "end":
|
|
1148
|
-
return
|
|
1227
|
+
return _context27.stop();
|
|
1149
1228
|
}
|
|
1150
|
-
},
|
|
1229
|
+
}, _callee27);
|
|
1151
1230
|
})));
|
|
1152
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1231
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1153
1232
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1154
|
-
return _regenerator.default.wrap(function
|
|
1155
|
-
while (1) switch (
|
|
1233
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
1234
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1156
1235
|
case 0:
|
|
1157
1236
|
statusPayload = {
|
|
1158
1237
|
statusCode: 200,
|
|
@@ -1185,7 +1264,7 @@ describe('State Machine handler tests', function () {
|
|
|
1185
1264
|
seq: 1,
|
|
1186
1265
|
messageType: 'ANSWER'
|
|
1187
1266
|
};
|
|
1188
|
-
|
|
1267
|
+
_context28.next = 17;
|
|
1189
1268
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1190
1269
|
case 17:
|
|
1191
1270
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1207,7 +1286,7 @@ describe('State Machine handler tests', function () {
|
|
|
1207
1286
|
seq: 2,
|
|
1208
1287
|
messageType: 'OFFER_REQUEST'
|
|
1209
1288
|
};
|
|
1210
|
-
|
|
1289
|
+
_context28.next = 23;
|
|
1211
1290
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1212
1291
|
case 23:
|
|
1213
1292
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1257,7 +1336,7 @@ describe('State Machine handler tests', function () {
|
|
|
1257
1336
|
};
|
|
1258
1337
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1259
1338
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1260
|
-
|
|
1339
|
+
_context28.next = 49;
|
|
1261
1340
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1262
1341
|
case 49:
|
|
1263
1342
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1266,7 +1345,7 @@ describe('State Machine handler tests', function () {
|
|
|
1266
1345
|
seq: 3,
|
|
1267
1346
|
messageType: 'ANSWER'
|
|
1268
1347
|
};
|
|
1269
|
-
|
|
1348
|
+
_context28.next = 54;
|
|
1270
1349
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1271
1350
|
case 54:
|
|
1272
1351
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1285,7 +1364,7 @@ describe('State Machine handler tests', function () {
|
|
|
1285
1364
|
messageType: 'OK'
|
|
1286
1365
|
}
|
|
1287
1366
|
};
|
|
1288
|
-
|
|
1367
|
+
_context28.next = 63;
|
|
1289
1368
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1290
1369
|
case 63:
|
|
1291
1370
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1300,14 +1379,14 @@ describe('State Machine handler tests', function () {
|
|
|
1300
1379
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1301
1380
|
case 70:
|
|
1302
1381
|
case "end":
|
|
1303
|
-
return
|
|
1382
|
+
return _context28.stop();
|
|
1304
1383
|
}
|
|
1305
|
-
},
|
|
1384
|
+
}, _callee28);
|
|
1306
1385
|
})));
|
|
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
|
|
1386
|
+
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
1387
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1309
|
-
return _regenerator.default.wrap(function
|
|
1310
|
-
while (1) switch (
|
|
1388
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1389
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1311
1390
|
case 0:
|
|
1312
1391
|
mockStatusBody = {
|
|
1313
1392
|
device: {
|
|
@@ -1347,7 +1426,7 @@ describe('State Machine handler tests', function () {
|
|
|
1347
1426
|
seq: 1,
|
|
1348
1427
|
messageType: 'ANSWER'
|
|
1349
1428
|
};
|
|
1350
|
-
|
|
1429
|
+
_context29.next = 18;
|
|
1351
1430
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1352
1431
|
case 18:
|
|
1353
1432
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1369,7 +1448,7 @@ describe('State Machine handler tests', function () {
|
|
|
1369
1448
|
seq: 2,
|
|
1370
1449
|
messageType: 'OFFER_REQUEST'
|
|
1371
1450
|
};
|
|
1372
|
-
|
|
1451
|
+
_context29.next = 24;
|
|
1373
1452
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1374
1453
|
case 24:
|
|
1375
1454
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1419,7 +1498,7 @@ describe('State Machine handler tests', function () {
|
|
|
1419
1498
|
};
|
|
1420
1499
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1421
1500
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1422
|
-
|
|
1501
|
+
_context29.next = 50;
|
|
1423
1502
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1424
1503
|
case 50:
|
|
1425
1504
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1428,7 +1507,7 @@ describe('State Machine handler tests', function () {
|
|
|
1428
1507
|
seq: 3,
|
|
1429
1508
|
messageType: 'ANSWER'
|
|
1430
1509
|
};
|
|
1431
|
-
|
|
1510
|
+
_context29.next = 55;
|
|
1432
1511
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1433
1512
|
case 55:
|
|
1434
1513
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1445,7 +1524,7 @@ describe('State Machine handler tests', function () {
|
|
|
1445
1524
|
}
|
|
1446
1525
|
};
|
|
1447
1526
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1448
|
-
|
|
1527
|
+
_context29.next = 62;
|
|
1449
1528
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1450
1529
|
case 62:
|
|
1451
1530
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1461,14 +1540,14 @@ describe('State Machine handler tests', function () {
|
|
|
1461
1540
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1462
1541
|
case 70:
|
|
1463
1542
|
case "end":
|
|
1464
|
-
return
|
|
1543
|
+
return _context29.stop();
|
|
1465
1544
|
}
|
|
1466
|
-
},
|
|
1545
|
+
}, _callee29);
|
|
1467
1546
|
})));
|
|
1468
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1547
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1469
1548
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1470
|
-
return _regenerator.default.wrap(function
|
|
1471
|
-
while (1) switch (
|
|
1549
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1550
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1472
1551
|
case 0:
|
|
1473
1552
|
statusPayload = {
|
|
1474
1553
|
statusCode: 200,
|
|
@@ -1535,9 +1614,9 @@ describe('State Machine handler tests', function () {
|
|
|
1535
1614
|
});
|
|
1536
1615
|
case 33:
|
|
1537
1616
|
case "end":
|
|
1538
|
-
return
|
|
1617
|
+
return _context30.stop();
|
|
1539
1618
|
}
|
|
1540
|
-
},
|
|
1619
|
+
}, _callee30);
|
|
1541
1620
|
})));
|
|
1542
1621
|
});
|
|
1543
1622
|
describe('Supplementary Services tests', function () {
|
|
@@ -1596,10 +1675,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1596
1675
|
beforeEach(function () {
|
|
1597
1676
|
call.removeAllListeners();
|
|
1598
1677
|
});
|
|
1599
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1678
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1600
1679
|
var responsePayload, warnSpy, roapEvent;
|
|
1601
|
-
return _regenerator.default.wrap(function
|
|
1602
|
-
while (1) switch (
|
|
1680
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1681
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1603
1682
|
case 0:
|
|
1604
1683
|
expect.assertions(7);
|
|
1605
1684
|
responsePayload = {
|
|
@@ -1612,25 +1691,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1612
1691
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1613
1692
|
call['held'] = false;
|
|
1614
1693
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1615
|
-
var
|
|
1616
|
-
return _regenerator.default.wrap(function
|
|
1617
|
-
while (1) switch (
|
|
1694
|
+
var _ref32 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(correlationId) {
|
|
1695
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
1696
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1618
1697
|
case 0:
|
|
1619
1698
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1620
1699
|
case 1:
|
|
1621
1700
|
case "end":
|
|
1622
|
-
return
|
|
1701
|
+
return _context31.stop();
|
|
1623
1702
|
}
|
|
1624
|
-
},
|
|
1703
|
+
}, _callee31);
|
|
1625
1704
|
}));
|
|
1626
1705
|
return function (_x) {
|
|
1627
|
-
return
|
|
1706
|
+
return _ref32.apply(this, arguments);
|
|
1628
1707
|
};
|
|
1629
1708
|
}());
|
|
1630
|
-
|
|
1709
|
+
_context32.next = 10;
|
|
1631
1710
|
return call.doHoldResume();
|
|
1632
1711
|
case 10:
|
|
1633
|
-
|
|
1712
|
+
_context32.next = 12;
|
|
1634
1713
|
return (0, _testUtil.flushPromises)(2);
|
|
1635
1714
|
case 12:
|
|
1636
1715
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1646,11 +1725,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1646
1725
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1647
1726
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1648
1727
|
roapEvent.data.type = 'ANSWER';
|
|
1649
|
-
|
|
1728
|
+
_context32.next = 20;
|
|
1650
1729
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1651
1730
|
case 20:
|
|
1652
1731
|
roapEvent.data.type = 'OK';
|
|
1653
|
-
|
|
1732
|
+
_context32.next = 23;
|
|
1654
1733
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1655
1734
|
case 23:
|
|
1656
1735
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1665,14 +1744,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1665
1744
|
});
|
|
1666
1745
|
case 28:
|
|
1667
1746
|
case "end":
|
|
1668
|
-
return
|
|
1747
|
+
return _context32.stop();
|
|
1669
1748
|
}
|
|
1670
|
-
},
|
|
1749
|
+
}, _callee32);
|
|
1671
1750
|
})));
|
|
1672
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1751
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1673
1752
|
var responsePayload, warnSpy, roapEvent;
|
|
1674
|
-
return _regenerator.default.wrap(function
|
|
1675
|
-
while (1) switch (
|
|
1753
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1754
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1676
1755
|
case 0:
|
|
1677
1756
|
expect.assertions(8);
|
|
1678
1757
|
responsePayload = {
|
|
@@ -1685,26 +1764,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1685
1764
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1686
1765
|
call['held'] = false;
|
|
1687
1766
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1688
|
-
var
|
|
1689
|
-
return _regenerator.default.wrap(function
|
|
1690
|
-
while (1) switch (
|
|
1767
|
+
var _ref34 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(correlationId) {
|
|
1768
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1769
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1691
1770
|
case 0:
|
|
1692
1771
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1693
1772
|
case 1:
|
|
1694
1773
|
case "end":
|
|
1695
|
-
return
|
|
1774
|
+
return _context33.stop();
|
|
1696
1775
|
}
|
|
1697
|
-
},
|
|
1776
|
+
}, _callee33);
|
|
1698
1777
|
}));
|
|
1699
1778
|
return function (_x2) {
|
|
1700
|
-
return
|
|
1779
|
+
return _ref34.apply(this, arguments);
|
|
1701
1780
|
};
|
|
1702
1781
|
}());
|
|
1703
1782
|
call.doHoldResume();
|
|
1704
|
-
|
|
1783
|
+
_context34.next = 11;
|
|
1705
1784
|
return _promise.default.resolve();
|
|
1706
1785
|
case 11:
|
|
1707
|
-
|
|
1786
|
+
_context34.next = 13;
|
|
1708
1787
|
return _promise.default.resolve();
|
|
1709
1788
|
case 13:
|
|
1710
1789
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -1720,11 +1799,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1720
1799
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1721
1800
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1722
1801
|
roapEvent.data.type = 'ANSWER';
|
|
1723
|
-
|
|
1802
|
+
_context34.next = 22;
|
|
1724
1803
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1725
1804
|
case 22:
|
|
1726
1805
|
roapEvent.data.type = 'OK';
|
|
1727
|
-
|
|
1806
|
+
_context34.next = 25;
|
|
1728
1807
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1729
1808
|
case 25:
|
|
1730
1809
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -1739,14 +1818,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1739
1818
|
});
|
|
1740
1819
|
case 30:
|
|
1741
1820
|
case "end":
|
|
1742
|
-
return
|
|
1821
|
+
return _context34.stop();
|
|
1743
1822
|
}
|
|
1744
|
-
},
|
|
1823
|
+
}, _callee34);
|
|
1745
1824
|
})));
|
|
1746
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1825
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1747
1826
|
var responsePayload;
|
|
1748
|
-
return _regenerator.default.wrap(function
|
|
1749
|
-
while (1) switch (
|
|
1827
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
1828
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1750
1829
|
case 0:
|
|
1751
1830
|
expect.assertions(4);
|
|
1752
1831
|
responsePayload = {
|
|
@@ -1756,26 +1835,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1756
1835
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
1757
1836
|
call['held'] = false;
|
|
1758
1837
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1759
|
-
var
|
|
1760
|
-
return _regenerator.default.wrap(function
|
|
1761
|
-
while (1) switch (
|
|
1838
|
+
var _ref36 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(errObj) {
|
|
1839
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
1840
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1762
1841
|
case 0:
|
|
1763
1842
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
1764
1843
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
1765
1844
|
case 2:
|
|
1766
1845
|
case "end":
|
|
1767
|
-
return
|
|
1846
|
+
return _context35.stop();
|
|
1768
1847
|
}
|
|
1769
|
-
},
|
|
1848
|
+
}, _callee35);
|
|
1770
1849
|
}));
|
|
1771
1850
|
return function (_x3) {
|
|
1772
|
-
return
|
|
1851
|
+
return _ref36.apply(this, arguments);
|
|
1773
1852
|
};
|
|
1774
1853
|
}());
|
|
1775
|
-
|
|
1854
|
+
_context36.next = 7;
|
|
1776
1855
|
return call.doHoldResume();
|
|
1777
1856
|
case 7:
|
|
1778
|
-
|
|
1857
|
+
_context36.next = 9;
|
|
1779
1858
|
return (0, _testUtil.flushPromises)(2);
|
|
1780
1859
|
case 9:
|
|
1781
1860
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -1785,14 +1864,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1785
1864
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1786
1865
|
case 11:
|
|
1787
1866
|
case "end":
|
|
1788
|
-
return
|
|
1867
|
+
return _context36.stop();
|
|
1789
1868
|
}
|
|
1790
|
-
},
|
|
1869
|
+
}, _callee36);
|
|
1791
1870
|
})));
|
|
1792
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1871
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1793
1872
|
var responsePayload, rejectPayload, roapEvent;
|
|
1794
|
-
return _regenerator.default.wrap(function
|
|
1795
|
-
while (1) switch (
|
|
1873
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
1874
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1796
1875
|
case 0:
|
|
1797
1876
|
expect.assertions(5);
|
|
1798
1877
|
responsePayload = {
|
|
@@ -1806,24 +1885,24 @@ describe('Supplementary Services tests', function () {
|
|
|
1806
1885
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
1807
1886
|
call['held'] = false;
|
|
1808
1887
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1809
|
-
var
|
|
1810
|
-
return _regenerator.default.wrap(function
|
|
1811
|
-
while (1) switch (
|
|
1888
|
+
var _ref38 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(errObj) {
|
|
1889
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
1890
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1812
1891
|
case 0:
|
|
1813
1892
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
1814
1893
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
1815
1894
|
case 2:
|
|
1816
1895
|
case "end":
|
|
1817
|
-
return
|
|
1896
|
+
return _context37.stop();
|
|
1818
1897
|
}
|
|
1819
|
-
},
|
|
1898
|
+
}, _callee37);
|
|
1820
1899
|
}));
|
|
1821
1900
|
return function (_x4) {
|
|
1822
|
-
return
|
|
1901
|
+
return _ref38.apply(this, arguments);
|
|
1823
1902
|
};
|
|
1824
1903
|
}());
|
|
1825
1904
|
call.doHoldResume();
|
|
1826
|
-
|
|
1905
|
+
_context38.next = 9;
|
|
1827
1906
|
return (0, _testUtil.flushPromises)(2);
|
|
1828
1907
|
case 9:
|
|
1829
1908
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -1833,7 +1912,7 @@ describe('Supplementary Services tests', function () {
|
|
|
1833
1912
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1834
1913
|
/* We are intentionally failing the ROAP ANSWER */
|
|
1835
1914
|
roapEvent.data.type = 'ANSWER';
|
|
1836
|
-
|
|
1915
|
+
_context38.next = 15;
|
|
1837
1916
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1838
1917
|
case 15:
|
|
1839
1918
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -1841,14 +1920,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1841
1920
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1842
1921
|
case 17:
|
|
1843
1922
|
case "end":
|
|
1844
|
-
return
|
|
1923
|
+
return _context38.stop();
|
|
1845
1924
|
}
|
|
1846
|
-
},
|
|
1925
|
+
}, _callee38);
|
|
1847
1926
|
})));
|
|
1848
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1927
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1849
1928
|
var responsePayload, warnSpy, roapEvent;
|
|
1850
|
-
return _regenerator.default.wrap(function
|
|
1851
|
-
while (1) switch (
|
|
1929
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
1930
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1852
1931
|
case 0:
|
|
1853
1932
|
responsePayload = {
|
|
1854
1933
|
statusCode: 200,
|
|
@@ -1859,10 +1938,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1859
1938
|
jest.spyOn(global, 'clearTimeout');
|
|
1860
1939
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1861
1940
|
call['held'] = false;
|
|
1862
|
-
|
|
1941
|
+
_context39.next = 8;
|
|
1863
1942
|
return call.doHoldResume();
|
|
1864
1943
|
case 8:
|
|
1865
|
-
|
|
1944
|
+
_context39.next = 10;
|
|
1866
1945
|
return (0, _testUtil.flushPromises)(2);
|
|
1867
1946
|
case 10:
|
|
1868
1947
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1877,38 +1956,38 @@ describe('Supplementary Services tests', function () {
|
|
|
1877
1956
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1878
1957
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1879
1958
|
roapEvent.data.type = 'ANSWER';
|
|
1880
|
-
|
|
1959
|
+
_context39.next = 17;
|
|
1881
1960
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1882
1961
|
case 17:
|
|
1883
1962
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
1884
1963
|
statusCode: 403
|
|
1885
1964
|
});
|
|
1886
1965
|
roapEvent.data.type = 'OK';
|
|
1887
|
-
|
|
1966
|
+
_context39.next = 21;
|
|
1888
1967
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1889
1968
|
case 21:
|
|
1890
1969
|
/* this is for coverage */
|
|
1891
1970
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
1892
|
-
|
|
1971
|
+
_context39.next = 24;
|
|
1893
1972
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1894
1973
|
case 24:
|
|
1895
1974
|
expect(call.isHeld()).toStrictEqual(false);
|
|
1896
1975
|
/* We should return back to call established state */
|
|
1897
1976
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1898
|
-
expect(warnSpy).toHaveBeenCalledWith('
|
|
1977
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1899
1978
|
file: 'call',
|
|
1900
1979
|
method: 'handleRoapEstablished'
|
|
1901
1980
|
});
|
|
1902
1981
|
case 27:
|
|
1903
1982
|
case "end":
|
|
1904
|
-
return
|
|
1983
|
+
return _context39.stop();
|
|
1905
1984
|
}
|
|
1906
|
-
},
|
|
1985
|
+
}, _callee39);
|
|
1907
1986
|
})));
|
|
1908
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1987
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1909
1988
|
var responsePayload, warnSpy, roapEvent;
|
|
1910
|
-
return _regenerator.default.wrap(function
|
|
1911
|
-
while (1) switch (
|
|
1989
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
1990
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1912
1991
|
case 0:
|
|
1913
1992
|
responsePayload = {
|
|
1914
1993
|
statusCode: 200,
|
|
@@ -1919,10 +1998,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1919
1998
|
jest.spyOn(global, 'clearTimeout');
|
|
1920
1999
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1921
2000
|
call['held'] = true;
|
|
1922
|
-
|
|
2001
|
+
_context40.next = 8;
|
|
1923
2002
|
return call.doHoldResume();
|
|
1924
2003
|
case 8:
|
|
1925
|
-
|
|
2004
|
+
_context40.next = 10;
|
|
1926
2005
|
return (0, _testUtil.flushPromises)(2);
|
|
1927
2006
|
case 10:
|
|
1928
2007
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1937,33 +2016,33 @@ describe('Supplementary Services tests', function () {
|
|
|
1937
2016
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1938
2017
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1939
2018
|
roapEvent.data.type = 'ANSWER';
|
|
1940
|
-
|
|
2019
|
+
_context40.next = 17;
|
|
1941
2020
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1942
2021
|
case 17:
|
|
1943
2022
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
1944
2023
|
statusCode: 403
|
|
1945
2024
|
});
|
|
1946
2025
|
roapEvent.data.type = 'OK';
|
|
1947
|
-
|
|
2026
|
+
_context40.next = 21;
|
|
1948
2027
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1949
2028
|
case 21:
|
|
1950
2029
|
expect(call.isHeld()).toStrictEqual(true);
|
|
1951
2030
|
/* We should return back to call established state */
|
|
1952
2031
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1953
|
-
expect(warnSpy).toHaveBeenCalledWith('
|
|
2032
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1954
2033
|
file: 'call',
|
|
1955
2034
|
method: 'handleRoapEstablished'
|
|
1956
2035
|
});
|
|
1957
2036
|
case 24:
|
|
1958
2037
|
case "end":
|
|
1959
|
-
return
|
|
2038
|
+
return _context40.stop();
|
|
1960
2039
|
}
|
|
1961
|
-
},
|
|
2040
|
+
}, _callee40);
|
|
1962
2041
|
})));
|
|
1963
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2042
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
1964
2043
|
var responsePayload, roapEvent;
|
|
1965
|
-
return _regenerator.default.wrap(function
|
|
1966
|
-
while (1) switch (
|
|
2044
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2045
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
1967
2046
|
case 0:
|
|
1968
2047
|
expect.assertions(5);
|
|
1969
2048
|
responsePayload = {
|
|
@@ -1973,25 +2052,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1973
2052
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
1974
2053
|
call['held'] = false;
|
|
1975
2054
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1976
|
-
var
|
|
1977
|
-
return _regenerator.default.wrap(function
|
|
1978
|
-
while (1) switch (
|
|
2055
|
+
var _ref42 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(errObj) {
|
|
2056
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2057
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
1979
2058
|
case 0:
|
|
1980
2059
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
1981
2060
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
1982
2061
|
case 2:
|
|
1983
2062
|
case "end":
|
|
1984
|
-
return
|
|
2063
|
+
return _context41.stop();
|
|
1985
2064
|
}
|
|
1986
|
-
},
|
|
2065
|
+
}, _callee41);
|
|
1987
2066
|
}));
|
|
1988
2067
|
return function (_x5) {
|
|
1989
|
-
return
|
|
2068
|
+
return _ref42.apply(this, arguments);
|
|
1990
2069
|
};
|
|
1991
2070
|
}());
|
|
1992
2071
|
jest.runAllTimers();
|
|
1993
2072
|
call.doHoldResume();
|
|
1994
|
-
|
|
2073
|
+
_context42.next = 9;
|
|
1995
2074
|
return (0, _testUtil.flushPromises)(2);
|
|
1996
2075
|
case 9:
|
|
1997
2076
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2004,11 +2083,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2004
2083
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2005
2084
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2006
2085
|
roapEvent.data.type = 'ANSWER';
|
|
2007
|
-
|
|
2086
|
+
_context42.next = 15;
|
|
2008
2087
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2009
2088
|
case 15:
|
|
2010
2089
|
roapEvent.data.type = 'OK';
|
|
2011
|
-
|
|
2090
|
+
_context42.next = 18;
|
|
2012
2091
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2013
2092
|
case 18:
|
|
2014
2093
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2020,14 +2099,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2020
2099
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2021
2100
|
case 21:
|
|
2022
2101
|
case "end":
|
|
2023
|
-
return
|
|
2102
|
+
return _context42.stop();
|
|
2024
2103
|
}
|
|
2025
|
-
},
|
|
2104
|
+
}, _callee42);
|
|
2026
2105
|
})));
|
|
2027
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2106
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2028
2107
|
var responsePayload, warnSpy, roapEvent;
|
|
2029
|
-
return _regenerator.default.wrap(function
|
|
2030
|
-
while (1) switch (
|
|
2108
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2109
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2031
2110
|
case 0:
|
|
2032
2111
|
expect.assertions(7);
|
|
2033
2112
|
responsePayload = {
|
|
@@ -2040,25 +2119,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2040
2119
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2041
2120
|
call['held'] = true;
|
|
2042
2121
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2043
|
-
var
|
|
2044
|
-
return _regenerator.default.wrap(function
|
|
2045
|
-
while (1) switch (
|
|
2122
|
+
var _ref44 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(correlationId) {
|
|
2123
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2124
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2046
2125
|
case 0:
|
|
2047
2126
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2048
2127
|
case 1:
|
|
2049
2128
|
case "end":
|
|
2050
|
-
return
|
|
2129
|
+
return _context43.stop();
|
|
2051
2130
|
}
|
|
2052
|
-
},
|
|
2131
|
+
}, _callee43);
|
|
2053
2132
|
}));
|
|
2054
2133
|
return function (_x6) {
|
|
2055
|
-
return
|
|
2134
|
+
return _ref44.apply(this, arguments);
|
|
2056
2135
|
};
|
|
2057
2136
|
}());
|
|
2058
|
-
|
|
2137
|
+
_context44.next = 10;
|
|
2059
2138
|
return call.doHoldResume();
|
|
2060
2139
|
case 10:
|
|
2061
|
-
|
|
2140
|
+
_context44.next = 12;
|
|
2062
2141
|
return (0, _testUtil.flushPromises)(2);
|
|
2063
2142
|
case 12:
|
|
2064
2143
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2074,11 +2153,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2074
2153
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2075
2154
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2076
2155
|
roapEvent.data.type = 'ANSWER';
|
|
2077
|
-
|
|
2156
|
+
_context44.next = 20;
|
|
2078
2157
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2079
2158
|
case 20:
|
|
2080
2159
|
roapEvent.data.type = 'OK';
|
|
2081
|
-
|
|
2160
|
+
_context44.next = 23;
|
|
2082
2161
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2083
2162
|
case 23:
|
|
2084
2163
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2093,14 +2172,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2093
2172
|
});
|
|
2094
2173
|
case 28:
|
|
2095
2174
|
case "end":
|
|
2096
|
-
return
|
|
2175
|
+
return _context44.stop();
|
|
2097
2176
|
}
|
|
2098
|
-
},
|
|
2177
|
+
}, _callee44);
|
|
2099
2178
|
})));
|
|
2100
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2179
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2101
2180
|
var responsePayload, warnSpy, roapEvent;
|
|
2102
|
-
return _regenerator.default.wrap(function
|
|
2103
|
-
while (1) switch (
|
|
2181
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2182
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2104
2183
|
case 0:
|
|
2105
2184
|
expect.assertions(7);
|
|
2106
2185
|
responsePayload = {
|
|
@@ -2113,26 +2192,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2113
2192
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2114
2193
|
call['held'] = true;
|
|
2115
2194
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2116
|
-
var
|
|
2117
|
-
return _regenerator.default.wrap(function
|
|
2118
|
-
while (1) switch (
|
|
2195
|
+
var _ref46 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
|
|
2196
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2197
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2119
2198
|
case 0:
|
|
2120
2199
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2121
2200
|
case 1:
|
|
2122
2201
|
case "end":
|
|
2123
|
-
return
|
|
2202
|
+
return _context45.stop();
|
|
2124
2203
|
}
|
|
2125
|
-
},
|
|
2204
|
+
}, _callee45);
|
|
2126
2205
|
}));
|
|
2127
2206
|
return function (_x7) {
|
|
2128
|
-
return
|
|
2207
|
+
return _ref46.apply(this, arguments);
|
|
2129
2208
|
};
|
|
2130
2209
|
}());
|
|
2131
2210
|
call.doHoldResume();
|
|
2132
|
-
|
|
2211
|
+
_context46.next = 11;
|
|
2133
2212
|
return _promise.default.resolve();
|
|
2134
2213
|
case 11:
|
|
2135
|
-
|
|
2214
|
+
_context46.next = 13;
|
|
2136
2215
|
return _promise.default.resolve();
|
|
2137
2216
|
case 13:
|
|
2138
2217
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2148,11 +2227,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2148
2227
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2149
2228
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2150
2229
|
roapEvent.data.type = 'ANSWER';
|
|
2151
|
-
|
|
2230
|
+
_context46.next = 21;
|
|
2152
2231
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2153
2232
|
case 21:
|
|
2154
2233
|
roapEvent.data.type = 'OK';
|
|
2155
|
-
|
|
2234
|
+
_context46.next = 24;
|
|
2156
2235
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2157
2236
|
case 24:
|
|
2158
2237
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2167,14 +2246,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2167
2246
|
});
|
|
2168
2247
|
case 29:
|
|
2169
2248
|
case "end":
|
|
2170
|
-
return
|
|
2249
|
+
return _context46.stop();
|
|
2171
2250
|
}
|
|
2172
|
-
},
|
|
2251
|
+
}, _callee46);
|
|
2173
2252
|
})));
|
|
2174
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2253
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2175
2254
|
var responsePayload;
|
|
2176
|
-
return _regenerator.default.wrap(function
|
|
2177
|
-
while (1) switch (
|
|
2255
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2256
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2178
2257
|
case 0:
|
|
2179
2258
|
expect.assertions(4);
|
|
2180
2259
|
responsePayload = {
|
|
@@ -2184,26 +2263,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2184
2263
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2185
2264
|
call['held'] = true;
|
|
2186
2265
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2187
|
-
var
|
|
2188
|
-
return _regenerator.default.wrap(function
|
|
2189
|
-
while (1) switch (
|
|
2266
|
+
var _ref48 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(errObj) {
|
|
2267
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2268
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2190
2269
|
case 0:
|
|
2191
2270
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2192
2271
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2193
2272
|
case 2:
|
|
2194
2273
|
case "end":
|
|
2195
|
-
return
|
|
2274
|
+
return _context47.stop();
|
|
2196
2275
|
}
|
|
2197
|
-
},
|
|
2276
|
+
}, _callee47);
|
|
2198
2277
|
}));
|
|
2199
2278
|
return function (_x8) {
|
|
2200
|
-
return
|
|
2279
|
+
return _ref48.apply(this, arguments);
|
|
2201
2280
|
};
|
|
2202
2281
|
}());
|
|
2203
|
-
|
|
2282
|
+
_context48.next = 7;
|
|
2204
2283
|
return call.doHoldResume();
|
|
2205
2284
|
case 7:
|
|
2206
|
-
|
|
2285
|
+
_context48.next = 9;
|
|
2207
2286
|
return (0, _testUtil.flushPromises)(2);
|
|
2208
2287
|
case 9:
|
|
2209
2288
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2214,14 +2293,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2214
2293
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2215
2294
|
case 11:
|
|
2216
2295
|
case "end":
|
|
2217
|
-
return
|
|
2296
|
+
return _context48.stop();
|
|
2218
2297
|
}
|
|
2219
|
-
},
|
|
2298
|
+
}, _callee48);
|
|
2220
2299
|
})));
|
|
2221
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2300
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2222
2301
|
var responsePayload, rejectPayload, roapEvent;
|
|
2223
|
-
return _regenerator.default.wrap(function
|
|
2224
|
-
while (1) switch (
|
|
2302
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2303
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2225
2304
|
case 0:
|
|
2226
2305
|
expect.assertions(5);
|
|
2227
2306
|
responsePayload = {
|
|
@@ -2235,24 +2314,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2235
2314
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2236
2315
|
call['held'] = true;
|
|
2237
2316
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2238
|
-
var
|
|
2239
|
-
return _regenerator.default.wrap(function
|
|
2240
|
-
while (1) switch (
|
|
2317
|
+
var _ref50 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
|
|
2318
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2319
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2241
2320
|
case 0:
|
|
2242
2321
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2243
2322
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2244
2323
|
case 2:
|
|
2245
2324
|
case "end":
|
|
2246
|
-
return
|
|
2325
|
+
return _context49.stop();
|
|
2247
2326
|
}
|
|
2248
|
-
},
|
|
2327
|
+
}, _callee49);
|
|
2249
2328
|
}));
|
|
2250
2329
|
return function (_x9) {
|
|
2251
|
-
return
|
|
2330
|
+
return _ref50.apply(this, arguments);
|
|
2252
2331
|
};
|
|
2253
2332
|
}());
|
|
2254
2333
|
call.doHoldResume();
|
|
2255
|
-
|
|
2334
|
+
_context50.next = 9;
|
|
2256
2335
|
return (0, _testUtil.flushPromises)(2);
|
|
2257
2336
|
case 9:
|
|
2258
2337
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2263,7 +2342,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2263
2342
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2264
2343
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2265
2344
|
roapEvent.data.type = 'ANSWER';
|
|
2266
|
-
|
|
2345
|
+
_context50.next = 15;
|
|
2267
2346
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2268
2347
|
case 15:
|
|
2269
2348
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2271,14 +2350,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2271
2350
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2272
2351
|
case 17:
|
|
2273
2352
|
case "end":
|
|
2274
|
-
return
|
|
2353
|
+
return _context50.stop();
|
|
2275
2354
|
}
|
|
2276
|
-
},
|
|
2355
|
+
}, _callee50);
|
|
2277
2356
|
})));
|
|
2278
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2357
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2279
2358
|
var responsePayload, roapEvent;
|
|
2280
|
-
return _regenerator.default.wrap(function
|
|
2281
|
-
while (1) switch (
|
|
2359
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2360
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2282
2361
|
case 0:
|
|
2283
2362
|
expect.assertions(5);
|
|
2284
2363
|
responsePayload = {
|
|
@@ -2288,24 +2367,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2288
2367
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2289
2368
|
call['held'] = true;
|
|
2290
2369
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2291
|
-
var
|
|
2292
|
-
return _regenerator.default.wrap(function
|
|
2293
|
-
while (1) switch (
|
|
2370
|
+
var _ref52 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
|
|
2371
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2372
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2294
2373
|
case 0:
|
|
2295
2374
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2296
2375
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2297
2376
|
case 2:
|
|
2298
2377
|
case "end":
|
|
2299
|
-
return
|
|
2378
|
+
return _context51.stop();
|
|
2300
2379
|
}
|
|
2301
|
-
},
|
|
2380
|
+
}, _callee51);
|
|
2302
2381
|
}));
|
|
2303
2382
|
return function (_x10) {
|
|
2304
|
-
return
|
|
2383
|
+
return _ref52.apply(this, arguments);
|
|
2305
2384
|
};
|
|
2306
2385
|
}());
|
|
2307
2386
|
call.doHoldResume();
|
|
2308
|
-
|
|
2387
|
+
_context52.next = 8;
|
|
2309
2388
|
return (0, _testUtil.flushPromises)(2);
|
|
2310
2389
|
case 8:
|
|
2311
2390
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2318,11 +2397,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2318
2397
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2319
2398
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2320
2399
|
roapEvent.data.type = 'ANSWER';
|
|
2321
|
-
|
|
2400
|
+
_context52.next = 14;
|
|
2322
2401
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2323
2402
|
case 14:
|
|
2324
2403
|
roapEvent.data.type = 'OK';
|
|
2325
|
-
|
|
2404
|
+
_context52.next = 17;
|
|
2326
2405
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2327
2406
|
case 17:
|
|
2328
2407
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2332,9 +2411,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2332
2411
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2333
2412
|
case 20:
|
|
2334
2413
|
case "end":
|
|
2335
|
-
return
|
|
2414
|
+
return _context52.stop();
|
|
2336
2415
|
}
|
|
2337
|
-
},
|
|
2416
|
+
}, _callee52);
|
|
2338
2417
|
})));
|
|
2339
2418
|
});
|
|
2340
2419
|
describe('Call transfer tests', function () {
|
|
@@ -2366,10 +2445,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2366
2445
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2367
2446
|
secondCall['held'] = false;
|
|
2368
2447
|
});
|
|
2369
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2448
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2370
2449
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2371
|
-
return _regenerator.default.wrap(function
|
|
2372
|
-
while (1) switch (
|
|
2450
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2451
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2373
2452
|
case 0:
|
|
2374
2453
|
expect.assertions(9);
|
|
2375
2454
|
responsePayload = {
|
|
@@ -2381,41 +2460,41 @@ describe('Supplementary Services tests', function () {
|
|
|
2381
2460
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2382
2461
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2383
2462
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2384
|
-
var
|
|
2385
|
-
return _regenerator.default.wrap(function
|
|
2386
|
-
while (1) switch (
|
|
2463
|
+
var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(correlationId) {
|
|
2464
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2465
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2387
2466
|
case 0:
|
|
2388
2467
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2389
2468
|
case 1:
|
|
2390
2469
|
case "end":
|
|
2391
|
-
return
|
|
2470
|
+
return _context53.stop();
|
|
2392
2471
|
}
|
|
2393
|
-
},
|
|
2472
|
+
}, _callee53);
|
|
2394
2473
|
}));
|
|
2395
2474
|
return function (_x11) {
|
|
2396
|
-
return
|
|
2475
|
+
return _ref54.apply(this, arguments);
|
|
2397
2476
|
};
|
|
2398
2477
|
}());
|
|
2399
2478
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2400
|
-
var
|
|
2401
|
-
return _regenerator.default.wrap(function
|
|
2402
|
-
while (1) switch (
|
|
2479
|
+
var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(correlationId) {
|
|
2480
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2481
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2403
2482
|
case 0:
|
|
2404
2483
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
2405
2484
|
case 1:
|
|
2406
2485
|
case "end":
|
|
2407
|
-
return
|
|
2486
|
+
return _context54.stop();
|
|
2408
2487
|
}
|
|
2409
|
-
},
|
|
2488
|
+
}, _callee54);
|
|
2410
2489
|
}));
|
|
2411
2490
|
return function (_x12) {
|
|
2412
|
-
return
|
|
2491
|
+
return _ref55.apply(this, arguments);
|
|
2413
2492
|
};
|
|
2414
2493
|
}());
|
|
2415
|
-
|
|
2494
|
+
_context55.next = 10;
|
|
2416
2495
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2417
2496
|
case 10:
|
|
2418
|
-
|
|
2497
|
+
_context55.next = 12;
|
|
2419
2498
|
return (0, _testUtil.flushPromises)(2);
|
|
2420
2499
|
case 12:
|
|
2421
2500
|
expect(requestSpy).toBeCalled();
|
|
@@ -2435,14 +2514,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2435
2514
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2436
2515
|
case 21:
|
|
2437
2516
|
case "end":
|
|
2438
|
-
return
|
|
2517
|
+
return _context55.stop();
|
|
2439
2518
|
}
|
|
2440
|
-
},
|
|
2519
|
+
}, _callee55);
|
|
2441
2520
|
})));
|
|
2442
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2521
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2443
2522
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2444
|
-
return _regenerator.default.wrap(function
|
|
2445
|
-
while (1) switch (
|
|
2523
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2524
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2446
2525
|
case 0:
|
|
2447
2526
|
expect.assertions(7);
|
|
2448
2527
|
responsePayload = {
|
|
@@ -2454,25 +2533,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2454
2533
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2455
2534
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2456
2535
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2457
|
-
var
|
|
2458
|
-
return _regenerator.default.wrap(function
|
|
2459
|
-
while (1) switch (
|
|
2536
|
+
var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
|
|
2537
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2538
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2460
2539
|
case 0:
|
|
2461
2540
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2462
2541
|
case 1:
|
|
2463
2542
|
case "end":
|
|
2464
|
-
return
|
|
2543
|
+
return _context56.stop();
|
|
2465
2544
|
}
|
|
2466
|
-
},
|
|
2545
|
+
}, _callee56);
|
|
2467
2546
|
}));
|
|
2468
2547
|
return function (_x13) {
|
|
2469
|
-
return
|
|
2548
|
+
return _ref57.apply(this, arguments);
|
|
2470
2549
|
};
|
|
2471
2550
|
}());
|
|
2472
|
-
|
|
2551
|
+
_context57.next = 9;
|
|
2473
2552
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2474
2553
|
case 9:
|
|
2475
|
-
|
|
2554
|
+
_context57.next = 11;
|
|
2476
2555
|
return (0, _testUtil.flushPromises)(2);
|
|
2477
2556
|
case 11:
|
|
2478
2557
|
expect(requestSpy).toBeCalled();
|
|
@@ -2488,14 +2567,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2488
2567
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2489
2568
|
case 18:
|
|
2490
2569
|
case "end":
|
|
2491
|
-
return
|
|
2570
|
+
return _context57.stop();
|
|
2492
2571
|
}
|
|
2493
|
-
},
|
|
2572
|
+
}, _callee57);
|
|
2494
2573
|
})));
|
|
2495
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2574
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2496
2575
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2497
|
-
return _regenerator.default.wrap(function
|
|
2498
|
-
while (1) switch (
|
|
2576
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2577
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2499
2578
|
case 0:
|
|
2500
2579
|
responsePayload = {
|
|
2501
2580
|
statusCode: 403,
|
|
@@ -2505,10 +2584,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2505
2584
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2506
2585
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2507
2586
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2508
|
-
|
|
2587
|
+
_context58.next = 7;
|
|
2509
2588
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2510
2589
|
case 7:
|
|
2511
|
-
|
|
2590
|
+
_context58.next = 9;
|
|
2512
2591
|
return (0, _testUtil.flushPromises)(1);
|
|
2513
2592
|
case 9:
|
|
2514
2593
|
expect(requestSpy).toBeCalled();
|
|
@@ -2524,14 +2603,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2524
2603
|
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
2604
|
case 16:
|
|
2526
2605
|
case "end":
|
|
2527
|
-
return
|
|
2606
|
+
return _context58.stop();
|
|
2528
2607
|
}
|
|
2529
|
-
},
|
|
2608
|
+
}, _callee58);
|
|
2530
2609
|
})));
|
|
2531
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2610
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
2532
2611
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2533
|
-
return _regenerator.default.wrap(function
|
|
2534
|
-
while (1) switch (
|
|
2612
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
2613
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2535
2614
|
case 0:
|
|
2536
2615
|
responsePayload = {
|
|
2537
2616
|
statusCode: 403,
|
|
@@ -2541,10 +2620,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2541
2620
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2542
2621
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2543
2622
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2544
|
-
|
|
2623
|
+
_context59.next = 7;
|
|
2545
2624
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2546
2625
|
case 7:
|
|
2547
|
-
|
|
2626
|
+
_context59.next = 9;
|
|
2548
2627
|
return (0, _testUtil.flushPromises)(2);
|
|
2549
2628
|
case 9:
|
|
2550
2629
|
expect(requestSpy).toBeCalled();
|
|
@@ -2561,18 +2640,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2561
2640
|
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
2641
|
case 17:
|
|
2563
2642
|
case "end":
|
|
2564
|
-
return
|
|
2643
|
+
return _context59.stop();
|
|
2565
2644
|
}
|
|
2566
|
-
},
|
|
2645
|
+
}, _callee59);
|
|
2567
2646
|
})));
|
|
2568
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2647
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
2569
2648
|
var requestSpy, warnSpy;
|
|
2570
|
-
return _regenerator.default.wrap(function
|
|
2571
|
-
while (1) switch (
|
|
2649
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
2650
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2572
2651
|
case 0:
|
|
2573
2652
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2574
2653
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2575
|
-
|
|
2654
|
+
_context60.next = 4;
|
|
2576
2655
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
2577
2656
|
case 4:
|
|
2578
2657
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2583,18 +2662,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2583
2662
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2584
2663
|
case 9:
|
|
2585
2664
|
case "end":
|
|
2586
|
-
return
|
|
2665
|
+
return _context60.stop();
|
|
2587
2666
|
}
|
|
2588
|
-
},
|
|
2667
|
+
}, _callee60);
|
|
2589
2668
|
})));
|
|
2590
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2669
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
2591
2670
|
var requestSpy, warnSpy;
|
|
2592
|
-
return _regenerator.default.wrap(function
|
|
2593
|
-
while (1) switch (
|
|
2671
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
2672
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
2594
2673
|
case 0:
|
|
2595
2674
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2596
2675
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2597
|
-
|
|
2676
|
+
_context61.next = 4;
|
|
2598
2677
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
2599
2678
|
case 4:
|
|
2600
2679
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2605,9 +2684,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2605
2684
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2606
2685
|
case 9:
|
|
2607
2686
|
case "end":
|
|
2608
|
-
return
|
|
2687
|
+
return _context61.stop();
|
|
2609
2688
|
}
|
|
2610
|
-
},
|
|
2689
|
+
}, _callee61);
|
|
2611
2690
|
})));
|
|
2612
2691
|
});
|
|
2613
2692
|
});
|