@@ -56,7 +56,9 @@ function setPendingEmailCredentials() {
56
56
function testHandleFederatedLinking ( ) {
57
57
// Add additional scopes to test they are properly passed to the sign-in
58
58
// method.
59
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
59
+ var expectedProvider = getExpectedProviderWithScopes ( {
60
+ 'login_hint' : federatedAccount . getEmail ( )
61
+ } ) ;
60
62
setPendingEmailCredentials ( ) ;
61
63
firebaseui . auth . widget . handler . handleFederatedLinking (
62
64
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -67,12 +69,30 @@ function testHandleFederatedLinking() {
67
69
}
68
70
69
71
72
+ function testHandleFederatedLinking_noLoginHint ( ) {
73
+ // Add additional scopes to test they are properly passed to the sign-in
74
+ // method.
75
+ // As this is not google.com, no customParameters will be set.
76
+ var expectedProvider =
77
+ getExpectedProviderWithCustomParameters ( 'github.com' ) ;
78
+ setPendingEmailCredentials ( ) ;
79
+ firebaseui . auth . widget . handler . handleFederatedLinking (
80
+ app , container , federatedAccount . getEmail ( ) , 'github.com' ) ;
81
+ assertFederatedLinkingPage ( federatedAccount . getEmail ( ) ) ;
82
+ submitForm ( ) ;
83
+ testAuth . assertSignInWithRedirect ( [ expectedProvider ] ) ;
84
+ return testAuth . process ( ) ;
85
+ }
86
+
87
+
70
88
function testHandleFederatedLinking_popup_success ( ) {
71
89
// Test successful federated linking in popup flow.
72
90
app . updateConfig ( 'signInFlow' , 'popup' ) ;
73
91
// Add additional scopes to test they are properly passed to the sign-in
74
92
// method.
75
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
93
+ var expectedProvider = getExpectedProviderWithScopes ( {
94
+ 'login_hint' : federatedAccount . getEmail ( )
95
+ } ) ;
76
96
setPendingEmailCredentials ( ) ;
77
97
firebaseui . auth . widget . handler . handleFederatedLinking (
78
98
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -124,7 +144,9 @@ function testHandleFederatedLinking_popup_success_multipleClicks() {
124
144
app . updateConfig ( 'signInFlow' , 'popup' ) ;
125
145
// Add additional scopes to test they are properly passed to the sign-in
126
146
// method.
127
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
147
+ var expectedProvider = getExpectedProviderWithScopes ( {
148
+ 'login_hint' : federatedAccount . getEmail ( )
149
+ } ) ;
128
150
setPendingEmailCredentials ( ) ;
129
151
firebaseui . auth . widget . handler . handleFederatedLinking (
130
152
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -216,7 +238,9 @@ function testHandleFederatedLinking_noPendingCredential_popup() {
216
238
function testHandleFederatedLinking_error ( ) {
217
239
// Add additional scopes to test they are properly passed to the sign-in
218
240
// method.
219
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
241
+ var expectedProvider = getExpectedProviderWithScopes ( {
242
+ 'login_hint' : federatedAccount . getEmail ( )
243
+ } ) ;
220
244
setPendingEmailCredentials ( ) ;
221
245
firebaseui . auth . widget . handler . handleFederatedLinking (
222
246
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -237,7 +261,9 @@ function testHandleFederatedLinking_popup_recoverableError() {
237
261
app . updateConfig ( 'signInFlow' , 'popup' ) ;
238
262
// Add additional scopes to test they are properly passed to the sign-in
239
263
// method.
240
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
264
+ var expectedProvider = getExpectedProviderWithScopes ( {
265
+ 'login_hint' : federatedAccount . getEmail ( )
266
+ } ) ;
241
267
setPendingEmailCredentials ( ) ;
242
268
firebaseui . auth . widget . handler . handleFederatedLinking (
243
269
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -268,7 +294,9 @@ function testHandleFederatedLinking_popup_userCancelled() {
268
294
app . updateConfig ( 'signInFlow' , 'popup' ) ;
269
295
// Add additional scopes to test they are properly passed to the sign-in
270
296
// method.
271
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
297
+ var expectedProvider = getExpectedProviderWithScopes ( {
298
+ 'login_hint' : federatedAccount . getEmail ( )
299
+ } ) ;
272
300
setPendingEmailCredentials ( ) ;
273
301
firebaseui . auth . widget . handler . handleFederatedLinking (
274
302
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -299,7 +327,9 @@ function testHandleFederatedLinking_popup_unrecoverableError() {
299
327
app . updateConfig ( 'signInFlow' , 'popup' ) ;
300
328
// Add additional scopes to test they are properly passed to the sign-in
301
329
// method.
302
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
330
+ var expectedProvider = getExpectedProviderWithScopes ( {
331
+ 'login_hint' : federatedAccount . getEmail ( )
332
+ } ) ;
303
333
setPendingEmailCredentials ( ) ;
304
334
firebaseui . auth . widget . handler . handleFederatedLinking (
305
335
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -326,7 +356,9 @@ function testHandleFederatedLinking_popup_popupBlockedError() {
326
356
app . updateConfig ( 'signInFlow' , 'popup' ) ;
327
357
// Add additional scopes to test they are properly passed to the sign-in
328
358
// method.
329
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
359
+ var expectedProvider = getExpectedProviderWithScopes ( {
360
+ 'login_hint' : federatedAccount . getEmail ( )
361
+ } ) ;
330
362
setPendingEmailCredentials ( ) ;
331
363
firebaseui . auth . widget . handler . handleFederatedLinking (
332
364
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -357,7 +389,9 @@ function testHandleFederatedLinking_popup_popupBlockedError_redirectError() {
357
389
app . updateConfig ( 'signInFlow' , 'popup' ) ;
358
390
// Add additional scopes to test they are properly passed to the sign-in
359
391
// method.
360
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
392
+ var expectedProvider = getExpectedProviderWithScopes ( {
393
+ 'login_hint' : federatedAccount . getEmail ( )
394
+ } ) ;
361
395
setPendingEmailCredentials ( ) ;
362
396
firebaseui . auth . widget . handler . handleFederatedLinking (
363
397
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -392,7 +426,9 @@ function testHandleFederatedLinking_inProcessing() {
392
426
// Add additional scopes to test they are properly passed to the sign-in
393
427
// method.
394
428
app . updateConfig ( 'signInOptions' , signInOptionsWithScopes ) ;
395
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
429
+ var expectedProvider = getExpectedProviderWithScopes ( {
430
+ 'login_hint' : federatedAccount . getEmail ( )
431
+ } ) ;
396
432
setPendingEmailCredentials ( ) ;
397
433
firebaseui . auth . widget . handler . handleFederatedLinking (
398
434
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -421,7 +457,9 @@ function testHandleFederatedLinking_inProcessing() {
421
457
function testHandleFederatedLinking_popup_cancelled ( ) {
422
458
// Test sign in with popup flow when the popup is cancelled.
423
459
app . updateConfig ( 'signInFlow' , 'popup' ) ;
424
- var expectedProvider = getExpectedProviderWithScopes ( ) ;
460
+ var expectedProvider = getExpectedProviderWithScopes ( {
461
+ 'login_hint' : federatedAccount . getEmail ( )
462
+ } ) ;
425
463
setPendingEmailCredentials ( ) ;
426
464
firebaseui . auth . widget . handler . handleFederatedLinking (
427
465
app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
0 commit comments