Fix merge conflicts

This commit is contained in:
Hongbo Wu
2022-10-13 14:43:26 +08:00
parent 05ecac7c52
commit e3f4a619c7
3 changed files with 6 additions and 5 deletions

View File

@ -66,7 +66,7 @@ export const createTestConnection = async (): Promise<void> => {
export const deleteTestUser = async (userId: string) => {
await AppDataSource.transaction(async (t) => {
await setClaims(t, userId)
await t.getRepository(User).delete({ id: userId })
await t.getRepository(User).delete(userId)
})
}

View File

@ -55,7 +55,7 @@ describe('auth router', () => {
})
afterEach(async () => {
const user = await getRepository(User).findOne({ where: { name } })
const user = await getRepository(User).findOneBy({ name })
await deleteTestUser(user!.id)
})
@ -569,7 +569,8 @@ describe('auth router', () => {
let provider: AuthProvider = 'EMAIL'
afterEach(async () => {
await deleteTestUser(username)
const user = await getRepository(User).findOneBy({ name })
await deleteTestUser(user!.id)
})
it('adds popular reads to the library', async () => {

View File

@ -7,7 +7,7 @@ import {
PubSubRequestBody,
} from '../../src/datalayer/pubsub'
import { User } from '../../src/entity/user'
import { createTestUser, deleteTestUser } from '../db'
import { createTestUser, deleteTestIntegrations, deleteTestUser } from '../db'
import { Integration, IntegrationType } from '../../src/entity/integration'
import { getRepository } from '../../src/entity/utils'
import { Highlight, Page, PageContext } from '../../src/elastic/types'
@ -166,7 +166,7 @@ describe('Integrations routers', () => {
})
after(async () => {
await getRepository(Integration).delete(integration.id)
await deleteTestIntegrations(user.id, [integration.id])
await deletePage(page.id, ctx)
})