Skip to content

Commit 2e64052

Browse files
authored
Merge branch 'alpha' into login-with-auth
2 parents 0f4ff49 + 953fd97 commit 2e64052

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

integration/test/ParseUserTest.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,10 @@ describe('Parse User', () => {
987987
});
988988

989989
it('can link with twitter', async () => {
990+
const server = await reconfigureServer();
991+
const twitter = server.config.auth.twitter;
992+
const spy = spyOn(twitter, 'validateAuthData').and.callThrough();
993+
990994
Parse.User.enableUnsafeCurrentUser();
991995
const user = new Parse.User();
992996
user.setUsername(uuidv4());
@@ -999,9 +1003,14 @@ describe('Parse User', () => {
9991003

10001004
await user._unlinkFrom('twitter');
10011005
expect(user._isLinked('twitter')).toBe(false);
1006+
expect(spy).toHaveBeenCalled();
10021007
});
10031008

10041009
it('can link with twitter and facebook', async () => {
1010+
const server = await reconfigureServer();
1011+
const twitter = server.config.auth.twitter;
1012+
const spy = spyOn(twitter, 'validateAuthData').and.callThrough();
1013+
10051014
Parse.User.enableUnsafeCurrentUser();
10061015
Parse.FacebookUtils.init();
10071016
const user = new Parse.User();
@@ -1017,6 +1026,7 @@ describe('Parse User', () => {
10171026

10181027
expect(user.get('authData').twitter.id).toBe(twitterAuthData.id);
10191028
expect(user.get('authData').facebook.id).toBe('test');
1029+
expect(spy).toHaveBeenCalled();
10201030
});
10211031

10221032
it('can verify user password via static method', async () => {

integration/test/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const defaultConfiguration = {
6060
twitter: {
6161
consumer_key: twitterAuthData.consumer_key,
6262
consumer_secret: twitterAuthData.consumer_secret,
63+
validateAuthData: () => {},
6364
},
6465
},
6566
verbose: false,

0 commit comments

Comments
 (0)