@@ -987,6 +987,10 @@ describe('Parse User', () => {
987
987
} ) ;
988
988
989
989
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
+
990
994
Parse . User . enableUnsafeCurrentUser ( ) ;
991
995
const user = new Parse . User ( ) ;
992
996
user . setUsername ( uuidv4 ( ) ) ;
@@ -999,9 +1003,14 @@ describe('Parse User', () => {
999
1003
1000
1004
await user . _unlinkFrom ( 'twitter' ) ;
1001
1005
expect ( user . _isLinked ( 'twitter' ) ) . toBe ( false ) ;
1006
+ expect ( spy ) . toHaveBeenCalled ( ) ;
1002
1007
} ) ;
1003
1008
1004
1009
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
+
1005
1014
Parse . User . enableUnsafeCurrentUser ( ) ;
1006
1015
Parse . FacebookUtils . init ( ) ;
1007
1016
const user = new Parse . User ( ) ;
@@ -1017,6 +1026,7 @@ describe('Parse User', () => {
1017
1026
1018
1027
expect ( user . get ( 'authData' ) . twitter . id ) . toBe ( twitterAuthData . id ) ;
1019
1028
expect ( user . get ( 'authData' ) . facebook . id ) . toBe ( 'test' ) ;
1029
+ expect ( spy ) . toHaveBeenCalled ( ) ;
1020
1030
} ) ;
1021
1031
1022
1032
it ( 'can verify user password via static method' , async ( ) => {
0 commit comments