Skip to content

Commit

Permalink
Update testHelper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Nov 18, 2024
1 parent cf4339e commit ca70bcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/tests/testHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const initialize = async () => {

// env admin
if (env.ADMIN_EMAIL) {
let adminFromEnv = await User.exists({ email: env.ADMIN_EMAIL })
let adminFromEnv = await User.findOne({ email: env.ADMIN_EMAIL, type: bookcarsTypes.UserType.Admin })
if (!adminFromEnv) {
const _admin = new User({
fullName: 'admin',
Expand All @@ -73,7 +73,7 @@ export const initialize = async () => {
// test suites are run in parallel.
//
await delay(2000)
adminFromEnv = await User.exists({ email: env.ADMIN_EMAIL, type: bookcarsTypes.UserType.Admin })
adminFromEnv = await User.findOne({ email: env.ADMIN_EMAIL, type: bookcarsTypes.UserType.Admin })
if (!adminFromEnv) {
await _admin.save()
expect(_admin.id).toBeTruthy()
Expand Down

0 comments on commit ca70bcb

Please sign in to comment.