Files
Compass/tests/e2e/web/specs/firebaseAccountCreationTest.ts
Okechi Jones-Williams 00e7662d60 Added a context manager to test with multiple accounts interacting with each other
Added an option to verify the users email when creating an account
2026-05-28 19:32:44 +01:00

28 lines
776 B
TypeScript

import axios from 'axios'
import {config} from '../SPEC_CONFIG'
import {
firebaseLoginEmailPassword,
getOobCode,
getUserId,
sendVerificationEmail,
} from '../../utils/firebaseUtils'
async function setup() {
const loginInfo = await firebaseLoginEmailPassword('AnotherTest@email.com', 'Password')
await sendVerificationEmail(loginInfo.data.idToken)
const oobResponse = await axios.get(`${config.FIREBASE_URL.FIREBASE_EMULATOR_API}`)
const oobCode = await getOobCode(oobResponse.data.oobCodes, 'AnotherTest@email.com')
console.log(oobCode)
const response = await axios.post(
`${config.FIREBASE_URL.BASE}${config.FIREBASE_URL.CONFIRM_EMAIL_VERIFICATION}`,
{
oobCode,
},
)
console.log(response)
console.log(response.status)
}
setup()