@@ -26,7 +26,6 @@ import { MultiFactorSessionImpl } from '../../mfa/mfa_session';
26
26
import { StartTotpMfaEnrollmentResponse } from '../../api/account_management/mfa' ;
27
27
import {
28
28
FinalizeMfaResponse ,
29
- StartTotpMfaSignInResponse
30
29
} from '../../api/authentication/mfa' ;
31
30
import {
32
31
TotpMultiFactorAssertionImpl ,
@@ -215,7 +214,6 @@ describe('core/mfa/totp/assertions/TotpMultiFactorAssertionImpl', () => {
215
214
describe ( 'Testing signin Flow' , ( ) => {
216
215
let auth : TestAuth ;
217
216
let assertion : MultiFactorAssertionImpl ;
218
- let totpSignInResponse : StartTotpMfaSignInResponse ;
219
217
let session : MultiFactorSessionImpl ;
220
218
beforeEach ( async ( ) => {
221
219
mockFetch . setUp ( ) ;
@@ -227,24 +225,21 @@ describe('Testing signin Flow', () => {
227
225
afterEach ( mockFetch . tearDown ) ;
228
226
229
227
it ( 'should finalize mfa signin for totp' , async ( ) => {
230
- totpSignInResponse = {
231
- verificationCode : '123456' ,
228
+ const mockResponse : FinalizeMfaResponse = {
232
229
idToken : 'final-id-token' ,
233
230
refreshToken : 'refresh-token'
234
- } as any ;
231
+ } ;
232
+ const mock = mockEndpoint (
233
+ Endpoint . FINALIZE_MFA_SIGN_IN ,
234
+ mockResponse
235
+ ) ;
235
236
assertion = TotpMultiFactorGenerator . assertionForSignIn (
236
237
'enrollment-id' ,
237
238
'123456'
238
239
) as any ;
239
-
240
- const mock = mockEndpoint (
241
- Endpoint . FINALIZE_MFA_SIGN_IN ,
242
- totpSignInResponse
243
- ) ;
244
-
245
240
const response = await assertion . _process ( auth , session ) ;
246
241
247
- expect ( response ) . to . eql ( totpSignInResponse ) ;
242
+ expect ( response ) . to . eql ( mockResponse ) ;
248
243
249
244
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
250
245
mfaPendingCredential : 'mfa-pending-credential' ,
@@ -256,12 +251,6 @@ describe('Testing signin Flow', () => {
256
251
} ) ;
257
252
258
253
it ( 'should throw Firebase Error if enrollment-id is undefined' , async ( ) => {
259
- let _response : FinalizeMfaResponse ;
260
- totpSignInResponse = {
261
- verificationCode : '123456' ,
262
- idToken : 'final-id-token' ,
263
- refreshToken : 'refresh-token'
264
- } as any ;
265
254
assertion = TotpMultiFactorGenerator . assertionForSignIn (
266
255
undefined as any ,
267
256
'123456'
@@ -273,12 +262,6 @@ describe('Testing signin Flow', () => {
273
262
} ) ;
274
263
275
264
it ( 'should throw Firebase Error if otp is undefined' , async ( ) => {
276
- let _response : FinalizeMfaResponse ;
277
- totpSignInResponse = {
278
- verificationCode : '123456' ,
279
- idToken : 'final-id-token' ,
280
- refreshToken : 'refresh-token'
281
- } as any ;
282
265
assertion = TotpMultiFactorGenerator . assertionForSignIn (
283
266
'enrollment-id' ,
284
267
undefined as any
0 commit comments