@@ -41,6 +41,7 @@ describe('AppAuth', () => {
41
41
useNonce : true ,
42
42
usePKCE : true ,
43
43
customHeaders : null ,
44
+ skipCodeExchange : false ,
44
45
} ;
45
46
46
47
const registerConfig = {
@@ -380,11 +381,37 @@ describe('AppAuth', () => {
380
381
config . scopes ,
381
382
config . additionalParameters ,
382
383
config . serviceConfiguration ,
384
+ config . skipCodeExchange ,
383
385
config . useNonce ,
384
386
config . usePKCE
385
387
) ;
386
388
} ) ;
387
389
390
+ it ( 'calls the native wrapper with the default value `false`, `true`, `true`' , ( ) => {
391
+ authorize ( {
392
+ issuer : 'test-issuer' ,
393
+ redirectUrl : 'test-redirectUrl' ,
394
+ clientId : 'test-clientId' ,
395
+ clientSecret : 'test-clientSecret' ,
396
+ customHeaders : null ,
397
+ additionalParameters : null ,
398
+ serviceConfiguration : null ,
399
+ scopes : [ 'openid' ] ,
400
+ } ) ;
401
+ expect ( mockAuthorize ) . toHaveBeenCalledWith (
402
+ 'test-issuer' ,
403
+ 'test-redirectUrl' ,
404
+ 'test-clientId' ,
405
+ 'test-clientSecret' ,
406
+ [ 'openid' ] ,
407
+ null ,
408
+ null ,
409
+ false ,
410
+ true ,
411
+ true
412
+ ) ;
413
+ } ) ;
414
+
388
415
describe ( 'Android-specific' , ( ) => {
389
416
beforeEach ( ( ) => {
390
417
require ( 'react-native' ) . Platform . OS = 'android' ;
@@ -404,6 +431,7 @@ describe('AppAuth', () => {
404
431
config . scopes ,
405
432
config . additionalParameters ,
406
433
config . serviceConfiguration ,
434
+ config . skipCodeExchange ,
407
435
config . usePKCE ,
408
436
config . clientAuthMethod ,
409
437
false ,
@@ -421,6 +449,7 @@ describe('AppAuth', () => {
421
449
config . scopes ,
422
450
config . additionalParameters ,
423
451
config . serviceConfiguration ,
452
+ false ,
424
453
config . usePKCE ,
425
454
config . clientAuthMethod ,
426
455
false ,
@@ -438,6 +467,7 @@ describe('AppAuth', () => {
438
467
config . scopes ,
439
468
config . additionalParameters ,
440
469
config . serviceConfiguration ,
470
+ false ,
441
471
config . usePKCE ,
442
472
config . clientAuthMethod ,
443
473
true ,
@@ -464,6 +494,7 @@ describe('AppAuth', () => {
464
494
config . scopes ,
465
495
config . additionalParameters ,
466
496
config . serviceConfiguration ,
497
+ false ,
467
498
config . usePKCE ,
468
499
config . clientAuthMethod ,
469
500
false ,
@@ -619,6 +650,7 @@ describe('AppAuth', () => {
619
650
config . scopes ,
620
651
config . additionalParameters ,
621
652
config . serviceConfiguration ,
653
+ false ,
622
654
config . usePKCE ,
623
655
config . clientAuthMethod ,
624
656
false ,
@@ -643,6 +675,7 @@ describe('AppAuth', () => {
643
675
config . scopes ,
644
676
config . additionalParameters ,
645
677
config . serviceConfiguration ,
678
+ false ,
646
679
true ,
647
680
true
648
681
) ;
@@ -659,6 +692,7 @@ describe('AppAuth', () => {
659
692
config . additionalParameters ,
660
693
config . serviceConfiguration ,
661
694
false ,
695
+ false ,
662
696
true
663
697
) ;
664
698
} ) ;
@@ -679,6 +713,7 @@ describe('AppAuth', () => {
679
713
config . scopes ,
680
714
config . additionalParameters ,
681
715
config . serviceConfiguration ,
716
+ config . skipCodeExchange ,
682
717
config . useNonce ,
683
718
true
684
719
) ;
@@ -694,6 +729,7 @@ describe('AppAuth', () => {
694
729
config . scopes ,
695
730
config . additionalParameters ,
696
731
config . serviceConfiguration ,
732
+ config . skipCodeExchange ,
697
733
config . useNonce ,
698
734
false
699
735
) ;
0 commit comments