Skip to content

Commit 41ec7e0

Browse files
committed
added increased timeout to generate new totp
1 parent 5457992 commit 41ec7e0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/auth/test/helpers/api/helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ export function mockEndpoint(
3030
): Route {
3131
return mock(endpointUrl(endpoint), response, status);
3232
}
33+

packages/auth/test/integration/flows/totp.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ describe(' Integration tests: Mfa TOTP', () => {
6262
auth = getTestInstance();
6363
email = '[email protected]';
6464
displayName = 'totp-integration-test';
65+
6566
// signUpCred = await createUserWithEmailAndPassword(
6667

6768
// auth,
@@ -181,7 +182,8 @@ describe(' Integration tests: Mfa TOTP', () => {
181182
console.log(email);
182183
console.log('session info for: ', getApp().options.projectId);
183184

184-
await delay(15*1000);
185+
// Added a delay so that getTotpCode() actually generates a new totp code
186+
await delay(30*1000);
185187
try{
186188

187189
const userCredential = await signInWithEmailAndPassword(auth, email, 'password');
@@ -217,7 +219,7 @@ describe(' Integration tests: Mfa TOTP', () => {
217219
}
218220

219221

220-
})
222+
}).timeout(31000);
221223

222224
it('should allow sign-in with for correct totp and unenroll successfully', async() => {
223225

@@ -226,7 +228,8 @@ describe(' Integration tests: Mfa TOTP', () => {
226228
console.log(email);
227229
console.log('session info for: ', getApp().options.projectId);
228230

229-
await delay(15*1000);
231+
// Added a delay so that getTotpCode() actually generates a new totp code
232+
await delay(30*1000);
230233
try{
231234

232235
const userCredential = await signInWithEmailAndPassword(auth, email, 'password');
@@ -263,5 +266,5 @@ describe(' Integration tests: Mfa TOTP', () => {
263266
await auth.signOut();
264267

265268
}
266-
})
269+
}).timeout(31000);
267270
})

0 commit comments

Comments
 (0)