@@ -5,7 +5,7 @@ const authenticationLoader = require('../lib/Adapters/Auth');
55const path = require ( 'path' ) ;
66const responses = {
77 gpgames : { playerId : 'userId' } ,
8- instagram : { data : { id : 'userId' } } ,
8+ instagram : { id : 'userId' } ,
99 janrainengage : { stat : 'ok' , profile : { identifier : 'userId' } } ,
1010 janraincapture : { stat : 'ok' , result : 'userId' } ,
1111 line : { userId : 'userId' } ,
@@ -492,7 +492,15 @@ describe('instagram auth adapter', () => {
492492 'https://graph.instagram.com/me?fields=id&access_token=the_token'
493493 ) ;
494494 } ) ;
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+ } ) ;
496504 it ( 'should pass in api url' , async ( ) => {
497505 spyOn ( httpsRequest , 'get' ) . and . callFake ( ( ) => {
498506 return Promise . resolve ( { data : { id : 'userId' } } ) ;
0 commit comments