@@ -27,7 +27,12 @@ import { Endpoint } from '../../api';
27
27
import { ServerError } from '../../api/errors' ;
28
28
import { Operation } from '../../model/action_code_info' ;
29
29
// import * as location from '../util/location';
30
- import { checkActionCode , confirmPasswordReset , sendPasswordResetEmail , verifyPasswordResetCode } from './email_and_password' ;
30
+ import {
31
+ checkActionCode ,
32
+ confirmPasswordReset ,
33
+ sendPasswordResetEmail ,
34
+ verifyPasswordResetCode
35
+ } from './email_and_password' ;
31
36
32
37
use ( chaiAsPromised ) ;
33
38
use ( sinonChai ) ;
@@ -60,9 +65,7 @@ describe('sendPasswordResetEmail', () => {
60
65
} ,
61
66
400
62
67
) ;
63
- await expect (
64
- sendPasswordResetEmail ( mockAuth , email )
65
- ) . to . be . rejectedWith (
68
+ await expect ( sendPasswordResetEmail ( mockAuth , email ) ) . to . be . rejectedWith (
66
69
FirebaseError ,
67
70
'Firebase: The email address is badly formatted. (auth/invalid-email).'
68
71
) ;
@@ -93,23 +96,23 @@ describe('sendPasswordResetEmail', () => {
93
96
iosBundleId : 'my-bundle' ,
94
97
iosAppStoreId : 'my-appstore-id'
95
98
} ) ;
96
- } ) ;
99
+ } ) ;
97
100
} ) ;
98
101
99
102
context ( 'on Android' , ( ) => {
100
- it ( 'should pass action code parameters' , async ( ) => {
103
+ it ( 'should pass action code parameters' , async ( ) => {
101
104
const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
102
105
email
103
106
} ) ;
104
107
await sendPasswordResetEmail ( mockAuth , email , {
105
- handleCodeInApp : true ,
106
- android : {
107
- installApp : false ,
108
- minimumVersion : 'my-version' ,
109
- packageName : 'my-package'
110
- } ,
111
- url : 'my-url' ,
112
- dynamicLinkDomain : 'fdl-domain'
108
+ handleCodeInApp : true ,
109
+ android : {
110
+ installApp : false ,
111
+ minimumVersion : 'my-version' ,
112
+ packageName : 'my-package'
113
+ } ,
114
+ url : 'my-url' ,
115
+ dynamicLinkDomain : 'fdl-domain'
113
116
} ) ;
114
117
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
115
118
requestType : Operation . PASSWORD_RESET ,
@@ -125,7 +128,6 @@ describe('sendPasswordResetEmail', () => {
125
128
} ) ;
126
129
} ) ;
127
130
128
-
129
131
describe ( 'confirmPasswordReset' , ( ) => {
130
132
const oobCode = 'oob-code' ;
131
133
const newPassword = 'new-password' ;
@@ -185,7 +187,7 @@ describe('checkActionCode', () => {
185
187
email,
186
188
fromEmail : null
187
189
} ,
188
- operation : Operation . PASSWORD_RESET
190
+ operation : Operation . PASSWORD_RESET
189
191
} ) ;
190
192
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
191
193
oobCode
@@ -215,9 +217,7 @@ describe('checkActionCode', () => {
215
217
const mock = mockEndpoint ( Endpoint . RESET_PASSWORD , {
216
218
email
217
219
} ) ;
218
- await expect (
219
- checkActionCode ( mockAuth , oobCode )
220
- ) . to . be . rejectedWith (
220
+ await expect ( checkActionCode ( mockAuth , oobCode ) ) . to . be . rejectedWith (
221
221
FirebaseError ,
222
222
'Firebase: An internal AuthError has occurred. (auth/internal-error).'
223
223
) ;
@@ -235,9 +235,7 @@ describe('checkActionCode', () => {
235
235
} ,
236
236
400
237
237
) ;
238
- await expect (
239
- checkActionCode ( mockAuth , oobCode )
240
- ) . to . be . rejectedWith (
238
+ await expect ( checkActionCode ( mockAuth , oobCode ) ) . to . be . rejectedWith (
241
239
FirebaseError ,
242
240
'Firebase: The action code is invalid. This can happen if the code is malformed]: expired]: or has already been used. (auth/invalid-action-code).'
243
241
) ;
@@ -268,9 +266,7 @@ describe('verifyPasswordResetCode', () => {
268
266
const mock = mockEndpoint ( Endpoint . RESET_PASSWORD , {
269
267
email
270
268
} ) ;
271
- await expect (
272
- verifyPasswordResetCode ( mockAuth , oobCode )
273
- ) . to . be . rejectedWith (
269
+ await expect ( verifyPasswordResetCode ( mockAuth , oobCode ) ) . to . be . rejectedWith (
274
270
FirebaseError ,
275
271
'Firebase: An internal AuthError has occurred. (auth/internal-error).'
276
272
) ;
@@ -288,13 +284,10 @@ describe('verifyPasswordResetCode', () => {
288
284
} ,
289
285
400
290
286
) ;
291
- await expect (
292
- verifyPasswordResetCode ( mockAuth , oobCode )
293
- ) . to . be . rejectedWith (
287
+ await expect ( verifyPasswordResetCode ( mockAuth , oobCode ) ) . to . be . rejectedWith (
294
288
FirebaseError ,
295
289
'Firebase: The action code is invalid. This can happen if the code is malformed]: expired]: or has already been used. (auth/invalid-action-code).'
296
290
) ;
297
291
expect ( mock . calls . length ) . to . eq ( 1 ) ;
298
292
} ) ;
299
293
} ) ;
300
-
0 commit comments