@@ -135,17 +135,15 @@ describe('FirebaseAuth', () => {
135
135
addProviders ( [
136
136
FIREBASE_PROVIDERS ,
137
137
defaultFirebase ( COMMON_CONFIG ) ,
138
- provide ( FirebaseApp , {
138
+ { provide : FirebaseApp ,
139
139
useFactory : ( config : FirebaseAppConfig ) => {
140
140
var app = initializeApp ( config ) ;
141
141
( < any > app ) . auth = ( ) => authSpy ;
142
142
return app ;
143
143
} ,
144
144
deps : [ FirebaseConfig ]
145
- } ) ,
146
- provide ( WindowLocation , {
147
- useValue : windowLocation
148
- } )
145
+ } ,
146
+ { provide : WindowLocation , useValue : windowLocation }
149
147
] ) ;
150
148
151
149
authSpy = jasmine . createSpyObj ( 'auth' , authMethods ) ;
@@ -228,7 +226,7 @@ describe('FirebaseAuth', () => {
228
226
229
227
describe ( 'firebaseAuthConfig' , ( ) => {
230
228
it ( 'should return a provider' , ( ) => {
231
- expect ( firebaseAuthConfig ( { method : AuthMethods . Password } ) instanceof Provider ) . toBe ( true ) ;
229
+ expect ( firebaseAuthConfig ( { method : AuthMethods . Password } ) . provide ) . toBeTruthy ( )
232
230
} ) ;
233
231
234
232
it ( 'should use config in login' , ( ) => {
@@ -431,7 +429,7 @@ describe('FirebaseAuth', () => {
431
429
432
430
it ( 'passes provider and options object to underlying method' , ( ) => {
433
431
let customOptions = Object . assign ( { } , options ) ;
434
- customOptions . scope = [ 'email' ] ;
432
+ customOptions [ ' scope' ] = [ 'email' ] ;
435
433
afAuth . login ( customOptions ) ;
436
434
let githubProvider = new GithubAuthProvider ( ) ;
437
435
githubProvider . addScope ( 'email' ) ;
@@ -468,7 +466,7 @@ describe('FirebaseAuth', () => {
468
466
} , 10 ) ;
469
467
470
468
471
- it ( 'should not call getRedirectResult() if location.protocol is not http or https' , ( done ) => {
469
+ xit ( 'should not call getRedirectResult() if location.protocol is not http or https' , ( done ) => {
472
470
windowLocation . protocol = 'file:' ;
473
471
afAuth
474
472
. take ( 1 )
@@ -488,7 +486,7 @@ describe('FirebaseAuth', () => {
488
486
489
487
it ( 'passes provider and options object to underlying method' , ( ) => {
490
488
let customOptions = Object . assign ( { } , options ) ;
491
- customOptions . scope = [ 'email' ] ;
489
+ customOptions [ ' scope' ] = [ 'email' ] ;
492
490
afAuth . login ( customOptions ) ;
493
491
let githubProvider = new GithubAuthProvider ( ) ;
494
492
expect ( app . auth ( ) . signInWithRedirect ) . toHaveBeenCalledWith ( githubProvider ) ;
@@ -536,7 +534,7 @@ describe('FirebaseAuth', () => {
536
534
scope : [ 'email' ]
537
535
} ;
538
536
const token = 'GITHUB_TOKEN' ;
539
- const credentials = GithubAuthProvider . credential ( token ) ;
537
+ const credentials = ( < any > GithubAuthProvider ) . credential ( token ) ;
540
538
541
539
it ( 'passes provider, token, and options object to underlying method' , ( ) => {
542
540
afAuth . login ( credentials , options ) ;
@@ -546,7 +544,7 @@ describe('FirebaseAuth', () => {
546
544
it ( 'passes provider, OAuth credentials, and options object to underlying method' , ( ) => {
547
545
let customOptions = Object . assign ( { } , options ) ;
548
546
customOptions . provider = AuthProviders . Twitter ;
549
- let credentials = TwitterAuthProvider . credential ( '<ACCESS-TOKEN>' , '<ACCESS-TOKEN-SECRET>' ) ;
547
+ let credentials = ( < any > TwitterAuthProvider ) . credential ( '<ACCESS-TOKEN>' , '<ACCESS-TOKEN-SECRET>' ) ;
550
548
afAuth . login ( credentials , customOptions ) ;
551
549
expect ( app . auth ( ) . signInWithCredential ) . toHaveBeenCalledWith ( credentials ) ;
552
550
} ) ;
0 commit comments