Skip to content

Commit 8a4915b

Browse files
committed
Change tests for instagram authentication
1 parent 5791130 commit 8a4915b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

spec/AuthenticationAdapters.spec.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const authenticationLoader = require('../lib/Adapters/Auth');
55
const path = require('path');
66
const 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

Comments
 (0)