Skip to content

Commit 8e9aac2

Browse files
Fixing interdependency in mfa totp integration tests ax (#7362)
* reorganized mfa totp integration tests * formatted the code * added await for enroll function calls * created fakePassword to store password * fixed typo in mfaUser * moved fakePassword into integration helpers file * changed fakePassword var name to password
1 parent 574585a commit 8e9aac2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/auth/test/helpers/integration/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,6 @@ export function getTotpCode(
113113
return token;
114114
}
115115
export const email = '[email protected]';
116-
export const fakePassword = 'password';
116+
export const password = 'password';
117117
//1000000 is always incorrect since it has 7 digits and we expect 6.
118118
export const incorrectTotpCode = '1000000';

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
getTestInstance,
3232
getTotpCode,
3333
email,
34-
fakePassword,
34+
password,
3535
incorrectTotpCode
3636
} from '../../helpers/integration/helpers';
3737

@@ -77,7 +77,7 @@ describe(' Integration tests: Mfa enrollement using totp', () => {
7777
this.skip();
7878
}
7979

80-
const cr = await signInWithEmailAndPassword(auth, email, fakePassword);
80+
const cr = await signInWithEmailAndPassword(auth, email, password);
8181
mfaUser = multiFactor(cr.user);
8282
const session = await mfaUser.getSession();
8383
totpSecret = await TotpMultiFactorGenerator.generateSecret(session);
@@ -98,7 +98,7 @@ describe(' Integration tests: Mfa enrollement using totp', () => {
9898
this.skip();
9999
}
100100

101-
const cr = await signInWithEmailAndPassword(auth, email, fakePassword);
101+
const cr = await signInWithEmailAndPassword(auth, email, password);
102102
mfaUser = multiFactor(cr.user);
103103
const session = await mfaUser.getSession();
104104
totpSecret = await TotpMultiFactorGenerator.generateSecret(session);
@@ -130,7 +130,7 @@ describe('Integration tests: sign-in for mfa-enrolled users', () => {
130130
auth = getTestInstance();
131131
displayName = 'totp-integration-test';
132132

133-
const cr = await signInWithEmailAndPassword(auth, email, fakePassword);
133+
const cr = await signInWithEmailAndPassword(auth, email, password);
134134
mfaUser = multiFactor(cr.user);
135135
const session = await mfaUser.getSession();
136136
totpSecret = await TotpMultiFactorGenerator.generateSecret(session);
@@ -169,7 +169,7 @@ describe('Integration tests: sign-in for mfa-enrolled users', () => {
169169
this.skip();
170170
}
171171
try {
172-
await signInWithEmailAndPassword(auth, email, fakePassword);
172+
await signInWithEmailAndPassword(auth, email, password);
173173

174174
throw new Error('Signin should not have been successful');
175175
} catch (error) {
@@ -196,7 +196,7 @@ describe('Integration tests: sign-in for mfa-enrolled users', () => {
196196
this.skip();
197197
}
198198
try {
199-
await signInWithEmailAndPassword(auth, email, fakePassword);
199+
await signInWithEmailAndPassword(auth, email, password);
200200

201201
throw new Error('Signin should not have been successful');
202202
} catch (error) {
@@ -223,7 +223,7 @@ describe('Integration tests: sign-in for mfa-enrolled users', () => {
223223
mfaUser = multiFactor(userCredential.user);
224224

225225
await expect(mfaUser.unenroll(resolver.hints[0].uid)).to.be.fulfilled;
226-
await expect(signInWithEmailAndPassword(auth, email, fakePassword)).to.be
226+
await expect(signInWithEmailAndPassword(auth, email, password)).to.be
227227
.fulfilled;
228228
}
229229
});

0 commit comments

Comments
 (0)