diff --git a/packages/server/modules/core/tests/integration/user-emails.spec.ts b/packages/server/modules/core/tests/integration/user-emails.spec.ts index bdabf56f9..056be96a9 100644 --- a/packages/server/modules/core/tests/integration/user-emails.spec.ts +++ b/packages/server/modules/core/tests/integration/user-emails.spec.ts @@ -3,7 +3,6 @@ import { createUser } from '@/modules/core/services/users' import { beforeEachContext } from '@/test/hooks' import { expect } from 'chai' import { getUserByEmail } from '@/modules/core/repositories/users' -import { UserRecord } from '@/modules/core/helpers/types' import crs from 'crypto-random-string' function createRandomEmail() { @@ -31,7 +30,7 @@ describe('Core @user-emails', () => { }) // TODO: delete user email - const user = (await getUserByEmail('test@example.org')) as UserRecord + const user = (await getUserByEmail(email))! expect(user.name).to.eq('John Doe') expect(user.email).to.eq(email) }) @@ -44,7 +43,7 @@ describe('Core @user-emails', () => { password: createRandomPassword() }) - const user = (await getUserByEmail(email)) as UserRecord + const user = (await getUserByEmail(email))! expect(user.name).to.eq('John Doe') expect(user.email).to.eq(email) }) diff --git a/packages/server/modules/user-emails/migrations/20240703084247_user-emails.ts b/packages/server/modules/user-emails/migrations/20240703084247_user-emails.ts index 9ca9b7fd5..8330cbee9 100644 --- a/packages/server/modules/user-emails/migrations/20240703084247_user-emails.ts +++ b/packages/server/modules/user-emails/migrations/20240703084247_user-emails.ts @@ -1,8 +1,7 @@ import { Knex } from 'knex' -import { USER_EMAILS_TABLE_NAME } from '../constants' export async function up(knex: Knex): Promise { - await knex.schema.createTable(USER_EMAILS_TABLE_NAME, (table) => { + await knex.schema.createTable('user_emails', (table) => { table.string('id').notNullable().primary() table.string('email').notNullable() table.boolean('primary').defaultTo(false) @@ -26,5 +25,5 @@ export async function up(knex: Knex): Promise { } export async function down(knex: Knex): Promise { - await knex.schema.dropTableIfExists(USER_EMAILS_TABLE_NAME) + await knex.schema.dropTableIfExists('user_emails') }