@webex/calling 3.0.1-next.1 → 3.0.1-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallingClient/calling/call.js +73 -17
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +478 -372
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +3 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/Metrics/index.js +30 -0
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +52 -2
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +2 -0
- package/dist/Metrics/types.js.map +1 -1
- package/dist/module/CallingClient/calling/call.js +60 -9
- package/dist/module/CallingClient/constants.js +1 -0
- package/dist/module/Metrics/index.js +28 -0
- package/dist/module/Metrics/types.js +2 -0
- package/dist/types/CallingClient/calling/call.d.ts +6 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +1 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +3 -0
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -11,6 +11,7 @@ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/pr
|
|
|
11
11
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
13
13
|
var MediaSDK = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
14
|
+
var _webMediaEffects = require("@webex/web-media-effects");
|
|
14
15
|
var _types = require("../../Errors/types");
|
|
15
16
|
var _Utils = _interopRequireWildcard(require("../../common/Utils"));
|
|
16
17
|
var Utils = _Utils;
|
|
@@ -103,6 +104,12 @@ describe('Call Tests', function () {
|
|
|
103
104
|
var mockTrack = {
|
|
104
105
|
enabled: false
|
|
105
106
|
};
|
|
107
|
+
var mockEffect = {
|
|
108
|
+
isEnabled: true,
|
|
109
|
+
effectTrack: mockTrack,
|
|
110
|
+
on: jest.fn(),
|
|
111
|
+
off: jest.fn()
|
|
112
|
+
};
|
|
106
113
|
var roapMediaConnectionConfig = {
|
|
107
114
|
skipInactiveTransceivers: true,
|
|
108
115
|
iceServers: [],
|
|
@@ -343,7 +350,7 @@ describe('Call Tests', function () {
|
|
|
343
350
|
}, _callee6, null, [[1, 7]]);
|
|
344
351
|
})));
|
|
345
352
|
it('dial functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
346
|
-
var mockStream, localAudioStream, warnSpy, call;
|
|
353
|
+
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy;
|
|
347
354
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
348
355
|
while (1) switch (_context7.prev = _context7.next) {
|
|
349
356
|
case 0:
|
|
@@ -351,15 +358,21 @@ describe('Call Tests', function () {
|
|
|
351
358
|
outputStream: {
|
|
352
359
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
353
360
|
},
|
|
354
|
-
on: jest.fn()
|
|
361
|
+
on: jest.fn(),
|
|
362
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
363
|
+
return mockEffect;
|
|
364
|
+
})
|
|
355
365
|
};
|
|
356
366
|
localAudioStream = mockStream;
|
|
357
367
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
358
368
|
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
369
|
+
bnrMetricSpy = jest.spyOn(call['metricManager'], 'submitBNRMetric');
|
|
359
370
|
call.dial(localAudioStream);
|
|
360
371
|
expect(mockTrack.enabled).toEqual(true);
|
|
361
372
|
expect(mockMediaSDK.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
|
|
362
373
|
expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
|
|
374
|
+
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
375
|
+
|
|
363
376
|
/* Now change the state and recall to check for error */
|
|
364
377
|
call['mediaStateMachine'].state.value = 'S_SEND_ROAP_OFFER';
|
|
365
378
|
call.dial(localAudioStream);
|
|
@@ -368,14 +381,14 @@ describe('Call Tests', function () {
|
|
|
368
381
|
file: 'call',
|
|
369
382
|
method: 'dial'
|
|
370
383
|
});
|
|
371
|
-
case
|
|
384
|
+
case 14:
|
|
372
385
|
case "end":
|
|
373
386
|
return _context7.stop();
|
|
374
387
|
}
|
|
375
388
|
}, _callee7);
|
|
376
389
|
})));
|
|
377
390
|
it('answer functionality tests for coverage', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
378
|
-
var mockStream, localAudioStream, warnSpy, call;
|
|
391
|
+
var mockStream, localAudioStream, warnSpy, call, bnrMetricSpy;
|
|
379
392
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
380
393
|
while (1) switch (_context8.prev = _context8.next) {
|
|
381
394
|
case 0:
|
|
@@ -383,12 +396,16 @@ describe('Call Tests', function () {
|
|
|
383
396
|
outputStream: {
|
|
384
397
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
385
398
|
},
|
|
386
|
-
on: jest.fn()
|
|
399
|
+
on: jest.fn(),
|
|
400
|
+
getEffectByKind: jest.fn().mockImplementation(function () {
|
|
401
|
+
return mockEffect;
|
|
402
|
+
})
|
|
387
403
|
};
|
|
388
404
|
localAudioStream = mockStream;
|
|
389
405
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
390
406
|
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
391
407
|
/** Cannot answer in idle state */
|
|
408
|
+
bnrMetricSpy = jest.spyOn(call['metricManager'], 'submitBNRMetric');
|
|
392
409
|
call.answer(localAudioStream);
|
|
393
410
|
expect(mockTrack.enabled).toEqual(true);
|
|
394
411
|
expect(mockMediaSDK.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
|
|
@@ -402,22 +419,97 @@ describe('Call Tests', function () {
|
|
|
402
419
|
call['callStateMachine'].state.value = 'S_SEND_CALL_PROGRESS';
|
|
403
420
|
call.answer(localAudioStream);
|
|
404
421
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_CONNECT');
|
|
405
|
-
|
|
422
|
+
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
423
|
+
case 14:
|
|
406
424
|
case "end":
|
|
407
425
|
return _context8.stop();
|
|
408
426
|
}
|
|
409
427
|
}, _callee8);
|
|
410
428
|
})));
|
|
411
|
-
it('
|
|
412
|
-
var mockStream, localAudioStream,
|
|
429
|
+
it('testing enabling/disabling the BNR on an active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
430
|
+
var mockStream, localAudioStream, onStreamSpy, onEffectSpy, offStreamSpy, offEffectSpy, call, updateLocalTracksSpy, bnrMetricSpy;
|
|
413
431
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
414
432
|
while (1) switch (_context9.prev = _context9.next) {
|
|
433
|
+
case 0:
|
|
434
|
+
mockStream = {
|
|
435
|
+
outputStream: {
|
|
436
|
+
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
437
|
+
},
|
|
438
|
+
on: jest.fn(),
|
|
439
|
+
off: jest.fn(),
|
|
440
|
+
getEffectByKind: jest.fn()
|
|
441
|
+
};
|
|
442
|
+
localAudioStream = mockStream;
|
|
443
|
+
onStreamSpy = jest.spyOn(localAudioStream, 'on');
|
|
444
|
+
onEffectSpy = jest.spyOn(mockEffect, 'on');
|
|
445
|
+
offStreamSpy = jest.spyOn(localAudioStream, 'off');
|
|
446
|
+
offEffectSpy = jest.spyOn(mockEffect, 'off');
|
|
447
|
+
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
448
|
+
call.dial(localAudioStream);
|
|
449
|
+
expect(mockTrack.enabled).toEqual(true);
|
|
450
|
+
expect(mockMediaSDK.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
|
|
451
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
|
|
452
|
+
updateLocalTracksSpy = jest.spyOn(call['mediaConnection'], 'updateLocalTracks');
|
|
453
|
+
bnrMetricSpy = jest.spyOn(call['metricManager'], 'submitBNRMetric');
|
|
454
|
+
/* Update the stream with the effect */
|
|
455
|
+
jest.spyOn(localAudioStream, 'getEffectByKind').mockReturnValue(mockEffect);
|
|
456
|
+
|
|
457
|
+
/* Checking if listeners on the localAudioStream have been registered */
|
|
458
|
+
expect(onStreamSpy).toBeCalledTimes(2);
|
|
459
|
+
expect(onStreamSpy).toBeCalledWith(MediaSDK.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
|
|
460
|
+
expect(onStreamSpy).toBeCalledWith(MediaSDK.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
461
|
+
bnrMetricSpy.mockClear();
|
|
462
|
+
/* Invoking the callback function to trigger EffectAdded event to simulate adding effect to the stream */
|
|
463
|
+
onStreamSpy.mock.calls[1][1](mockEffect);
|
|
464
|
+
expect(onEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Enabled, expect.any(Function));
|
|
465
|
+
expect(onEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Disabled, expect.any(Function));
|
|
466
|
+
|
|
467
|
+
/* Send Enabled event on the effect, update track and send metrics for BNR disabled */
|
|
468
|
+
onStreamSpy.mock.calls[0][1](mockTrack);
|
|
469
|
+
onEffectSpy.mock.calls[0][1]();
|
|
470
|
+
expect(updateLocalTracksSpy).toBeCalledOnceWith({
|
|
471
|
+
audio: mockTrack
|
|
472
|
+
});
|
|
473
|
+
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
474
|
+
|
|
475
|
+
/* Clear the mocks */
|
|
476
|
+
updateLocalTracksSpy.mockClear();
|
|
477
|
+
bnrMetricSpy.mockClear();
|
|
478
|
+
|
|
479
|
+
/* Send Disabled event on the effect, update track and send metrics for BNR disabled */
|
|
480
|
+
mockEffect.isEnabled = false;
|
|
481
|
+
onStreamSpy.mock.calls[0][1](mockTrack);
|
|
482
|
+
onEffectSpy.mock.calls[1][1]();
|
|
483
|
+
expect(updateLocalTracksSpy).toBeCalledOnceWith({
|
|
484
|
+
audio: mockTrack
|
|
485
|
+
});
|
|
486
|
+
expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_DISABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
|
|
487
|
+
call.end();
|
|
488
|
+
_context9.next = 35;
|
|
489
|
+
return (0, _Utils.waitForMsecs)(50);
|
|
490
|
+
case 35:
|
|
491
|
+
/* Checks for switching off the listeners on call disconnect */
|
|
492
|
+
expect(offStreamSpy).toBeCalledWith(MediaSDK.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
493
|
+
expect(offEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Enabled, expect.any(Function));
|
|
494
|
+
expect(offEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Disabled, expect.any(Function));
|
|
495
|
+
case 38:
|
|
496
|
+
case "end":
|
|
497
|
+
return _context9.stop();
|
|
498
|
+
}
|
|
499
|
+
}, _callee9);
|
|
500
|
+
})));
|
|
501
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
502
|
+
var mockStream, localAudioStream, warnSpy, call;
|
|
503
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
504
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
415
505
|
case 0:
|
|
416
506
|
mockStream = {
|
|
417
507
|
outputStream: {
|
|
418
508
|
getAudioTracks: jest.fn().mockReturnValue([])
|
|
419
509
|
},
|
|
420
|
-
on: jest.fn()
|
|
510
|
+
on: jest.fn(),
|
|
511
|
+
off: jest.fn(),
|
|
512
|
+
getEffectByKind: jest.fn()
|
|
421
513
|
};
|
|
422
514
|
localAudioStream = mockStream;
|
|
423
515
|
webex.request.mockReturnValue({
|
|
@@ -433,7 +525,7 @@ describe('Call Tests', function () {
|
|
|
433
525
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
434
526
|
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
435
527
|
call.answer(localAudioStream);
|
|
436
|
-
|
|
528
|
+
_context10.next = 8;
|
|
437
529
|
return (0, _Utils.waitForMsecs)(50);
|
|
438
530
|
case 8:
|
|
439
531
|
expect(warnSpy).toBeCalledTimes(2);
|
|
@@ -448,14 +540,14 @@ describe('Call Tests', function () {
|
|
|
448
540
|
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
449
541
|
case 15:
|
|
450
542
|
case "end":
|
|
451
|
-
return
|
|
543
|
+
return _context10.stop();
|
|
452
544
|
}
|
|
453
|
-
},
|
|
545
|
+
}, _callee10);
|
|
454
546
|
})));
|
|
455
|
-
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
547
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
456
548
|
var mockStream, localAudioStream, warnSpy, call;
|
|
457
|
-
return _regenerator.default.wrap(function
|
|
458
|
-
while (1) switch (
|
|
549
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
550
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
459
551
|
case 0:
|
|
460
552
|
mockStream = {
|
|
461
553
|
outputStream: {
|
|
@@ -467,7 +559,7 @@ describe('Call Tests', function () {
|
|
|
467
559
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
468
560
|
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
469
561
|
call.dial(localAudioStream);
|
|
470
|
-
|
|
562
|
+
_context11.next = 7;
|
|
471
563
|
return (0, _Utils.waitForMsecs)(50);
|
|
472
564
|
case 7:
|
|
473
565
|
expect(warnSpy).toBeCalledTimes(1);
|
|
@@ -480,9 +572,9 @@ describe('Call Tests', function () {
|
|
|
480
572
|
expect(webex.request).not.toBeCalledOnceWith();
|
|
481
573
|
case 12:
|
|
482
574
|
case "end":
|
|
483
|
-
return
|
|
575
|
+
return _context11.stop();
|
|
484
576
|
}
|
|
485
|
-
},
|
|
577
|
+
}, _callee11);
|
|
486
578
|
})));
|
|
487
579
|
it('update media after call creation with valid stream', function () {
|
|
488
580
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -490,12 +582,19 @@ describe('Call Tests', function () {
|
|
|
490
582
|
outputStream: {
|
|
491
583
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
492
584
|
},
|
|
493
|
-
on: jest.fn()
|
|
585
|
+
on: jest.fn(),
|
|
586
|
+
off: jest.fn(),
|
|
587
|
+
getEffectByKind: jest.fn()
|
|
494
588
|
};
|
|
495
589
|
var localAudioStream = mockStream;
|
|
590
|
+
var onStream1Spy = jest.spyOn(localAudioStream, 'on');
|
|
591
|
+
var offStream1Spy = jest.spyOn(localAudioStream, 'off');
|
|
496
592
|
var call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
|
|
497
593
|
call.dial(localAudioStream);
|
|
498
594
|
expect(mockTrack.enabled).toEqual(true);
|
|
595
|
+
expect(onStream1Spy).toBeCalledTimes(2);
|
|
596
|
+
expect(onStream1Spy).toBeCalledWith(MediaSDK.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
|
|
597
|
+
expect(onStream1Spy).toBeCalledWith(MediaSDK.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
499
598
|
var mockTrack2 = {
|
|
500
599
|
enabled: true
|
|
501
600
|
};
|
|
@@ -503,13 +602,19 @@ describe('Call Tests', function () {
|
|
|
503
602
|
outputStream: {
|
|
504
603
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack2])
|
|
505
604
|
},
|
|
506
|
-
on: jest.fn()
|
|
605
|
+
on: jest.fn(),
|
|
606
|
+
getEffectByKind: jest.fn()
|
|
507
607
|
};
|
|
508
608
|
var localAudioStream2 = mockStream2;
|
|
609
|
+
var onStream2Spy = jest.spyOn(localAudioStream2, 'on');
|
|
509
610
|
call.updateMedia(localAudioStream2);
|
|
510
611
|
expect(call['mediaConnection'].updateLocalTracks).toBeCalledOnceWith({
|
|
511
612
|
audio: mockTrack2
|
|
512
613
|
});
|
|
614
|
+
expect(call['localAudioStream']).toEqual(localAudioStream2);
|
|
615
|
+
expect(offStream1Spy).toBeCalledWith(MediaSDK.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
616
|
+
expect(onStream2Spy).toBeCalledWith(MediaSDK.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
|
|
617
|
+
expect(onStream2Spy).toBeCalledWith(MediaSDK.LocalStreamEventNames.EffectAdded, expect.any(Function));
|
|
513
618
|
});
|
|
514
619
|
it('update media with invalid stream', function () {
|
|
515
620
|
var callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
@@ -518,7 +623,8 @@ describe('Call Tests', function () {
|
|
|
518
623
|
outputStream: {
|
|
519
624
|
getAudioTracks: jest.fn().mockReturnValue([mockTrack])
|
|
520
625
|
},
|
|
521
|
-
on: jest.fn()
|
|
626
|
+
on: jest.fn(),
|
|
627
|
+
getEffectByKind: jest.fn()
|
|
522
628
|
};
|
|
523
629
|
var localAudioStream = mockStream;
|
|
524
630
|
var call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
|
|
@@ -567,10 +673,10 @@ describe('State Machine handler tests', function () {
|
|
|
567
673
|
|
|
568
674
|
// afterEach(() => call.removeAllListeners());
|
|
569
675
|
|
|
570
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
676
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
571
677
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
572
|
-
return _regenerator.default.wrap(function
|
|
573
|
-
while (1) switch (
|
|
678
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
679
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
574
680
|
case 0:
|
|
575
681
|
statusPayload = {
|
|
576
682
|
statusCode: 200,
|
|
@@ -590,7 +696,7 @@ describe('State Machine handler tests', function () {
|
|
|
590
696
|
/* This is to flush all the promises from the Promise queue so that
|
|
591
697
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
592
698
|
*/
|
|
593
|
-
|
|
699
|
+
_context12.next = 11;
|
|
594
700
|
return (0, _testUtil.flushPromises)(3);
|
|
595
701
|
case 11:
|
|
596
702
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -601,14 +707,14 @@ describe('State Machine handler tests', function () {
|
|
|
601
707
|
});
|
|
602
708
|
case 14:
|
|
603
709
|
case "end":
|
|
604
|
-
return
|
|
710
|
+
return _context12.stop();
|
|
605
711
|
}
|
|
606
|
-
},
|
|
712
|
+
}, _callee12);
|
|
607
713
|
})));
|
|
608
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
714
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
609
715
|
var statusPayload, funcSpy;
|
|
610
|
-
return _regenerator.default.wrap(function
|
|
611
|
-
while (1) switch (
|
|
716
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
717
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
612
718
|
case 0:
|
|
613
719
|
expect.assertions(4);
|
|
614
720
|
statusPayload = {
|
|
@@ -632,24 +738,24 @@ describe('State Machine handler tests', function () {
|
|
|
632
738
|
/* This is to flush all the promises from the Promise queue so that
|
|
633
739
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
634
740
|
*/
|
|
635
|
-
|
|
741
|
+
_context13.next = 11;
|
|
636
742
|
return _promise.default.resolve();
|
|
637
743
|
case 11:
|
|
638
|
-
|
|
744
|
+
_context13.next = 13;
|
|
639
745
|
return _promise.default.resolve();
|
|
640
746
|
case 13:
|
|
641
747
|
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
642
748
|
expect(funcSpy).toBeCalledTimes(1);
|
|
643
749
|
case 15:
|
|
644
750
|
case "end":
|
|
645
|
-
return
|
|
751
|
+
return _context13.stop();
|
|
646
752
|
}
|
|
647
|
-
},
|
|
753
|
+
}, _callee13);
|
|
648
754
|
})));
|
|
649
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
755
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
650
756
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
651
|
-
return _regenerator.default.wrap(function
|
|
652
|
-
while (1) switch (
|
|
757
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
758
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
653
759
|
case 0:
|
|
654
760
|
statusPayload = {
|
|
655
761
|
statusCode: 200,
|
|
@@ -705,14 +811,14 @@ describe('State Machine handler tests', function () {
|
|
|
705
811
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
706
812
|
case 27:
|
|
707
813
|
case "end":
|
|
708
|
-
return
|
|
814
|
+
return _context14.stop();
|
|
709
815
|
}
|
|
710
|
-
},
|
|
816
|
+
}, _callee14);
|
|
711
817
|
})));
|
|
712
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
818
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
713
819
|
var statusPayload, dummyEvent;
|
|
714
|
-
return _regenerator.default.wrap(function
|
|
715
|
-
while (1) switch (
|
|
820
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
821
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
716
822
|
case 0:
|
|
717
823
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
718
824
|
statusPayload = {
|
|
@@ -730,7 +836,7 @@ describe('State Machine handler tests', function () {
|
|
|
730
836
|
webex.request.mockReturnValue(statusPayload);
|
|
731
837
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
732
838
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
733
|
-
|
|
839
|
+
_context15.next = 8;
|
|
734
840
|
return call['handleOutgoingCallConnect']({
|
|
735
841
|
type: 'E_SEND_CALL_CONNECT'
|
|
736
842
|
});
|
|
@@ -744,14 +850,14 @@ describe('State Machine handler tests', function () {
|
|
|
744
850
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
745
851
|
case 12:
|
|
746
852
|
case "end":
|
|
747
|
-
return
|
|
853
|
+
return _context15.stop();
|
|
748
854
|
}
|
|
749
|
-
},
|
|
855
|
+
}, _callee15);
|
|
750
856
|
})));
|
|
751
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
857
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
752
858
|
var warnSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
753
|
-
return _regenerator.default.wrap(function
|
|
754
|
-
while (1) switch (
|
|
859
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
860
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
755
861
|
case 0:
|
|
756
862
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
757
863
|
stateMachineSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
@@ -777,7 +883,7 @@ describe('State Machine handler tests', function () {
|
|
|
777
883
|
webex.request.mockRejectedValueOnce({
|
|
778
884
|
statusCode: 403
|
|
779
885
|
}).mockResolvedValue(statusPayload);
|
|
780
|
-
|
|
886
|
+
_context16.next = 12;
|
|
781
887
|
return call['handleOutgoingCallConnect']({
|
|
782
888
|
type: 'E_SEND_CALL_CONNECT'
|
|
783
889
|
});
|
|
@@ -787,14 +893,14 @@ describe('State Machine handler tests', function () {
|
|
|
787
893
|
expect(warnSpy).toBeCalledTimes(4);
|
|
788
894
|
case 15:
|
|
789
895
|
case "end":
|
|
790
|
-
return
|
|
896
|
+
return _context16.stop();
|
|
791
897
|
}
|
|
792
|
-
},
|
|
898
|
+
}, _callee16);
|
|
793
899
|
})));
|
|
794
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
900
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
795
901
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent;
|
|
796
|
-
return _regenerator.default.wrap(function
|
|
797
|
-
while (1) switch (
|
|
902
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
903
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
798
904
|
case 0:
|
|
799
905
|
statusPayload = {
|
|
800
906
|
statusCode: 200,
|
|
@@ -868,14 +974,14 @@ describe('State Machine handler tests', function () {
|
|
|
868
974
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
869
975
|
case 40:
|
|
870
976
|
case "end":
|
|
871
|
-
return
|
|
977
|
+
return _context17.stop();
|
|
872
978
|
}
|
|
873
|
-
},
|
|
979
|
+
}, _callee17);
|
|
874
980
|
})));
|
|
875
|
-
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
981
|
+
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
876
982
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
877
|
-
return _regenerator.default.wrap(function
|
|
878
|
-
while (1) switch (
|
|
983
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
984
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
879
985
|
case 0:
|
|
880
986
|
statusPayload = {
|
|
881
987
|
statusCode: 200,
|
|
@@ -943,14 +1049,14 @@ describe('State Machine handler tests', function () {
|
|
|
943
1049
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
944
1050
|
case 25:
|
|
945
1051
|
case "end":
|
|
946
|
-
return
|
|
1052
|
+
return _context18.stop();
|
|
947
1053
|
}
|
|
948
|
-
},
|
|
1054
|
+
}, _callee18);
|
|
949
1055
|
})));
|
|
950
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1056
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
951
1057
|
var statusPayload, dummyEvent;
|
|
952
|
-
return _regenerator.default.wrap(function
|
|
953
|
-
while (1) switch (
|
|
1058
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1059
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
954
1060
|
case 0:
|
|
955
1061
|
statusPayload = {
|
|
956
1062
|
statusCode: 200,
|
|
@@ -989,14 +1095,14 @@ describe('State Machine handler tests', function () {
|
|
|
989
1095
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
990
1096
|
case 17:
|
|
991
1097
|
case "end":
|
|
992
|
-
return
|
|
1098
|
+
return _context19.stop();
|
|
993
1099
|
}
|
|
994
|
-
},
|
|
1100
|
+
}, _callee19);
|
|
995
1101
|
})));
|
|
996
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1102
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
997
1103
|
var statusPayload, dummyEvent;
|
|
998
|
-
return _regenerator.default.wrap(function
|
|
999
|
-
while (1) switch (
|
|
1104
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1105
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1000
1106
|
case 0:
|
|
1001
1107
|
statusPayload = {
|
|
1002
1108
|
statusCode: 403,
|
|
@@ -1012,20 +1118,20 @@ describe('State Machine handler tests', function () {
|
|
|
1012
1118
|
};
|
|
1013
1119
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1014
1120
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1015
|
-
|
|
1121
|
+
_context20.next = 6;
|
|
1016
1122
|
return (0, _testUtil.flushPromises)(3);
|
|
1017
1123
|
case 6:
|
|
1018
1124
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1019
1125
|
case 7:
|
|
1020
1126
|
case "end":
|
|
1021
|
-
return
|
|
1127
|
+
return _context20.stop();
|
|
1022
1128
|
}
|
|
1023
|
-
},
|
|
1129
|
+
}, _callee20);
|
|
1024
1130
|
})));
|
|
1025
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1131
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1026
1132
|
var statusPayload, dummyEvent;
|
|
1027
|
-
return _regenerator.default.wrap(function
|
|
1028
|
-
while (1) switch (
|
|
1133
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
1134
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1029
1135
|
case 0:
|
|
1030
1136
|
statusPayload = {
|
|
1031
1137
|
statusCode: 403,
|
|
@@ -1042,10 +1148,10 @@ describe('State Machine handler tests', function () {
|
|
|
1042
1148
|
call['earlyMedia'] = true;
|
|
1043
1149
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1044
1150
|
webex.request.mockRejectedValue(statusPayload);
|
|
1045
|
-
|
|
1151
|
+
_context21.next = 8;
|
|
1046
1152
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1047
1153
|
case 8:
|
|
1048
|
-
|
|
1154
|
+
_context21.next = 10;
|
|
1049
1155
|
return (0, _testUtil.flushPromises)(2);
|
|
1050
1156
|
case 10:
|
|
1051
1157
|
expect(call.isConnected()).toBe(false);
|
|
@@ -1053,14 +1159,14 @@ describe('State Machine handler tests', function () {
|
|
|
1053
1159
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
1054
1160
|
case 13:
|
|
1055
1161
|
case "end":
|
|
1056
|
-
return
|
|
1162
|
+
return _context21.stop();
|
|
1057
1163
|
}
|
|
1058
|
-
},
|
|
1164
|
+
}, _callee21);
|
|
1059
1165
|
})));
|
|
1060
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1166
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1061
1167
|
var statusPayload, dummyEvent;
|
|
1062
|
-
return _regenerator.default.wrap(function
|
|
1063
|
-
while (1) switch (
|
|
1168
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
1169
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1064
1170
|
case 0:
|
|
1065
1171
|
statusPayload = {
|
|
1066
1172
|
statusCode: 403,
|
|
@@ -1083,14 +1189,14 @@ describe('State Machine handler tests', function () {
|
|
|
1083
1189
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1084
1190
|
case 8:
|
|
1085
1191
|
case "end":
|
|
1086
|
-
return
|
|
1192
|
+
return _context22.stop();
|
|
1087
1193
|
}
|
|
1088
|
-
},
|
|
1194
|
+
}, _callee22);
|
|
1089
1195
|
})));
|
|
1090
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1196
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1091
1197
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1092
|
-
return _regenerator.default.wrap(function
|
|
1093
|
-
while (1) switch (
|
|
1198
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
1199
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1094
1200
|
case 0:
|
|
1095
1201
|
statusPayload = {
|
|
1096
1202
|
statusCode: 503,
|
|
@@ -1112,7 +1218,7 @@ describe('State Machine handler tests', function () {
|
|
|
1112
1218
|
}
|
|
1113
1219
|
};
|
|
1114
1220
|
call['connected'] = true;
|
|
1115
|
-
|
|
1221
|
+
_context23.next = 8;
|
|
1116
1222
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1117
1223
|
case 8:
|
|
1118
1224
|
jest.advanceTimersByTime(1005);
|
|
@@ -1124,14 +1230,14 @@ describe('State Machine handler tests', function () {
|
|
|
1124
1230
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1125
1231
|
case 13:
|
|
1126
1232
|
case "end":
|
|
1127
|
-
return
|
|
1233
|
+
return _context23.stop();
|
|
1128
1234
|
}
|
|
1129
|
-
},
|
|
1235
|
+
}, _callee23);
|
|
1130
1236
|
})));
|
|
1131
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1237
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1132
1238
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1133
|
-
return _regenerator.default.wrap(function
|
|
1134
|
-
while (1) switch (
|
|
1239
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
1240
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1135
1241
|
case 0:
|
|
1136
1242
|
statusPayload = {
|
|
1137
1243
|
statusCode: 503,
|
|
@@ -1153,7 +1259,7 @@ describe('State Machine handler tests', function () {
|
|
|
1153
1259
|
}
|
|
1154
1260
|
};
|
|
1155
1261
|
call['connected'] = false;
|
|
1156
|
-
|
|
1262
|
+
_context24.next = 8;
|
|
1157
1263
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1158
1264
|
case 8:
|
|
1159
1265
|
jest.advanceTimersByTime(1005);
|
|
@@ -1164,14 +1270,14 @@ describe('State Machine handler tests', function () {
|
|
|
1164
1270
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1165
1271
|
case 12:
|
|
1166
1272
|
case "end":
|
|
1167
|
-
return
|
|
1273
|
+
return _context24.stop();
|
|
1168
1274
|
}
|
|
1169
|
-
},
|
|
1275
|
+
}, _callee24);
|
|
1170
1276
|
})));
|
|
1171
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1277
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1172
1278
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1173
|
-
return _regenerator.default.wrap(function
|
|
1174
|
-
while (1) switch (
|
|
1279
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
1280
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1175
1281
|
case 0:
|
|
1176
1282
|
statusPayload = {
|
|
1177
1283
|
statusCode: 503,
|
|
@@ -1193,7 +1299,7 @@ describe('State Machine handler tests', function () {
|
|
|
1193
1299
|
};
|
|
1194
1300
|
call['connected'] = true;
|
|
1195
1301
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1196
|
-
|
|
1302
|
+
_context25.next = 9;
|
|
1197
1303
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1198
1304
|
case 9:
|
|
1199
1305
|
jest.advanceTimersByTime(1005);
|
|
@@ -1205,14 +1311,14 @@ describe('State Machine handler tests', function () {
|
|
|
1205
1311
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1206
1312
|
case 14:
|
|
1207
1313
|
case "end":
|
|
1208
|
-
return
|
|
1314
|
+
return _context25.stop();
|
|
1209
1315
|
}
|
|
1210
|
-
},
|
|
1316
|
+
}, _callee25);
|
|
1211
1317
|
})));
|
|
1212
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1318
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1213
1319
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1214
|
-
return _regenerator.default.wrap(function
|
|
1215
|
-
while (1) switch (
|
|
1320
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
1321
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1216
1322
|
case 0:
|
|
1217
1323
|
statusPayload = {
|
|
1218
1324
|
statusCode: 503,
|
|
@@ -1233,7 +1339,7 @@ describe('State Machine handler tests', function () {
|
|
|
1233
1339
|
}
|
|
1234
1340
|
};
|
|
1235
1341
|
call['connected'] = false;
|
|
1236
|
-
|
|
1342
|
+
_context26.next = 8;
|
|
1237
1343
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1238
1344
|
case 8:
|
|
1239
1345
|
jest.advanceTimersByTime(1005);
|
|
@@ -1245,14 +1351,14 @@ describe('State Machine handler tests', function () {
|
|
|
1245
1351
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1246
1352
|
case 13:
|
|
1247
1353
|
case "end":
|
|
1248
|
-
return
|
|
1354
|
+
return _context26.stop();
|
|
1249
1355
|
}
|
|
1250
|
-
},
|
|
1356
|
+
}, _callee26);
|
|
1251
1357
|
})));
|
|
1252
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1358
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1253
1359
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1254
|
-
return _regenerator.default.wrap(function
|
|
1255
|
-
while (1) switch (
|
|
1360
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
1361
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1256
1362
|
case 0:
|
|
1257
1363
|
statusPayload = {
|
|
1258
1364
|
statusCode: 200,
|
|
@@ -1277,14 +1383,14 @@ describe('State Machine handler tests', function () {
|
|
|
1277
1383
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1278
1384
|
case 11:
|
|
1279
1385
|
case "end":
|
|
1280
|
-
return
|
|
1386
|
+
return _context27.stop();
|
|
1281
1387
|
}
|
|
1282
|
-
},
|
|
1388
|
+
}, _callee27);
|
|
1283
1389
|
})));
|
|
1284
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1390
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1285
1391
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1286
|
-
return _regenerator.default.wrap(function
|
|
1287
|
-
while (1) switch (
|
|
1392
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
1393
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1288
1394
|
case 0:
|
|
1289
1395
|
statusPayload = {
|
|
1290
1396
|
statusCode: 503,
|
|
@@ -1306,7 +1412,7 @@ describe('State Machine handler tests', function () {
|
|
|
1306
1412
|
};
|
|
1307
1413
|
call['connected'] = true;
|
|
1308
1414
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1309
|
-
|
|
1415
|
+
_context28.next = 9;
|
|
1310
1416
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1311
1417
|
case 9:
|
|
1312
1418
|
jest.advanceTimersByTime(1005);
|
|
@@ -1318,14 +1424,14 @@ describe('State Machine handler tests', function () {
|
|
|
1318
1424
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1319
1425
|
case 14:
|
|
1320
1426
|
case "end":
|
|
1321
|
-
return
|
|
1427
|
+
return _context28.stop();
|
|
1322
1428
|
}
|
|
1323
|
-
},
|
|
1429
|
+
}, _callee28);
|
|
1324
1430
|
})));
|
|
1325
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1431
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1326
1432
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1327
|
-
return _regenerator.default.wrap(function
|
|
1328
|
-
while (1) switch (
|
|
1433
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1434
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1329
1435
|
case 0:
|
|
1330
1436
|
statusPayload = {
|
|
1331
1437
|
statusCode: 403,
|
|
@@ -1348,14 +1454,14 @@ describe('State Machine handler tests', function () {
|
|
|
1348
1454
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1349
1455
|
case 9:
|
|
1350
1456
|
case "end":
|
|
1351
|
-
return
|
|
1457
|
+
return _context29.stop();
|
|
1352
1458
|
}
|
|
1353
|
-
},
|
|
1459
|
+
}, _callee29);
|
|
1354
1460
|
})));
|
|
1355
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1461
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1356
1462
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1357
|
-
return _regenerator.default.wrap(function
|
|
1358
|
-
while (1) switch (
|
|
1463
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1464
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1359
1465
|
case 0:
|
|
1360
1466
|
statusPayload = {
|
|
1361
1467
|
statusCode: 200,
|
|
@@ -1373,7 +1479,7 @@ describe('State Machine handler tests', function () {
|
|
|
1373
1479
|
}
|
|
1374
1480
|
};
|
|
1375
1481
|
call['connected'] = false;
|
|
1376
|
-
|
|
1482
|
+
_context30.next = 8;
|
|
1377
1483
|
return call['handleRoapError']({}, errorEvent);
|
|
1378
1484
|
case 8:
|
|
1379
1485
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1389,14 +1495,14 @@ describe('State Machine handler tests', function () {
|
|
|
1389
1495
|
});
|
|
1390
1496
|
case 11:
|
|
1391
1497
|
case "end":
|
|
1392
|
-
return
|
|
1498
|
+
return _context30.stop();
|
|
1393
1499
|
}
|
|
1394
|
-
},
|
|
1500
|
+
}, _callee30);
|
|
1395
1501
|
})));
|
|
1396
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1502
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1397
1503
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1398
|
-
return _regenerator.default.wrap(function
|
|
1399
|
-
while (1) switch (
|
|
1504
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
1505
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1400
1506
|
case 0:
|
|
1401
1507
|
statusPayload = {
|
|
1402
1508
|
statusCode: 200,
|
|
@@ -1429,7 +1535,7 @@ describe('State Machine handler tests', function () {
|
|
|
1429
1535
|
seq: 1,
|
|
1430
1536
|
messageType: 'ANSWER'
|
|
1431
1537
|
};
|
|
1432
|
-
|
|
1538
|
+
_context31.next = 17;
|
|
1433
1539
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1434
1540
|
case 17:
|
|
1435
1541
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1451,7 +1557,7 @@ describe('State Machine handler tests', function () {
|
|
|
1451
1557
|
seq: 2,
|
|
1452
1558
|
messageType: 'OFFER_REQUEST'
|
|
1453
1559
|
};
|
|
1454
|
-
|
|
1560
|
+
_context31.next = 23;
|
|
1455
1561
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1456
1562
|
case 23:
|
|
1457
1563
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1501,7 +1607,7 @@ describe('State Machine handler tests', function () {
|
|
|
1501
1607
|
};
|
|
1502
1608
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1503
1609
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1504
|
-
|
|
1610
|
+
_context31.next = 49;
|
|
1505
1611
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1506
1612
|
case 49:
|
|
1507
1613
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1510,7 +1616,7 @@ describe('State Machine handler tests', function () {
|
|
|
1510
1616
|
seq: 3,
|
|
1511
1617
|
messageType: 'ANSWER'
|
|
1512
1618
|
};
|
|
1513
|
-
|
|
1619
|
+
_context31.next = 54;
|
|
1514
1620
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1515
1621
|
case 54:
|
|
1516
1622
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1529,7 +1635,7 @@ describe('State Machine handler tests', function () {
|
|
|
1529
1635
|
messageType: 'OK'
|
|
1530
1636
|
}
|
|
1531
1637
|
};
|
|
1532
|
-
|
|
1638
|
+
_context31.next = 63;
|
|
1533
1639
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1534
1640
|
case 63:
|
|
1535
1641
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1544,14 +1650,14 @@ describe('State Machine handler tests', function () {
|
|
|
1544
1650
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1545
1651
|
case 70:
|
|
1546
1652
|
case "end":
|
|
1547
|
-
return
|
|
1653
|
+
return _context31.stop();
|
|
1548
1654
|
}
|
|
1549
|
-
},
|
|
1655
|
+
}, _callee31);
|
|
1550
1656
|
})));
|
|
1551
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1657
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1552
1658
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1553
|
-
return _regenerator.default.wrap(function
|
|
1554
|
-
while (1) switch (
|
|
1659
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1660
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1555
1661
|
case 0:
|
|
1556
1662
|
mockStatusBody = {
|
|
1557
1663
|
device: {
|
|
@@ -1591,7 +1697,7 @@ describe('State Machine handler tests', function () {
|
|
|
1591
1697
|
seq: 1,
|
|
1592
1698
|
messageType: 'ANSWER'
|
|
1593
1699
|
};
|
|
1594
|
-
|
|
1700
|
+
_context32.next = 18;
|
|
1595
1701
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1596
1702
|
case 18:
|
|
1597
1703
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1613,7 +1719,7 @@ describe('State Machine handler tests', function () {
|
|
|
1613
1719
|
seq: 2,
|
|
1614
1720
|
messageType: 'OFFER_REQUEST'
|
|
1615
1721
|
};
|
|
1616
|
-
|
|
1722
|
+
_context32.next = 24;
|
|
1617
1723
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1618
1724
|
case 24:
|
|
1619
1725
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1663,7 +1769,7 @@ describe('State Machine handler tests', function () {
|
|
|
1663
1769
|
};
|
|
1664
1770
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1665
1771
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1666
|
-
|
|
1772
|
+
_context32.next = 50;
|
|
1667
1773
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1668
1774
|
case 50:
|
|
1669
1775
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1672,7 +1778,7 @@ describe('State Machine handler tests', function () {
|
|
|
1672
1778
|
seq: 3,
|
|
1673
1779
|
messageType: 'ANSWER'
|
|
1674
1780
|
};
|
|
1675
|
-
|
|
1781
|
+
_context32.next = 55;
|
|
1676
1782
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1677
1783
|
case 55:
|
|
1678
1784
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1689,7 +1795,7 @@ describe('State Machine handler tests', function () {
|
|
|
1689
1795
|
}
|
|
1690
1796
|
};
|
|
1691
1797
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1692
|
-
|
|
1798
|
+
_context32.next = 62;
|
|
1693
1799
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1694
1800
|
case 62:
|
|
1695
1801
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1705,14 +1811,14 @@ describe('State Machine handler tests', function () {
|
|
|
1705
1811
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1706
1812
|
case 70:
|
|
1707
1813
|
case "end":
|
|
1708
|
-
return
|
|
1814
|
+
return _context32.stop();
|
|
1709
1815
|
}
|
|
1710
|
-
},
|
|
1816
|
+
}, _callee32);
|
|
1711
1817
|
})));
|
|
1712
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1818
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1713
1819
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1714
|
-
return _regenerator.default.wrap(function
|
|
1715
|
-
while (1) switch (
|
|
1820
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1821
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1716
1822
|
case 0:
|
|
1717
1823
|
statusPayload = {
|
|
1718
1824
|
statusCode: 200,
|
|
@@ -1779,9 +1885,9 @@ describe('State Machine handler tests', function () {
|
|
|
1779
1885
|
});
|
|
1780
1886
|
case 33:
|
|
1781
1887
|
case "end":
|
|
1782
|
-
return
|
|
1888
|
+
return _context33.stop();
|
|
1783
1889
|
}
|
|
1784
|
-
},
|
|
1890
|
+
}, _callee33);
|
|
1785
1891
|
})));
|
|
1786
1892
|
});
|
|
1787
1893
|
describe('Supplementary Services tests', function () {
|
|
@@ -1840,10 +1946,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1840
1946
|
beforeEach(function () {
|
|
1841
1947
|
call.removeAllListeners();
|
|
1842
1948
|
});
|
|
1843
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1949
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1844
1950
|
var responsePayload, warnSpy, roapEvent;
|
|
1845
|
-
return _regenerator.default.wrap(function
|
|
1846
|
-
while (1) switch (
|
|
1951
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
1952
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1847
1953
|
case 0:
|
|
1848
1954
|
expect.assertions(7);
|
|
1849
1955
|
responsePayload = {
|
|
@@ -1856,25 +1962,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1856
1962
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1857
1963
|
call['held'] = false;
|
|
1858
1964
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1859
|
-
var
|
|
1860
|
-
return _regenerator.default.wrap(function
|
|
1861
|
-
while (1) switch (
|
|
1965
|
+
var _ref35 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(correlationId) {
|
|
1966
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1967
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1862
1968
|
case 0:
|
|
1863
1969
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1864
1970
|
case 1:
|
|
1865
1971
|
case "end":
|
|
1866
|
-
return
|
|
1972
|
+
return _context34.stop();
|
|
1867
1973
|
}
|
|
1868
|
-
},
|
|
1974
|
+
}, _callee34);
|
|
1869
1975
|
}));
|
|
1870
1976
|
return function (_x) {
|
|
1871
|
-
return
|
|
1977
|
+
return _ref35.apply(this, arguments);
|
|
1872
1978
|
};
|
|
1873
1979
|
}());
|
|
1874
|
-
|
|
1980
|
+
_context35.next = 10;
|
|
1875
1981
|
return call.doHoldResume();
|
|
1876
1982
|
case 10:
|
|
1877
|
-
|
|
1983
|
+
_context35.next = 12;
|
|
1878
1984
|
return (0, _testUtil.flushPromises)(2);
|
|
1879
1985
|
case 12:
|
|
1880
1986
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1890,11 +1996,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1890
1996
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1891
1997
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1892
1998
|
roapEvent.data.type = 'ANSWER';
|
|
1893
|
-
|
|
1999
|
+
_context35.next = 20;
|
|
1894
2000
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1895
2001
|
case 20:
|
|
1896
2002
|
roapEvent.data.type = 'OK';
|
|
1897
|
-
|
|
2003
|
+
_context35.next = 23;
|
|
1898
2004
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1899
2005
|
case 23:
|
|
1900
2006
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1909,14 +2015,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1909
2015
|
});
|
|
1910
2016
|
case 28:
|
|
1911
2017
|
case "end":
|
|
1912
|
-
return
|
|
2018
|
+
return _context35.stop();
|
|
1913
2019
|
}
|
|
1914
|
-
},
|
|
2020
|
+
}, _callee35);
|
|
1915
2021
|
})));
|
|
1916
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2022
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1917
2023
|
var responsePayload, warnSpy, roapEvent;
|
|
1918
|
-
return _regenerator.default.wrap(function
|
|
1919
|
-
while (1) switch (
|
|
2024
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
2025
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1920
2026
|
case 0:
|
|
1921
2027
|
expect.assertions(8);
|
|
1922
2028
|
responsePayload = {
|
|
@@ -1929,26 +2035,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1929
2035
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1930
2036
|
call['held'] = false;
|
|
1931
2037
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1932
|
-
var
|
|
1933
|
-
return _regenerator.default.wrap(function
|
|
1934
|
-
while (1) switch (
|
|
2038
|
+
var _ref37 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(correlationId) {
|
|
2039
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
2040
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1935
2041
|
case 0:
|
|
1936
2042
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1937
2043
|
case 1:
|
|
1938
2044
|
case "end":
|
|
1939
|
-
return
|
|
2045
|
+
return _context36.stop();
|
|
1940
2046
|
}
|
|
1941
|
-
},
|
|
2047
|
+
}, _callee36);
|
|
1942
2048
|
}));
|
|
1943
2049
|
return function (_x2) {
|
|
1944
|
-
return
|
|
2050
|
+
return _ref37.apply(this, arguments);
|
|
1945
2051
|
};
|
|
1946
2052
|
}());
|
|
1947
2053
|
call.doHoldResume();
|
|
1948
|
-
|
|
2054
|
+
_context37.next = 11;
|
|
1949
2055
|
return _promise.default.resolve();
|
|
1950
2056
|
case 11:
|
|
1951
|
-
|
|
2057
|
+
_context37.next = 13;
|
|
1952
2058
|
return _promise.default.resolve();
|
|
1953
2059
|
case 13:
|
|
1954
2060
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -1964,11 +2070,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1964
2070
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1965
2071
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1966
2072
|
roapEvent.data.type = 'ANSWER';
|
|
1967
|
-
|
|
2073
|
+
_context37.next = 22;
|
|
1968
2074
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1969
2075
|
case 22:
|
|
1970
2076
|
roapEvent.data.type = 'OK';
|
|
1971
|
-
|
|
2077
|
+
_context37.next = 25;
|
|
1972
2078
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1973
2079
|
case 25:
|
|
1974
2080
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -1983,14 +2089,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1983
2089
|
});
|
|
1984
2090
|
case 30:
|
|
1985
2091
|
case "end":
|
|
1986
|
-
return
|
|
2092
|
+
return _context37.stop();
|
|
1987
2093
|
}
|
|
1988
|
-
},
|
|
2094
|
+
}, _callee37);
|
|
1989
2095
|
})));
|
|
1990
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2096
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1991
2097
|
var responsePayload;
|
|
1992
|
-
return _regenerator.default.wrap(function
|
|
1993
|
-
while (1) switch (
|
|
2098
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
2099
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1994
2100
|
case 0:
|
|
1995
2101
|
expect.assertions(4);
|
|
1996
2102
|
responsePayload = {
|
|
@@ -2000,26 +2106,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2000
2106
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2001
2107
|
call['held'] = false;
|
|
2002
2108
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2003
|
-
var
|
|
2004
|
-
return _regenerator.default.wrap(function
|
|
2005
|
-
while (1) switch (
|
|
2109
|
+
var _ref39 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(errObj) {
|
|
2110
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
2111
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2006
2112
|
case 0:
|
|
2007
2113
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2008
2114
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2009
2115
|
case 2:
|
|
2010
2116
|
case "end":
|
|
2011
|
-
return
|
|
2117
|
+
return _context38.stop();
|
|
2012
2118
|
}
|
|
2013
|
-
},
|
|
2119
|
+
}, _callee38);
|
|
2014
2120
|
}));
|
|
2015
2121
|
return function (_x3) {
|
|
2016
|
-
return
|
|
2122
|
+
return _ref39.apply(this, arguments);
|
|
2017
2123
|
};
|
|
2018
2124
|
}());
|
|
2019
|
-
|
|
2125
|
+
_context39.next = 7;
|
|
2020
2126
|
return call.doHoldResume();
|
|
2021
2127
|
case 7:
|
|
2022
|
-
|
|
2128
|
+
_context39.next = 9;
|
|
2023
2129
|
return (0, _testUtil.flushPromises)(2);
|
|
2024
2130
|
case 9:
|
|
2025
2131
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2029,14 +2135,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2029
2135
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2030
2136
|
case 11:
|
|
2031
2137
|
case "end":
|
|
2032
|
-
return
|
|
2138
|
+
return _context39.stop();
|
|
2033
2139
|
}
|
|
2034
|
-
},
|
|
2140
|
+
}, _callee39);
|
|
2035
2141
|
})));
|
|
2036
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2142
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2037
2143
|
var responsePayload, rejectPayload, roapEvent;
|
|
2038
|
-
return _regenerator.default.wrap(function
|
|
2039
|
-
while (1) switch (
|
|
2144
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2145
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2040
2146
|
case 0:
|
|
2041
2147
|
expect.assertions(5);
|
|
2042
2148
|
responsePayload = {
|
|
@@ -2050,24 +2156,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2050
2156
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2051
2157
|
call['held'] = false;
|
|
2052
2158
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2053
|
-
var
|
|
2054
|
-
return _regenerator.default.wrap(function
|
|
2055
|
-
while (1) switch (
|
|
2159
|
+
var _ref41 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(errObj) {
|
|
2160
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
2161
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2056
2162
|
case 0:
|
|
2057
2163
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2058
2164
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2059
2165
|
case 2:
|
|
2060
2166
|
case "end":
|
|
2061
|
-
return
|
|
2167
|
+
return _context40.stop();
|
|
2062
2168
|
}
|
|
2063
|
-
},
|
|
2169
|
+
}, _callee40);
|
|
2064
2170
|
}));
|
|
2065
2171
|
return function (_x4) {
|
|
2066
|
-
return
|
|
2172
|
+
return _ref41.apply(this, arguments);
|
|
2067
2173
|
};
|
|
2068
2174
|
}());
|
|
2069
2175
|
call.doHoldResume();
|
|
2070
|
-
|
|
2176
|
+
_context41.next = 9;
|
|
2071
2177
|
return (0, _testUtil.flushPromises)(2);
|
|
2072
2178
|
case 9:
|
|
2073
2179
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2077,7 +2183,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2077
2183
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2078
2184
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2079
2185
|
roapEvent.data.type = 'ANSWER';
|
|
2080
|
-
|
|
2186
|
+
_context41.next = 15;
|
|
2081
2187
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2082
2188
|
case 15:
|
|
2083
2189
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2085,14 +2191,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2085
2191
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2086
2192
|
case 17:
|
|
2087
2193
|
case "end":
|
|
2088
|
-
return
|
|
2194
|
+
return _context41.stop();
|
|
2089
2195
|
}
|
|
2090
|
-
},
|
|
2196
|
+
}, _callee41);
|
|
2091
2197
|
})));
|
|
2092
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2198
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2093
2199
|
var responsePayload, warnSpy, roapEvent;
|
|
2094
|
-
return _regenerator.default.wrap(function
|
|
2095
|
-
while (1) switch (
|
|
2200
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2201
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2096
2202
|
case 0:
|
|
2097
2203
|
responsePayload = {
|
|
2098
2204
|
statusCode: 200,
|
|
@@ -2103,10 +2209,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2103
2209
|
jest.spyOn(global, 'clearTimeout');
|
|
2104
2210
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2105
2211
|
call['held'] = false;
|
|
2106
|
-
|
|
2212
|
+
_context42.next = 8;
|
|
2107
2213
|
return call.doHoldResume();
|
|
2108
2214
|
case 8:
|
|
2109
|
-
|
|
2215
|
+
_context42.next = 10;
|
|
2110
2216
|
return (0, _testUtil.flushPromises)(2);
|
|
2111
2217
|
case 10:
|
|
2112
2218
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2121,19 +2227,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2121
2227
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2122
2228
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2123
2229
|
roapEvent.data.type = 'ANSWER';
|
|
2124
|
-
|
|
2230
|
+
_context42.next = 17;
|
|
2125
2231
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2126
2232
|
case 17:
|
|
2127
2233
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2128
2234
|
statusCode: 403
|
|
2129
2235
|
});
|
|
2130
2236
|
roapEvent.data.type = 'OK';
|
|
2131
|
-
|
|
2237
|
+
_context42.next = 21;
|
|
2132
2238
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2133
2239
|
case 21:
|
|
2134
2240
|
/* this is for coverage */
|
|
2135
2241
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2136
|
-
|
|
2242
|
+
_context42.next = 24;
|
|
2137
2243
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2138
2244
|
case 24:
|
|
2139
2245
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2145,14 +2251,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2145
2251
|
});
|
|
2146
2252
|
case 27:
|
|
2147
2253
|
case "end":
|
|
2148
|
-
return
|
|
2254
|
+
return _context42.stop();
|
|
2149
2255
|
}
|
|
2150
|
-
},
|
|
2256
|
+
}, _callee42);
|
|
2151
2257
|
})));
|
|
2152
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2258
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
|
|
2153
2259
|
var responsePayload, warnSpy, roapEvent;
|
|
2154
|
-
return _regenerator.default.wrap(function
|
|
2155
|
-
while (1) switch (
|
|
2260
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2261
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2156
2262
|
case 0:
|
|
2157
2263
|
responsePayload = {
|
|
2158
2264
|
statusCode: 200,
|
|
@@ -2163,10 +2269,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2163
2269
|
jest.spyOn(global, 'clearTimeout');
|
|
2164
2270
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2165
2271
|
call['held'] = true;
|
|
2166
|
-
|
|
2272
|
+
_context43.next = 8;
|
|
2167
2273
|
return call.doHoldResume();
|
|
2168
2274
|
case 8:
|
|
2169
|
-
|
|
2275
|
+
_context43.next = 10;
|
|
2170
2276
|
return (0, _testUtil.flushPromises)(2);
|
|
2171
2277
|
case 10:
|
|
2172
2278
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2181,14 +2287,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2181
2287
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2182
2288
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2183
2289
|
roapEvent.data.type = 'ANSWER';
|
|
2184
|
-
|
|
2290
|
+
_context43.next = 17;
|
|
2185
2291
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2186
2292
|
case 17:
|
|
2187
2293
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2188
2294
|
statusCode: 403
|
|
2189
2295
|
});
|
|
2190
2296
|
roapEvent.data.type = 'OK';
|
|
2191
|
-
|
|
2297
|
+
_context43.next = 21;
|
|
2192
2298
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2193
2299
|
case 21:
|
|
2194
2300
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2200,14 +2306,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2200
2306
|
});
|
|
2201
2307
|
case 24:
|
|
2202
2308
|
case "end":
|
|
2203
|
-
return
|
|
2309
|
+
return _context43.stop();
|
|
2204
2310
|
}
|
|
2205
|
-
},
|
|
2311
|
+
}, _callee43);
|
|
2206
2312
|
})));
|
|
2207
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2313
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
2208
2314
|
var responsePayload, roapEvent;
|
|
2209
|
-
return _regenerator.default.wrap(function
|
|
2210
|
-
while (1) switch (
|
|
2315
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2316
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2211
2317
|
case 0:
|
|
2212
2318
|
expect.assertions(5);
|
|
2213
2319
|
responsePayload = {
|
|
@@ -2217,25 +2323,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2217
2323
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2218
2324
|
call['held'] = false;
|
|
2219
2325
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2220
|
-
var
|
|
2221
|
-
return _regenerator.default.wrap(function
|
|
2222
|
-
while (1) switch (
|
|
2326
|
+
var _ref45 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(errObj) {
|
|
2327
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2328
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2223
2329
|
case 0:
|
|
2224
2330
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2225
2331
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2226
2332
|
case 2:
|
|
2227
2333
|
case "end":
|
|
2228
|
-
return
|
|
2334
|
+
return _context44.stop();
|
|
2229
2335
|
}
|
|
2230
|
-
},
|
|
2336
|
+
}, _callee44);
|
|
2231
2337
|
}));
|
|
2232
2338
|
return function (_x5) {
|
|
2233
|
-
return
|
|
2339
|
+
return _ref45.apply(this, arguments);
|
|
2234
2340
|
};
|
|
2235
2341
|
}());
|
|
2236
2342
|
jest.runAllTimers();
|
|
2237
2343
|
call.doHoldResume();
|
|
2238
|
-
|
|
2344
|
+
_context45.next = 9;
|
|
2239
2345
|
return (0, _testUtil.flushPromises)(2);
|
|
2240
2346
|
case 9:
|
|
2241
2347
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2248,11 +2354,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2248
2354
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2249
2355
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2250
2356
|
roapEvent.data.type = 'ANSWER';
|
|
2251
|
-
|
|
2357
|
+
_context45.next = 15;
|
|
2252
2358
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2253
2359
|
case 15:
|
|
2254
2360
|
roapEvent.data.type = 'OK';
|
|
2255
|
-
|
|
2361
|
+
_context45.next = 18;
|
|
2256
2362
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2257
2363
|
case 18:
|
|
2258
2364
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2264,14 +2370,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2264
2370
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2265
2371
|
case 21:
|
|
2266
2372
|
case "end":
|
|
2267
|
-
return
|
|
2373
|
+
return _context45.stop();
|
|
2268
2374
|
}
|
|
2269
|
-
},
|
|
2375
|
+
}, _callee45);
|
|
2270
2376
|
})));
|
|
2271
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2377
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
|
|
2272
2378
|
var responsePayload, warnSpy, roapEvent;
|
|
2273
|
-
return _regenerator.default.wrap(function
|
|
2274
|
-
while (1) switch (
|
|
2379
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2380
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2275
2381
|
case 0:
|
|
2276
2382
|
expect.assertions(7);
|
|
2277
2383
|
responsePayload = {
|
|
@@ -2284,25 +2390,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2284
2390
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2285
2391
|
call['held'] = true;
|
|
2286
2392
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2287
|
-
var
|
|
2288
|
-
return _regenerator.default.wrap(function
|
|
2289
|
-
while (1) switch (
|
|
2393
|
+
var _ref47 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46(correlationId) {
|
|
2394
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2395
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2290
2396
|
case 0:
|
|
2291
2397
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2292
2398
|
case 1:
|
|
2293
2399
|
case "end":
|
|
2294
|
-
return
|
|
2400
|
+
return _context46.stop();
|
|
2295
2401
|
}
|
|
2296
|
-
},
|
|
2402
|
+
}, _callee46);
|
|
2297
2403
|
}));
|
|
2298
2404
|
return function (_x6) {
|
|
2299
|
-
return
|
|
2405
|
+
return _ref47.apply(this, arguments);
|
|
2300
2406
|
};
|
|
2301
2407
|
}());
|
|
2302
|
-
|
|
2408
|
+
_context47.next = 10;
|
|
2303
2409
|
return call.doHoldResume();
|
|
2304
2410
|
case 10:
|
|
2305
|
-
|
|
2411
|
+
_context47.next = 12;
|
|
2306
2412
|
return (0, _testUtil.flushPromises)(2);
|
|
2307
2413
|
case 12:
|
|
2308
2414
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2318,11 +2424,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2318
2424
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2319
2425
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2320
2426
|
roapEvent.data.type = 'ANSWER';
|
|
2321
|
-
|
|
2427
|
+
_context47.next = 20;
|
|
2322
2428
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2323
2429
|
case 20:
|
|
2324
2430
|
roapEvent.data.type = 'OK';
|
|
2325
|
-
|
|
2431
|
+
_context47.next = 23;
|
|
2326
2432
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2327
2433
|
case 23:
|
|
2328
2434
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2337,14 +2443,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2337
2443
|
});
|
|
2338
2444
|
case 28:
|
|
2339
2445
|
case "end":
|
|
2340
|
-
return
|
|
2446
|
+
return _context47.stop();
|
|
2341
2447
|
}
|
|
2342
|
-
},
|
|
2448
|
+
}, _callee47);
|
|
2343
2449
|
})));
|
|
2344
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2450
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
2345
2451
|
var responsePayload, warnSpy, roapEvent;
|
|
2346
|
-
return _regenerator.default.wrap(function
|
|
2347
|
-
while (1) switch (
|
|
2452
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2453
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2348
2454
|
case 0:
|
|
2349
2455
|
expect.assertions(7);
|
|
2350
2456
|
responsePayload = {
|
|
@@ -2357,26 +2463,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2357
2463
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2358
2464
|
call['held'] = true;
|
|
2359
2465
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2360
|
-
var
|
|
2361
|
-
return _regenerator.default.wrap(function
|
|
2362
|
-
while (1) switch (
|
|
2466
|
+
var _ref49 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(correlationId) {
|
|
2467
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2468
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2363
2469
|
case 0:
|
|
2364
2470
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2365
2471
|
case 1:
|
|
2366
2472
|
case "end":
|
|
2367
|
-
return
|
|
2473
|
+
return _context48.stop();
|
|
2368
2474
|
}
|
|
2369
|
-
},
|
|
2475
|
+
}, _callee48);
|
|
2370
2476
|
}));
|
|
2371
2477
|
return function (_x7) {
|
|
2372
|
-
return
|
|
2478
|
+
return _ref49.apply(this, arguments);
|
|
2373
2479
|
};
|
|
2374
2480
|
}());
|
|
2375
2481
|
call.doHoldResume();
|
|
2376
|
-
|
|
2482
|
+
_context49.next = 11;
|
|
2377
2483
|
return _promise.default.resolve();
|
|
2378
2484
|
case 11:
|
|
2379
|
-
|
|
2485
|
+
_context49.next = 13;
|
|
2380
2486
|
return _promise.default.resolve();
|
|
2381
2487
|
case 13:
|
|
2382
2488
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2392,11 +2498,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2392
2498
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2393
2499
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2394
2500
|
roapEvent.data.type = 'ANSWER';
|
|
2395
|
-
|
|
2501
|
+
_context49.next = 21;
|
|
2396
2502
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2397
2503
|
case 21:
|
|
2398
2504
|
roapEvent.data.type = 'OK';
|
|
2399
|
-
|
|
2505
|
+
_context49.next = 24;
|
|
2400
2506
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2401
2507
|
case 24:
|
|
2402
2508
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2411,14 +2517,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2411
2517
|
});
|
|
2412
2518
|
case 29:
|
|
2413
2519
|
case "end":
|
|
2414
|
-
return
|
|
2520
|
+
return _context49.stop();
|
|
2415
2521
|
}
|
|
2416
|
-
},
|
|
2522
|
+
}, _callee49);
|
|
2417
2523
|
})));
|
|
2418
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2524
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2419
2525
|
var responsePayload;
|
|
2420
|
-
return _regenerator.default.wrap(function
|
|
2421
|
-
while (1) switch (
|
|
2526
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2527
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2422
2528
|
case 0:
|
|
2423
2529
|
expect.assertions(4);
|
|
2424
2530
|
responsePayload = {
|
|
@@ -2428,26 +2534,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2428
2534
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2429
2535
|
call['held'] = true;
|
|
2430
2536
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2431
|
-
var
|
|
2432
|
-
return _regenerator.default.wrap(function
|
|
2433
|
-
while (1) switch (
|
|
2537
|
+
var _ref51 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50(errObj) {
|
|
2538
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2539
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2434
2540
|
case 0:
|
|
2435
2541
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2436
2542
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2437
2543
|
case 2:
|
|
2438
2544
|
case "end":
|
|
2439
|
-
return
|
|
2545
|
+
return _context50.stop();
|
|
2440
2546
|
}
|
|
2441
|
-
},
|
|
2547
|
+
}, _callee50);
|
|
2442
2548
|
}));
|
|
2443
2549
|
return function (_x8) {
|
|
2444
|
-
return
|
|
2550
|
+
return _ref51.apply(this, arguments);
|
|
2445
2551
|
};
|
|
2446
2552
|
}());
|
|
2447
|
-
|
|
2553
|
+
_context51.next = 7;
|
|
2448
2554
|
return call.doHoldResume();
|
|
2449
2555
|
case 7:
|
|
2450
|
-
|
|
2556
|
+
_context51.next = 9;
|
|
2451
2557
|
return (0, _testUtil.flushPromises)(2);
|
|
2452
2558
|
case 9:
|
|
2453
2559
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2458,14 +2564,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2458
2564
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2459
2565
|
case 11:
|
|
2460
2566
|
case "end":
|
|
2461
|
-
return
|
|
2567
|
+
return _context51.stop();
|
|
2462
2568
|
}
|
|
2463
|
-
},
|
|
2569
|
+
}, _callee51);
|
|
2464
2570
|
})));
|
|
2465
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2571
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
|
|
2466
2572
|
var responsePayload, rejectPayload, roapEvent;
|
|
2467
|
-
return _regenerator.default.wrap(function
|
|
2468
|
-
while (1) switch (
|
|
2573
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2574
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2469
2575
|
case 0:
|
|
2470
2576
|
expect.assertions(5);
|
|
2471
2577
|
responsePayload = {
|
|
@@ -2479,24 +2585,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2479
2585
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2480
2586
|
call['held'] = true;
|
|
2481
2587
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2482
|
-
var
|
|
2483
|
-
return _regenerator.default.wrap(function
|
|
2484
|
-
while (1) switch (
|
|
2588
|
+
var _ref53 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
|
|
2589
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2590
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2485
2591
|
case 0:
|
|
2486
2592
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2487
2593
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2488
2594
|
case 2:
|
|
2489
2595
|
case "end":
|
|
2490
|
-
return
|
|
2596
|
+
return _context52.stop();
|
|
2491
2597
|
}
|
|
2492
|
-
},
|
|
2598
|
+
}, _callee52);
|
|
2493
2599
|
}));
|
|
2494
2600
|
return function (_x9) {
|
|
2495
|
-
return
|
|
2601
|
+
return _ref53.apply(this, arguments);
|
|
2496
2602
|
};
|
|
2497
2603
|
}());
|
|
2498
2604
|
call.doHoldResume();
|
|
2499
|
-
|
|
2605
|
+
_context53.next = 9;
|
|
2500
2606
|
return (0, _testUtil.flushPromises)(2);
|
|
2501
2607
|
case 9:
|
|
2502
2608
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2507,7 +2613,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2507
2613
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2508
2614
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2509
2615
|
roapEvent.data.type = 'ANSWER';
|
|
2510
|
-
|
|
2616
|
+
_context53.next = 15;
|
|
2511
2617
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2512
2618
|
case 15:
|
|
2513
2619
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2515,14 +2621,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2515
2621
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2516
2622
|
case 17:
|
|
2517
2623
|
case "end":
|
|
2518
|
-
return
|
|
2624
|
+
return _context53.stop();
|
|
2519
2625
|
}
|
|
2520
|
-
},
|
|
2626
|
+
}, _callee53);
|
|
2521
2627
|
})));
|
|
2522
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2628
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2523
2629
|
var responsePayload, roapEvent;
|
|
2524
|
-
return _regenerator.default.wrap(function
|
|
2525
|
-
while (1) switch (
|
|
2630
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2631
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2526
2632
|
case 0:
|
|
2527
2633
|
expect.assertions(5);
|
|
2528
2634
|
responsePayload = {
|
|
@@ -2532,24 +2638,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2532
2638
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2533
2639
|
call['held'] = true;
|
|
2534
2640
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2535
|
-
var
|
|
2536
|
-
return _regenerator.default.wrap(function
|
|
2537
|
-
while (1) switch (
|
|
2641
|
+
var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
|
|
2642
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2643
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2538
2644
|
case 0:
|
|
2539
2645
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2540
2646
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2541
2647
|
case 2:
|
|
2542
2648
|
case "end":
|
|
2543
|
-
return
|
|
2649
|
+
return _context54.stop();
|
|
2544
2650
|
}
|
|
2545
|
-
},
|
|
2651
|
+
}, _callee54);
|
|
2546
2652
|
}));
|
|
2547
2653
|
return function (_x10) {
|
|
2548
|
-
return
|
|
2654
|
+
return _ref55.apply(this, arguments);
|
|
2549
2655
|
};
|
|
2550
2656
|
}());
|
|
2551
2657
|
call.doHoldResume();
|
|
2552
|
-
|
|
2658
|
+
_context55.next = 8;
|
|
2553
2659
|
return (0, _testUtil.flushPromises)(2);
|
|
2554
2660
|
case 8:
|
|
2555
2661
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2562,11 +2668,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2562
2668
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2563
2669
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2564
2670
|
roapEvent.data.type = 'ANSWER';
|
|
2565
|
-
|
|
2671
|
+
_context55.next = 14;
|
|
2566
2672
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2567
2673
|
case 14:
|
|
2568
2674
|
roapEvent.data.type = 'OK';
|
|
2569
|
-
|
|
2675
|
+
_context55.next = 17;
|
|
2570
2676
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2571
2677
|
case 17:
|
|
2572
2678
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2576,9 +2682,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2576
2682
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2577
2683
|
case 20:
|
|
2578
2684
|
case "end":
|
|
2579
|
-
return
|
|
2685
|
+
return _context55.stop();
|
|
2580
2686
|
}
|
|
2581
|
-
},
|
|
2687
|
+
}, _callee55);
|
|
2582
2688
|
})));
|
|
2583
2689
|
});
|
|
2584
2690
|
describe('Call transfer tests', function () {
|
|
@@ -2610,10 +2716,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2610
2716
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2611
2717
|
secondCall['held'] = false;
|
|
2612
2718
|
});
|
|
2613
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2719
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2614
2720
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2615
|
-
return _regenerator.default.wrap(function
|
|
2616
|
-
while (1) switch (
|
|
2721
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2722
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2617
2723
|
case 0:
|
|
2618
2724
|
expect.assertions(9);
|
|
2619
2725
|
responsePayload = {
|
|
@@ -2625,41 +2731,41 @@ describe('Supplementary Services tests', function () {
|
|
|
2625
2731
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2626
2732
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2627
2733
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2628
|
-
var
|
|
2629
|
-
return _regenerator.default.wrap(function
|
|
2630
|
-
while (1) switch (
|
|
2734
|
+
var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
|
|
2735
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2736
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2631
2737
|
case 0:
|
|
2632
2738
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2633
2739
|
case 1:
|
|
2634
2740
|
case "end":
|
|
2635
|
-
return
|
|
2741
|
+
return _context56.stop();
|
|
2636
2742
|
}
|
|
2637
|
-
},
|
|
2743
|
+
}, _callee56);
|
|
2638
2744
|
}));
|
|
2639
2745
|
return function (_x11) {
|
|
2640
|
-
return
|
|
2746
|
+
return _ref57.apply(this, arguments);
|
|
2641
2747
|
};
|
|
2642
2748
|
}());
|
|
2643
2749
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2644
|
-
var
|
|
2645
|
-
return _regenerator.default.wrap(function
|
|
2646
|
-
while (1) switch (
|
|
2750
|
+
var _ref58 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(correlationId) {
|
|
2751
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2752
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2647
2753
|
case 0:
|
|
2648
2754
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
2649
2755
|
case 1:
|
|
2650
2756
|
case "end":
|
|
2651
|
-
return
|
|
2757
|
+
return _context57.stop();
|
|
2652
2758
|
}
|
|
2653
|
-
},
|
|
2759
|
+
}, _callee57);
|
|
2654
2760
|
}));
|
|
2655
2761
|
return function (_x12) {
|
|
2656
|
-
return
|
|
2762
|
+
return _ref58.apply(this, arguments);
|
|
2657
2763
|
};
|
|
2658
2764
|
}());
|
|
2659
|
-
|
|
2765
|
+
_context58.next = 10;
|
|
2660
2766
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2661
2767
|
case 10:
|
|
2662
|
-
|
|
2768
|
+
_context58.next = 12;
|
|
2663
2769
|
return (0, _testUtil.flushPromises)(2);
|
|
2664
2770
|
case 12:
|
|
2665
2771
|
expect(requestSpy).toBeCalled();
|
|
@@ -2679,14 +2785,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2679
2785
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2680
2786
|
case 21:
|
|
2681
2787
|
case "end":
|
|
2682
|
-
return
|
|
2788
|
+
return _context58.stop();
|
|
2683
2789
|
}
|
|
2684
|
-
},
|
|
2790
|
+
}, _callee58);
|
|
2685
2791
|
})));
|
|
2686
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2792
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
2687
2793
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2688
|
-
return _regenerator.default.wrap(function
|
|
2689
|
-
while (1) switch (
|
|
2794
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
2795
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2690
2796
|
case 0:
|
|
2691
2797
|
expect.assertions(7);
|
|
2692
2798
|
responsePayload = {
|
|
@@ -2698,25 +2804,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2698
2804
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2699
2805
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2700
2806
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2701
|
-
var
|
|
2702
|
-
return _regenerator.default.wrap(function
|
|
2703
|
-
while (1) switch (
|
|
2807
|
+
var _ref60 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
|
|
2808
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
2809
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2704
2810
|
case 0:
|
|
2705
2811
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2706
2812
|
case 1:
|
|
2707
2813
|
case "end":
|
|
2708
|
-
return
|
|
2814
|
+
return _context59.stop();
|
|
2709
2815
|
}
|
|
2710
|
-
},
|
|
2816
|
+
}, _callee59);
|
|
2711
2817
|
}));
|
|
2712
2818
|
return function (_x13) {
|
|
2713
|
-
return
|
|
2819
|
+
return _ref60.apply(this, arguments);
|
|
2714
2820
|
};
|
|
2715
2821
|
}());
|
|
2716
|
-
|
|
2822
|
+
_context60.next = 9;
|
|
2717
2823
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2718
2824
|
case 9:
|
|
2719
|
-
|
|
2825
|
+
_context60.next = 11;
|
|
2720
2826
|
return (0, _testUtil.flushPromises)(2);
|
|
2721
2827
|
case 11:
|
|
2722
2828
|
expect(requestSpy).toBeCalled();
|
|
@@ -2732,14 +2838,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2732
2838
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2733
2839
|
case 18:
|
|
2734
2840
|
case "end":
|
|
2735
|
-
return
|
|
2841
|
+
return _context60.stop();
|
|
2736
2842
|
}
|
|
2737
|
-
},
|
|
2843
|
+
}, _callee60);
|
|
2738
2844
|
})));
|
|
2739
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2845
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
2740
2846
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2741
|
-
return _regenerator.default.wrap(function
|
|
2742
|
-
while (1) switch (
|
|
2847
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
2848
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
2743
2849
|
case 0:
|
|
2744
2850
|
responsePayload = {
|
|
2745
2851
|
statusCode: 403,
|
|
@@ -2749,10 +2855,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2749
2855
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2750
2856
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2751
2857
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2752
|
-
|
|
2858
|
+
_context61.next = 7;
|
|
2753
2859
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2754
2860
|
case 7:
|
|
2755
|
-
|
|
2861
|
+
_context61.next = 9;
|
|
2756
2862
|
return (0, _testUtil.flushPromises)(1);
|
|
2757
2863
|
case 9:
|
|
2758
2864
|
expect(requestSpy).toBeCalled();
|
|
@@ -2768,14 +2874,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2768
2874
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
2769
2875
|
case 16:
|
|
2770
2876
|
case "end":
|
|
2771
|
-
return
|
|
2877
|
+
return _context61.stop();
|
|
2772
2878
|
}
|
|
2773
|
-
},
|
|
2879
|
+
}, _callee61);
|
|
2774
2880
|
})));
|
|
2775
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2881
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62() {
|
|
2776
2882
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2777
|
-
return _regenerator.default.wrap(function
|
|
2778
|
-
while (1) switch (
|
|
2883
|
+
return _regenerator.default.wrap(function _callee62$(_context62) {
|
|
2884
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
2779
2885
|
case 0:
|
|
2780
2886
|
responsePayload = {
|
|
2781
2887
|
statusCode: 403,
|
|
@@ -2785,10 +2891,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2785
2891
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2786
2892
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2787
2893
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2788
|
-
|
|
2894
|
+
_context62.next = 7;
|
|
2789
2895
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2790
2896
|
case 7:
|
|
2791
|
-
|
|
2897
|
+
_context62.next = 9;
|
|
2792
2898
|
return (0, _testUtil.flushPromises)(2);
|
|
2793
2899
|
case 9:
|
|
2794
2900
|
expect(requestSpy).toBeCalled();
|
|
@@ -2805,18 +2911,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2805
2911
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
2806
2912
|
case 17:
|
|
2807
2913
|
case "end":
|
|
2808
|
-
return
|
|
2914
|
+
return _context62.stop();
|
|
2809
2915
|
}
|
|
2810
|
-
},
|
|
2916
|
+
}, _callee62);
|
|
2811
2917
|
})));
|
|
2812
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2918
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63() {
|
|
2813
2919
|
var requestSpy, warnSpy;
|
|
2814
|
-
return _regenerator.default.wrap(function
|
|
2815
|
-
while (1) switch (
|
|
2920
|
+
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
2921
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
2816
2922
|
case 0:
|
|
2817
2923
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2818
2924
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2819
|
-
|
|
2925
|
+
_context63.next = 4;
|
|
2820
2926
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
2821
2927
|
case 4:
|
|
2822
2928
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2827,18 +2933,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2827
2933
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2828
2934
|
case 9:
|
|
2829
2935
|
case "end":
|
|
2830
|
-
return
|
|
2936
|
+
return _context63.stop();
|
|
2831
2937
|
}
|
|
2832
|
-
},
|
|
2938
|
+
}, _callee63);
|
|
2833
2939
|
})));
|
|
2834
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2940
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
2835
2941
|
var requestSpy, warnSpy;
|
|
2836
|
-
return _regenerator.default.wrap(function
|
|
2837
|
-
while (1) switch (
|
|
2942
|
+
return _regenerator.default.wrap(function _callee64$(_context64) {
|
|
2943
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
2838
2944
|
case 0:
|
|
2839
2945
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2840
2946
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2841
|
-
|
|
2947
|
+
_context64.next = 4;
|
|
2842
2948
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
2843
2949
|
case 4:
|
|
2844
2950
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2849,9 +2955,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2849
2955
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2850
2956
|
case 9:
|
|
2851
2957
|
case "end":
|
|
2852
|
-
return
|
|
2958
|
+
return _context64.stop();
|
|
2853
2959
|
}
|
|
2854
|
-
},
|
|
2960
|
+
}, _callee64);
|
|
2855
2961
|
})));
|
|
2856
2962
|
});
|
|
2857
2963
|
});
|