@@ -5,7 +5,7 @@ const authenticationLoader = require('../lib/Adapters/Auth');
5
5
const path = require ( 'path' ) ;
6
6
const responses = {
7
7
gpgames : { playerId : 'userId' } ,
8
- instagram : { data : { id : 'userId' } } ,
8
+ instagram : { id : 'userId' } ,
9
9
janrainengage : { stat : 'ok' , profile : { identifier : 'userId' } } ,
10
10
janraincapture : { stat : 'ok' , result : 'userId' } ,
11
11
line : { userId : 'userId' } ,
@@ -492,7 +492,15 @@ describe('instagram auth adapter', () => {
492
492
'https://graph.instagram.com/me?fields=id&access_token=the_token'
493
493
) ;
494
494
} ) ;
495
-
495
+ it ( 'response object without data child' , async ( ) => {
496
+ spyOn ( httpsRequest , 'get' ) . and . callFake ( ( ) => {
497
+ return Promise . resolve ( { id : 'userId' } ) ;
498
+ } ) ;
499
+ await instagram . validateAuthData ( { id : 'userId' , access_token : 'the_token' } , { } ) ;
500
+ expect ( httpsRequest . get ) . toHaveBeenCalledWith (
501
+ 'https://graph.instagram.com/me?fields=id&access_token=the_token'
502
+ ) ;
503
+ } ) ;
496
504
it ( 'should pass in api url' , async ( ) => {
497
505
spyOn ( httpsRequest , 'get' ) . and . callFake ( ( ) => {
498
506
return Promise . resolve ( { data : { id : 'userId' } } ) ;
0 commit comments