From 073a0f3600fa3d00560b08a77aa51b8b71ab2d8f Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Mon, 20 Nov 2023 16:52:04 -0500 Subject: [PATCH 01/14] ping --- packages/auth/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/auth/index.ts b/packages/auth/index.ts index 6ed92b361ac..95f67e03663 100644 --- a/packages/auth/index.ts +++ b/packages/auth/index.ts @@ -1,4 +1,5 @@ /** + * * Firebase Authentication * * @packageDocumentation From 0830eed6bd05945630e6b367879f4031183aa1bb Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 08:18:51 -0500 Subject: [PATCH 02/14] reduce concurrency to 1 --- scripts/ci-test/test_changed.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci-test/test_changed.ts b/scripts/ci-test/test_changed.ts index 5d2f30865ed..e3378fb643b 100644 --- a/scripts/ci-test/test_changed.ts +++ b/scripts/ci-test/test_changed.ts @@ -59,7 +59,7 @@ async function runTests(config: TestConfig) { process.exit(0); } - const lernaCmd = ['lerna', 'run', '--concurrency', '4']; + const lernaCmd = ['lerna', 'run', '--concurrency', '1']; console.log(chalk`{blue Running tests in:}`); for (const task of testTasks) { if (task.reason === TestReason.Changed) { From 86c332ad1750686dee59e68dcae1bf4beb696e4a Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 08:37:05 -0500 Subject: [PATCH 03/14] disable numerous passing auth tests --- .../test/integration/flows/oob.test.ts | 4 +- .../test/integration/flows/oob.local.test.ts | 40 ++++++++++++------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/packages/auth-compat/test/integration/flows/oob.test.ts b/packages/auth-compat/test/integration/flows/oob.test.ts index da7d07cea38..7722627630b 100644 --- a/packages/auth-compat/test/integration/flows/oob.test.ts +++ b/packages/auth-compat/test/integration/flows/oob.test.ts @@ -72,7 +72,7 @@ describe('Integration test: oob codes', () => { return code(toEmail); } - it('allows user to sign in', async () => { + /*it('allows user to sign in', async () => { const { user, operationType } = await firebase .auth() .signInWithEmailLink(email, oobSession.oobLink); @@ -183,7 +183,7 @@ describe('Integration test: oob codes', () => { expect(firebase.auth().currentUser).to.eq(linked); expect(linked!.email).to.eq(email); expect(linked!.emailVerified).to.be.true; - }); + });*/ it('can be linked to a custom token', async () => { const { user: original } = await firebase.auth().signInWithCustomToken( diff --git a/packages/auth/test/integration/flows/oob.local.test.ts b/packages/auth/test/integration/flows/oob.local.test.ts index 1966bcef6b7..e4032ba799f 100644 --- a/packages/auth/test/integration/flows/oob.local.test.ts +++ b/packages/auth/test/integration/flows/oob.local.test.ts @@ -113,7 +113,7 @@ describe('Integration test: oob codes', () => { expect(user.isAnonymous).to.be.false; }); - it('sign in works with an email credential', async () => { + /*it('sign in works with an email credential', async () => { const cred = EmailAuthProvider.credentialWithLink( email, oobSession.oobLink @@ -127,8 +127,9 @@ describe('Integration test: oob codes', () => { expect(user.emailVerified).to.be.true; expect(user.isAnonymous).to.be.false; }); + */ - it('reauthenticate works with email credential', async () => { + /*it('reauthenticate works with email credential', async () => { let cred = EmailAuthProvider.credentialWithLink( email, oobSession.oobLink @@ -143,9 +144,9 @@ describe('Integration test: oob codes', () => { expect(newUser.uid).to.eq(oldUser.uid); expect(operationType).to.eq(OperationType.REAUTHENTICATE); expect(auth.currentUser).to.eq(newUser); - }); + });*/ - it('reauthenticate throws with different email', async () => { + /*it('reauthenticate throws with different email', async () => { let cred = EmailAuthProvider.credentialWithLink( email, oobSession.oobLink @@ -163,8 +164,9 @@ describe('Integration test: oob codes', () => { ).to.be.rejectedWith(FirebaseError, 'auth/user-mismatch'); expect(auth.currentUser).to.eq(oldUser); }); + */ - it('reauthenticate throws if user is deleted', async () => { + /*it('reauthenticate throws if user is deleted', async () => { let cred = EmailAuthProvider.credentialWithLink( email, oobSession.oobLink @@ -179,8 +181,9 @@ describe('Integration test: oob codes', () => { ).to.be.rejectedWith(FirebaseError, 'auth/user-mismatch'); expect(auth.currentUser).to.be.null; }); + */ - it('other accounts can be linked', async () => { + /*it('other accounts can be linked', async () => { const cred = EmailAuthProvider.credentialWithLink( email, oobSession.oobLink @@ -200,8 +203,9 @@ describe('Integration test: oob codes', () => { expect(linked.email).to.eq(email); expect(linked.emailVerified).to.be.true; }); + */ - it('can be linked to a custom token', async () => { + /*it('can be linked to a custom token', async () => { const { user: original } = await signInWithCustomToken( auth, JSON.stringify({ @@ -220,8 +224,9 @@ describe('Integration test: oob codes', () => { expect(linked.email).to.eq(email); expect(linked.emailVerified).to.be.true; }); + */ - it('cannot link if original account is deleted', async () => { + /*it('cannot link if original account is deleted', async () => { const cred = EmailAuthProvider.credentialWithLink( email, oobSession.oobLink @@ -235,8 +240,9 @@ describe('Integration test: oob codes', () => { 'auth/user-token-expired' ); }); + */ - it('code can only be used once', async () => { + /*it('code can only be used once', async () => { const link = oobSession.oobLink; await signInWithEmailLink(auth, email, link); await expect(signInWithEmailLink(auth, email, link)).to.be.rejectedWith( @@ -244,8 +250,9 @@ describe('Integration test: oob codes', () => { 'auth/invalid-action-code' ); }); + */ - it('fetchSignInMethodsForEmail returns the correct values', async () => { + /*it('fetchSignInMethodsForEmail returns the correct values', async () => { const { user } = await signInWithEmailLink( auth, email, @@ -261,13 +268,15 @@ describe('Integration test: oob codes', () => { expect(updatedMethods).to.include(SignInMethod.EMAIL_LINK); expect(updatedMethods).to.include(SignInMethod.EMAIL_PASSWORD); }); + */ - it('throws an error if the wrong code is provided', async () => { + /*it('throws an error if the wrong code is provided', async () => { const otherSession = await sendEmailLink(randomEmail()); await expect( signInWithEmailLink(auth, email, otherSession.oobLink) ).to.be.rejectedWith(FirebaseError, 'auth/invalid-email'); }); + */ generateMiddlewareTests( () => auth, @@ -277,7 +286,7 @@ describe('Integration test: oob codes', () => { ); }); - it('can be used to verify email', async () => { + /*it('can be used to verify email', async () => { // Create an unverified user const { user } = await createUserWithEmailAndPassword( auth, @@ -295,8 +304,9 @@ describe('Integration test: oob codes', () => { await user.reload(); expect(user.emailVerified).to.be.true; }); + */ - it('can be used to initiate password reset', async () => { + /*it('can be used to initiate password reset', async () => { const { user: original } = await createUserWithEmailAndPassword( auth, email, @@ -327,10 +337,11 @@ describe('Integration test: oob codes', () => { signInWithEmailAndPassword(auth, email, 'password') ).to.be.rejectedWith(FirebaseError, 'auth/wrong-password'); }); + */ // Test is ignored for now as the emulator does not currently support the // verify-and-change-email operation. - xit('verifyBeforeUpdateEmail waits until flow completes', async () => { + /*xit('verifyBeforeUpdateEmail waits until flow completes', async () => { const updatedEmail = randomEmail(); // Create an initial user with the basic email @@ -363,4 +374,5 @@ describe('Integration test: oob codes', () => { ); expect(newSignIn.uid).to.eq(user.uid); }); + */ }); From f6d5f14d1f0ff78ee07124d05c142d00547e0a7b Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 09:42:10 -0500 Subject: [PATCH 04/14] disable calls onAbort after rejection in integration flow middleware_test_generator.ts --- .../auth/test/integration/flows/middleware_test_generator.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/auth/test/integration/flows/middleware_test_generator.ts b/packages/auth/test/integration/flows/middleware_test_generator.ts index ae0ec1fa4e2..9356ad479f8 100644 --- a/packages/auth/test/integration/flows/middleware_test_generator.ts +++ b/packages/auth/test/integration/flows/middleware_test_generator.ts @@ -219,7 +219,7 @@ export function generateMiddlewareTests( expect(auth.currentUser).to.eq(user); }); - it('calls onAbort after rejection', async () => { + /*it('calls onAbort after rejection', async () => { const onAbort = sinon.spy(); beforeAuthStateChanged(() => { // Pass @@ -231,5 +231,6 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(onAbort).to.have.been.called; }); + */ }); } From 3d4f361ab71b29db3d31ba8ff38b7200938ad40c Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 10:15:42 -0500 Subject: [PATCH 05/14] remove more tests --- .../integration/flows/middleware_test_generator.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/auth/test/integration/flows/middleware_test_generator.ts b/packages/auth/test/integration/flows/middleware_test_generator.ts index 9356ad479f8..879f2229a13 100644 --- a/packages/auth/test/integration/flows/middleware_test_generator.ts +++ b/packages/auth/test/integration/flows/middleware_test_generator.ts @@ -171,7 +171,7 @@ export function generateMiddlewareTests( expect(spy).to.have.been.calledThrice; }); - it('allows sign in with multiple callbacks all pass', async () => { + /*it('allows sign in with multiple callbacks all pass', async () => { // Use a random email/password sign in for the base user const { user: baseUser } = await createUserWithEmailAndPassword( auth, @@ -190,9 +190,9 @@ export function generateMiddlewareTests( await expect(signIn()).not.to.be.rejected; expect(auth.currentUser).not.to.eq(baseUser); expect(spy).to.have.been.calledThrice; - }); + });*/ - it('does not call subsequent callbacks after rejection', async () => { + /*it('does not call subsequent callbacks after rejection', async () => { const firstSpy = sinon.spy(); const secondSpy = sinon.spy(); @@ -205,9 +205,9 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(firstSpy).to.have.been.calledOnce; expect(secondSpy).not.to.have.been.called; - }); + });*/ - it('can prevent sign-out', async () => { + /*it('can prevent sign-out', async () => { await signIn(); const user = auth.currentUser; @@ -217,7 +217,7 @@ export function generateMiddlewareTests( await expect(auth.signOut()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.eq(user); - }); + });*/ /*it('calls onAbort after rejection', async () => { const onAbort = sinon.spy(); From 2a6975a509ea1e77e7afb592fe97771f3735be40 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 10:27:49 -0500 Subject: [PATCH 06/14] more tests removed --- .../flows/middleware_test_generator.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/auth/test/integration/flows/middleware_test_generator.ts b/packages/auth/test/integration/flows/middleware_test_generator.ts index 879f2229a13..e64c1164611 100644 --- a/packages/auth/test/integration/flows/middleware_test_generator.ts +++ b/packages/auth/test/integration/flows/middleware_test_generator.ts @@ -96,25 +96,25 @@ export function generateMiddlewareTests( expect(auth.currentUser).to.eq(baseUser); }); - it('can allow sign in', async () => { + /*it('can allow sign in', async () => { beforeAuthStateChanged(() => { // Pass }); await expect(signIn()).not.to.be.rejected; expect(auth.currentUser).not.to.be.null; - }); + });*/ - it('can allow sign in as a promise', async () => { + /* it('can allow sign in as a promise', async () => { beforeAuthStateChanged(() => { return Promise.resolve(); }); await expect(signIn()).not.to.be.rejected; expect(auth.currentUser).not.to.be.null; - }); + });*/ - it('overrides previous user if allowed', async () => { + /*it('overrides previous user if allowed', async () => { // Use a random email/password sign in for the base user const { user: baseUser } = await createUserWithEmailAndPassword( auth, @@ -128,9 +128,9 @@ export function generateMiddlewareTests( await expect(signIn()).not.to.be.rejected; expect(auth.currentUser).not.to.eq(baseUser); - }); + });*/ - it('will reject if one callback fails', async () => { + /*it('will reject if one callback fails', async () => { // Also check that the function is called multiple // times const spy = sinon.spy(); @@ -145,9 +145,9 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.be.null; expect(spy).to.have.been.calledThrice; - }); + });*/ - it('keeps previously-logged in user if one rejects', async () => { + /*it('keeps previously-logged in user if one rejects', async () => { // Use a random email/password sign in for the base user const { user: baseUser } = await createUserWithEmailAndPassword( auth, @@ -169,7 +169,7 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.eq(baseUser); expect(spy).to.have.been.calledThrice; - }); + });*/ /*it('allows sign in with multiple callbacks all pass', async () => { // Use a random email/password sign in for the base user From 096e29c028e50439e28a3dd26bb5c8a1c4d09f96 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 10:34:44 -0500 Subject: [PATCH 07/14] at least one sinon test --- .../test/integration/flows/middleware_test_generator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/auth/test/integration/flows/middleware_test_generator.ts b/packages/auth/test/integration/flows/middleware_test_generator.ts index e64c1164611..bf1c08e4b75 100644 --- a/packages/auth/test/integration/flows/middleware_test_generator.ts +++ b/packages/auth/test/integration/flows/middleware_test_generator.ts @@ -80,7 +80,7 @@ export function generateMiddlewareTests( expect(auth.currentUser).to.be.null; }); - it('keeps previously-logged in user if blocked', async () => { + /*it('keeps previously-logged in user if blocked', async () => { // Use a random email/password sign in for the base user const { user: baseUser } = await createUserWithEmailAndPassword( auth, @@ -94,7 +94,7 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.eq(baseUser); - }); + });*/ /*it('can allow sign in', async () => { beforeAuthStateChanged(() => { @@ -130,7 +130,7 @@ export function generateMiddlewareTests( expect(auth.currentUser).not.to.eq(baseUser); });*/ - /*it('will reject if one callback fails', async () => { + it('will reject if one callback fails', async () => { // Also check that the function is called multiple // times const spy = sinon.spy(); @@ -145,7 +145,7 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.be.null; expect(spy).to.have.been.calledThrice; - });*/ + }); /*it('keeps previously-logged in user if one rejects', async () => { // Use a random email/password sign in for the base user From cc6a844e5420a7fb47ae199a3e3b8cb28245b077 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 10:45:20 -0500 Subject: [PATCH 08/14] remove validatePassword tests --- packages/auth/test/integration/flows/password_policy.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/auth/test/integration/flows/password_policy.test.ts b/packages/auth/test/integration/flows/password_policy.test.ts index 5ad73976f39..0b94c4d0fcb 100644 --- a/packages/auth/test/integration/flows/password_policy.test.ts +++ b/packages/auth/test/integration/flows/password_policy.test.ts @@ -60,7 +60,7 @@ describe('Integration test: password validation', () => { const INVALID_PASSWORD = 'a'; const TENANT_PARTIALLY_INVALID_PASSWORD = 'Password0123'; - it('considers valid passwords valid against the policy configured for the project', async () => { + /*it('considers valid passwords valid against the policy configured for the project', async () => { const password = await generateValidPassword(auth); expect((await validatePassword(auth, password)).isValid).to.be.true; }); @@ -114,6 +114,6 @@ describe('Integration test: password validation', () => { expect(status.passwordPolicy.customStrengthOptions).to.eql( EXPECTED_TENANT_CUSTOM_STRENGTH_OPTIONS ); - }); + });*/ }); }); From 5a352ea1696f1543fa2968443818f0fa515e3e3b Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 10:59:44 -0500 Subject: [PATCH 09/14] remove tests from middleware_test_generator.ts --- .../integration/flows/middleware_test_generator.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/auth/test/integration/flows/middleware_test_generator.ts b/packages/auth/test/integration/flows/middleware_test_generator.ts index bf1c08e4b75..97c2184e346 100644 --- a/packages/auth/test/integration/flows/middleware_test_generator.ts +++ b/packages/auth/test/integration/flows/middleware_test_generator.ts @@ -17,7 +17,7 @@ import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import * as sinon from 'sinon'; +//import * as sinon from 'sinon'; import sinonChai from 'sinon-chai'; // eslint-disable-next-line import/no-extraneous-dependencies @@ -62,7 +62,7 @@ export function generateMiddlewareTests( unsubscribes.push(auth.beforeAuthStateChanged(callback, onAbort)); } - it('can prevent user sign in', async () => { + /*it('can prevent user sign in', async () => { beforeAuthStateChanged(() => { throw new Error('stop sign in'); }); @@ -78,7 +78,7 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.be.null; - }); + });*/ /*it('keeps previously-logged in user if blocked', async () => { // Use a random email/password sign in for the base user @@ -130,7 +130,7 @@ export function generateMiddlewareTests( expect(auth.currentUser).not.to.eq(baseUser); });*/ - it('will reject if one callback fails', async () => { + /*it('will reject if one callback fails', async () => { // Also check that the function is called multiple // times const spy = sinon.spy(); @@ -145,7 +145,7 @@ export function generateMiddlewareTests( await expect(signIn()).to.be.rejectedWith('auth/login-blocked'); expect(auth.currentUser).to.be.null; expect(spy).to.have.been.calledThrice; - }); + });*/ /*it('keeps previously-logged in user if one rejects', async () => { // Use a random email/password sign in for the base user From 31e9820a945a45ff66cb0bf008dd7bbc9fc0f532 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 11:12:08 -0500 Subject: [PATCH 10/14] remove auth compat itest phone flows --- .../test/integration/flows/phone.test.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/auth-compat/test/integration/flows/phone.test.ts b/packages/auth-compat/test/integration/flows/phone.test.ts index fc623c4177d..0f32f6bbe02 100644 --- a/packages/auth-compat/test/integration/flows/phone.test.ts +++ b/packages/auth-compat/test/integration/flows/phone.test.ts @@ -81,7 +81,7 @@ describe('Integration test: phone auth', () => { return codes[vid].code; } - it('allows user to sign up', async () => { + /*it('allows user to sign up', async () => { const cr = await firebase .auth() .signInWithPhoneNumber(PHONE_A.phoneNumber, verifier); @@ -94,9 +94,9 @@ describe('Integration test: phone auth', () => { expect(user!.isAnonymous).to.be.false; expect(user!.uid).to.be.a('string'); expect(user!.phoneNumber).to.eq(PHONE_A.phoneNumber); - }); + });*/ - it('anonymous users can link (and unlink) phone number', async () => { + /*it('anonymous users can link (and unlink) phone number', async () => { const { user } = await firebase.auth().signInAnonymously(); const { uid: anonId } = user!; @@ -111,9 +111,9 @@ describe('Integration test: phone auth', () => { // Is anonymous stays false even after unlinking expect(firebase.auth().currentUser!.isAnonymous).to.be.false; expect(firebase.auth().currentUser!.phoneNumber).to.be.null; - }); + });*/ - it('anonymous users can upgrade using phone number', async () => { + /*it('anonymous users can upgrade using phone number', async () => { const { user } = await firebase.auth().signInAnonymously(); const { uid: anonId } = user!; @@ -144,9 +144,9 @@ describe('Integration test: phone auth', () => { PHONE_B.phoneNumber ); expect(secondSignIn!.providerData[0]!.providerId).to.eq('phone'); - }); + });*/ - context('with already-created user', () => { + context('with already-created user compat', () => { let signUpCred: UserCredential; beforeEach(async () => { @@ -158,16 +158,16 @@ describe('Integration test: phone auth', () => { await firebase.auth().signOut(); }); - it('allows the user to sign in again', async () => { + /*it('allows the user to sign in again', async () => { const cr = await firebase .auth() .signInWithPhoneNumber(PHONE_A.phoneNumber, verifier); const signInCred = await cr.confirm(await code(cr)); expect(signInCred.user!.uid).to.eq(signUpCred.user!.uid); - }); + });*/ - it('allows the user to update their phone number', async () => { + /*it('allows the user to update their phone number', async () => { let cr = await firebase .auth() .signInWithPhoneNumber(PHONE_A.phoneNumber, verifier); @@ -197,9 +197,9 @@ describe('Integration test: phone auth', () => { .signInWithPhoneNumber(PHONE_B.phoneNumber, verifier); const { user: secondSignIn } = await cr.confirm(await code(cr)); expect(secondSignIn!.uid).to.eq(user!.uid); - }); + });*/ - it('allows the user to reauthenticate with phone number', async () => { + /*it('allows the user to reauthenticate with phone number', async () => { let cr = await firebase .auth() .signInWithPhoneNumber(PHONE_A.phoneNumber, verifier); @@ -220,9 +220,9 @@ describe('Integration test: phone auth', () => { await cr.confirm(await code(cr)); expect(await user!.getIdToken()).not.to.eq(oldToken); - }); + });*/ - it('prevents reauthentication with wrong phone number', async () => { + /*it('prevents reauthentication with wrong phone number', async () => { let cr = await firebase .auth() .signInWithPhoneNumber(PHONE_A.phoneNumber, verifier); @@ -247,6 +247,6 @@ describe('Integration test: phone auth', () => { .signInWithPhoneNumber(PHONE_B.phoneNumber, verifier); const { user: otherUser } = await cr.confirm(await code(cr)); await otherUser!.delete(); - }); + });*/ }); }); From 760a6970bed3c02b61a14f2bdc56018cbd1de915 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 11:27:12 -0500 Subject: [PATCH 11/14] remove some phone mod tests --- .../auth/test/integration/flows/phone.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/auth/test/integration/flows/phone.test.ts b/packages/auth/test/integration/flows/phone.test.ts index 755e6bf2456..0d077ae4a40 100644 --- a/packages/auth/test/integration/flows/phone.test.ts +++ b/packages/auth/test/integration/flows/phone.test.ts @@ -183,7 +183,7 @@ describe('Integration test: phone auth', () => { await auth.signOut(); }); - it('allows the user to sign in again', async () => { + it('allows the user to sign in again mod', async () => { const cr = await signInWithPhoneNumber( auth, PHONE_A.phoneNumber, @@ -194,7 +194,7 @@ describe('Integration test: phone auth', () => { expect(signInCred.user.uid).to.eq(signUpCred.user.uid); }); - it('allows the user to update their phone number', async () => { + /*it('allows the user to update their phone number', async () => { let cr = await signInWithPhoneNumber(auth, PHONE_A.phoneNumber, verifier); const { user } = await cr.confirm(await code(cr, PHONE_A.code)); @@ -223,9 +223,9 @@ describe('Integration test: phone auth', () => { await code(cr, PHONE_B.code) ); expect(secondSignIn.uid).to.eq(user.uid); - }); + });*/ - it('allows the user to reauthenticate with phone number', async () => { + /*it('allows the user to reauthenticate with phone number', async () => { let cr = await signInWithPhoneNumber(auth, PHONE_A.phoneNumber, verifier); const { user } = await cr.confirm(await code(cr, PHONE_A.code)); const oldToken = await user.getIdToken(); @@ -245,9 +245,9 @@ describe('Integration test: phone auth', () => { await cr.confirm(await code(cr, PHONE_A.code)); expect(await user.getIdToken()).not.to.eq(oldToken); - }); + });*/ - it('prevents reauthentication with wrong phone number', async () => { + /*it('prevents reauthentication with wrong phone number', async () => { let cr = await signInWithPhoneNumber(auth, PHONE_A.phoneNumber, verifier); const { user } = await cr.confirm(await code(cr, PHONE_A.code)); @@ -271,9 +271,9 @@ describe('Integration test: phone auth', () => { await code(cr, PHONE_B.code) ); await otherUser.delete(); - }); + });*/ - it('handles account exists with credential errors', async () => { + /*it('handles account exists with credential errors', async () => { // PHONE_A is already a user. Try to link it with an email account const { user } = await signInAnonymously(auth); expect(user.uid).not.to.eq(signUpCred.user.uid); @@ -305,7 +305,7 @@ describe('Integration test: phone auth', () => { expect(credential).not.be.null; const errorUserCred = await signInWithCredential(auth, credential!); expect(errorUserCred.user.uid).to.eq(signUpCred.user.uid); - }); + });*/ }); generateMiddlewareTests( From b9cb544d3afa8cb1b9413f86c67b77aa620b501e Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 11:38:03 -0500 Subject: [PATCH 12/14] remove all mod phone tests --- .../auth/test/integration/flows/phone.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/auth/test/integration/flows/phone.test.ts b/packages/auth/test/integration/flows/phone.test.ts index 0d077ae4a40..9cd04dc3e15 100644 --- a/packages/auth/test/integration/flows/phone.test.ts +++ b/packages/auth/test/integration/flows/phone.test.ts @@ -107,7 +107,7 @@ describe('Integration test: phone auth', () => { return fallback; } - it('allows user to sign up', async () => { + /*it('allows user to sign up', async () => { const cr = await signInWithPhoneNumber(auth, PHONE_A.phoneNumber, verifier); const userCred = await cr.confirm(await code(cr, PHONE_A.code)); @@ -118,9 +118,9 @@ describe('Integration test: phone auth', () => { expect(user.isAnonymous).to.be.false; expect(user.uid).to.be.a('string'); expect(user.phoneNumber).to.eq(PHONE_A.phoneNumber); - }); + });*/ - it('anonymous users can link (and unlink) phone number', async () => { + /*it('anonymous users can link (and unlink) phone number', async () => { const { user } = await signInAnonymously(auth); const { uid: anonId } = user; @@ -135,9 +135,9 @@ describe('Integration test: phone auth', () => { // Is anonymous stays false even after unlinking expect(auth.currentUser!.isAnonymous).to.be.false; expect(auth.currentUser!.phoneNumber).to.be.null; - }); + });*/ - it('anonymous users can upgrade using phone number', async () => { + /*it('anonymous users can upgrade using phone number', async () => { const { user } = await signInAnonymously(auth); const { uid: anonId } = user; @@ -167,7 +167,7 @@ describe('Integration test: phone auth', () => { expect(secondSignIn.isAnonymous).to.be.false; expect(secondSignIn.providerData[0].phoneNumber).to.eq(PHONE_B.phoneNumber); expect(secondSignIn.providerData[0].providerId).to.eq('phone'); - }); + });*/ context('with already-created user', () => { let signUpCred: UserCredential; @@ -183,7 +183,7 @@ describe('Integration test: phone auth', () => { await auth.signOut(); }); - it('allows the user to sign in again mod', async () => { + /*it('allows the user to sign in again mod', async () => { const cr = await signInWithPhoneNumber( auth, PHONE_A.phoneNumber, @@ -192,7 +192,7 @@ describe('Integration test: phone auth', () => { const signInCred = await cr.confirm(await code(cr, PHONE_A.code)); expect(signInCred.user.uid).to.eq(signUpCred.user.uid); - }); + });*/ /*it('allows the user to update their phone number', async () => { let cr = await signInWithPhoneNumber(auth, PHONE_A.phoneNumber, verifier); From f275b2d766c306b95f669c58498449bd1ce3a3c1 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 11:49:47 -0500 Subject: [PATCH 13/14] remote cmpat email.test.ts tests --- .../test/integration/flows/email.test.ts | 30 +++++++++---------- .../auth/test/integration/flows/email.test.ts | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/auth-compat/test/integration/flows/email.test.ts b/packages/auth-compat/test/integration/flows/email.test.ts index 24829276c23..b14afbd9385 100644 --- a/packages/auth-compat/test/integration/flows/email.test.ts +++ b/packages/auth-compat/test/integration/flows/email.test.ts @@ -29,7 +29,7 @@ import { UserCredential } from '@firebase/auth-types'; use(chaiAsPromised); -describe('Integration test: email/password auth', () => { +describe('Integration test: email/password auth compat', () => { let email: string; beforeEach(() => { initializeTestInstance(); @@ -38,7 +38,7 @@ describe('Integration test: email/password auth', () => { afterEach(() => cleanUpTestInstance()); - it('allows user to sign up', async () => { + /*it('allows user to sign up', async () => { const userCred = await firebase .auth() .createUserWithEmailAndPassword(email, 'password'); @@ -57,14 +57,14 @@ describe('Integration test: email/password auth', () => { const additionalUserInfo = userCred.additionalUserInfo!; expect(additionalUserInfo.isNewUser).to.be.true; expect(additionalUserInfo.providerId).to.eq('password'); - }); + });*/ - it('errors when createUser called twice', async () => { + /*it('errors when createUser called twice', async () => { await firebase.auth().createUserWithEmailAndPassword(email, 'password'); await expect( firebase.auth().createUserWithEmailAndPassword(email, 'password') ).to.be.rejectedWith(FirebaseError, 'auth/email-already-in-use'); - }); + });*/ context('with existing user', () => { let signUpCred: UserCredential; @@ -76,7 +76,7 @@ describe('Integration test: email/password auth', () => { await firebase.auth().signOut(); }); - it('allows the user to sign in with signInWithEmailAndPassword', async () => { + /*it('allows the user to sign in with signInWithEmailAndPassword', async () => { const signInCred = await firebase .auth() .signInWithEmailAndPassword(email, 'password'); @@ -87,9 +87,9 @@ describe('Integration test: email/password auth', () => { const additionalUserInfo = signInCred.additionalUserInfo!; expect(additionalUserInfo.isNewUser).to.be.false; expect(additionalUserInfo.providerId).to.eq('password'); - }); + });*/ - it('allows the user to sign in with signInWithCredential', async () => { + /*it('allows the user to sign in with signInWithCredential', async () => { const credential = firebase.auth.EmailAuthProvider.credential( email, 'password' @@ -102,9 +102,9 @@ describe('Integration test: email/password auth', () => { const additionalUserInfo = signInCred.additionalUserInfo!; expect(additionalUserInfo.isNewUser).to.be.false; expect(additionalUserInfo.providerId).to.eq('password'); - }); + });*/ - it('allows the user to update profile', async () => { + /*it('allows the user to update profile', async () => { let { user } = await firebase .auth() .signInWithEmailAndPassword(email, 'password'); @@ -122,9 +122,9 @@ describe('Integration test: email/password auth', () => { ).user; expect(user!.displayName).to.eq('Display Name'); expect(user!.photoURL).to.eq('photo-url'); - }); + });*/ - it('allows the user to delete the account', async () => { + /*it('allows the user to delete the account', async () => { const { user } = await firebase .auth() .signInWithEmailAndPassword(email, 'password'); @@ -139,9 +139,9 @@ describe('Integration test: email/password auth', () => { await expect( firebase.auth().signInWithEmailAndPassword(email, 'password') ).to.be.rejectedWith(FirebaseError, 'auth/user-not-found'); - }); + });*/ - it('sign in can be called twice successively', async () => { + /*it('sign in can be called twice successively', async () => { const { user: userA } = await firebase .auth() .signInWithEmailAndPassword(email, 'password'); @@ -149,6 +149,6 @@ describe('Integration test: email/password auth', () => { .auth() .signInWithEmailAndPassword(email, 'password'); expect(userA!.uid).to.eq(userB!.uid); - }); + });*/ }); }); diff --git a/packages/auth/test/integration/flows/email.test.ts b/packages/auth/test/integration/flows/email.test.ts index 792548e4e6b..65586a9f278 100644 --- a/packages/auth/test/integration/flows/email.test.ts +++ b/packages/auth/test/integration/flows/email.test.ts @@ -42,7 +42,7 @@ import { generateMiddlewareTests } from './middleware_test_generator'; use(chaiAsPromised); -describe('Integration test: email/password auth', () => { +describe('Integration test: email/password auth mod', () => { let auth: Auth; let email: string; let password: string; From 1ee137a5e0ea525743fc4d0851d540aac3676ca9 Mon Sep 17 00:00:00 2001 From: DellaBitta Date: Tue, 21 Nov 2023 12:08:38 -0500 Subject: [PATCH 14/14] determine if custom compat or mod is failing --- packages/auth-compat/test/integration/flows/custom.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth-compat/test/integration/flows/custom.test.ts b/packages/auth-compat/test/integration/flows/custom.test.ts index 7fe45521c97..58dc0b222cc 100644 --- a/packages/auth-compat/test/integration/flows/custom.test.ts +++ b/packages/auth-compat/test/integration/flows/custom.test.ts @@ -30,7 +30,7 @@ import { use(chaiAsPromised); -describe('Integration test: custom auth', () => { +describe('Integration test: custom auth compat', () => { let customToken: string; let uid: string;