@@ -56,7 +56,9 @@ function setPendingEmailCredentials() {
5656function testHandleFederatedLinking ( ) {
5757 // Add additional scopes to test they are properly passed to the sign-in
5858 // method.
59- var expectedProvider = getExpectedProviderWithScopes ( ) ;
59+ var expectedProvider = getExpectedProviderWithScopes ( {
60+ 'login_hint' : federatedAccount . getEmail ( )
61+ } ) ;
6062 setPendingEmailCredentials ( ) ;
6163 firebaseui . auth . widget . handler . handleFederatedLinking (
6264 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -67,12 +69,30 @@ function testHandleFederatedLinking() {
6769}
6870
6971
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+
7088function testHandleFederatedLinking_popup_success ( ) {
7189 // Test successful federated linking in popup flow.
7290 app . updateConfig ( 'signInFlow' , 'popup' ) ;
7391 // Add additional scopes to test they are properly passed to the sign-in
7492 // method.
75- var expectedProvider = getExpectedProviderWithScopes ( ) ;
93+ var expectedProvider = getExpectedProviderWithScopes ( {
94+ 'login_hint' : federatedAccount . getEmail ( )
95+ } ) ;
7696 setPendingEmailCredentials ( ) ;
7797 firebaseui . auth . widget . handler . handleFederatedLinking (
7898 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -124,7 +144,9 @@ function testHandleFederatedLinking_popup_success_multipleClicks() {
124144 app . updateConfig ( 'signInFlow' , 'popup' ) ;
125145 // Add additional scopes to test they are properly passed to the sign-in
126146 // method.
127- var expectedProvider = getExpectedProviderWithScopes ( ) ;
147+ var expectedProvider = getExpectedProviderWithScopes ( {
148+ 'login_hint' : federatedAccount . getEmail ( )
149+ } ) ;
128150 setPendingEmailCredentials ( ) ;
129151 firebaseui . auth . widget . handler . handleFederatedLinking (
130152 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -216,7 +238,9 @@ function testHandleFederatedLinking_noPendingCredential_popup() {
216238function testHandleFederatedLinking_error ( ) {
217239 // Add additional scopes to test they are properly passed to the sign-in
218240 // method.
219- var expectedProvider = getExpectedProviderWithScopes ( ) ;
241+ var expectedProvider = getExpectedProviderWithScopes ( {
242+ 'login_hint' : federatedAccount . getEmail ( )
243+ } ) ;
220244 setPendingEmailCredentials ( ) ;
221245 firebaseui . auth . widget . handler . handleFederatedLinking (
222246 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -237,7 +261,9 @@ function testHandleFederatedLinking_popup_recoverableError() {
237261 app . updateConfig ( 'signInFlow' , 'popup' ) ;
238262 // Add additional scopes to test they are properly passed to the sign-in
239263 // method.
240- var expectedProvider = getExpectedProviderWithScopes ( ) ;
264+ var expectedProvider = getExpectedProviderWithScopes ( {
265+ 'login_hint' : federatedAccount . getEmail ( )
266+ } ) ;
241267 setPendingEmailCredentials ( ) ;
242268 firebaseui . auth . widget . handler . handleFederatedLinking (
243269 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -268,7 +294,9 @@ function testHandleFederatedLinking_popup_userCancelled() {
268294 app . updateConfig ( 'signInFlow' , 'popup' ) ;
269295 // Add additional scopes to test they are properly passed to the sign-in
270296 // method.
271- var expectedProvider = getExpectedProviderWithScopes ( ) ;
297+ var expectedProvider = getExpectedProviderWithScopes ( {
298+ 'login_hint' : federatedAccount . getEmail ( )
299+ } ) ;
272300 setPendingEmailCredentials ( ) ;
273301 firebaseui . auth . widget . handler . handleFederatedLinking (
274302 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -299,7 +327,9 @@ function testHandleFederatedLinking_popup_unrecoverableError() {
299327 app . updateConfig ( 'signInFlow' , 'popup' ) ;
300328 // Add additional scopes to test they are properly passed to the sign-in
301329 // method.
302- var expectedProvider = getExpectedProviderWithScopes ( ) ;
330+ var expectedProvider = getExpectedProviderWithScopes ( {
331+ 'login_hint' : federatedAccount . getEmail ( )
332+ } ) ;
303333 setPendingEmailCredentials ( ) ;
304334 firebaseui . auth . widget . handler . handleFederatedLinking (
305335 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -326,7 +356,9 @@ function testHandleFederatedLinking_popup_popupBlockedError() {
326356 app . updateConfig ( 'signInFlow' , 'popup' ) ;
327357 // Add additional scopes to test they are properly passed to the sign-in
328358 // method.
329- var expectedProvider = getExpectedProviderWithScopes ( ) ;
359+ var expectedProvider = getExpectedProviderWithScopes ( {
360+ 'login_hint' : federatedAccount . getEmail ( )
361+ } ) ;
330362 setPendingEmailCredentials ( ) ;
331363 firebaseui . auth . widget . handler . handleFederatedLinking (
332364 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -357,7 +389,9 @@ function testHandleFederatedLinking_popup_popupBlockedError_redirectError() {
357389 app . updateConfig ( 'signInFlow' , 'popup' ) ;
358390 // Add additional scopes to test they are properly passed to the sign-in
359391 // method.
360- var expectedProvider = getExpectedProviderWithScopes ( ) ;
392+ var expectedProvider = getExpectedProviderWithScopes ( {
393+ 'login_hint' : federatedAccount . getEmail ( )
394+ } ) ;
361395 setPendingEmailCredentials ( ) ;
362396 firebaseui . auth . widget . handler . handleFederatedLinking (
363397 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -392,7 +426,9 @@ function testHandleFederatedLinking_inProcessing() {
392426 // Add additional scopes to test they are properly passed to the sign-in
393427 // method.
394428 app . updateConfig ( 'signInOptions' , signInOptionsWithScopes ) ;
395- var expectedProvider = getExpectedProviderWithScopes ( ) ;
429+ var expectedProvider = getExpectedProviderWithScopes ( {
430+ 'login_hint' : federatedAccount . getEmail ( )
431+ } ) ;
396432 setPendingEmailCredentials ( ) ;
397433 firebaseui . auth . widget . handler . handleFederatedLinking (
398434 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
@@ -421,7 +457,9 @@ function testHandleFederatedLinking_inProcessing() {
421457function testHandleFederatedLinking_popup_cancelled ( ) {
422458 // Test sign in with popup flow when the popup is cancelled.
423459 app . updateConfig ( 'signInFlow' , 'popup' ) ;
424- var expectedProvider = getExpectedProviderWithScopes ( ) ;
460+ var expectedProvider = getExpectedProviderWithScopes ( {
461+ 'login_hint' : federatedAccount . getEmail ( )
462+ } ) ;
425463 setPendingEmailCredentials ( ) ;
426464 firebaseui . auth . widget . handler . handleFederatedLinking (
427465 app , container , federatedAccount . getEmail ( ) , 'google.com' ) ;
0 commit comments