diff --git a/packages/cli/src/databases/repositories/test.repository.ts b/packages/cli/src/databases/repositories/test.repository.ts index aa6911847f..65c46b49e8 100644 --- a/packages/cli/src/databases/repositories/test.repository.ts +++ b/packages/cli/src/databases/repositories/test.repository.ts @@ -2,26 +2,26 @@ import type { FindManyOptions, FindOptionsWhere } from '@n8n/typeorm'; import { DataSource, In, Repository } from '@n8n/typeorm'; import { Service } from 'typedi'; -import { TestEntity } from '@/databases/entities/test-entity'; +import { TestDefinition } from '@/databases/entities/test-definition'; import type { ListQuery } from '@/requests'; @Service() -export class TestRepository extends Repository { +export class TestRepository extends Repository { constructor(dataSource: DataSource) { - super(TestEntity, dataSource.manager); + super(TestDefinition, dataSource.manager); } async getMany(sharedWorkflowIds: string[], options?: ListQuery.Options) { if (sharedWorkflowIds.length === 0) return { tests: [], count: 0 }; - const where: FindOptionsWhere = { + const where: FindOptionsWhere = { ...options?.filter, workflow: { id: In(sharedWorkflowIds), }, }; - const findManyOptions: FindManyOptions = { + const findManyOptions: FindManyOptions = { where, relations: ['annotationTag'], order: { createdAt: 'DESC' }, diff --git a/packages/cli/src/evaluation/tests.service.ts b/packages/cli/src/evaluation/tests.service.ts index fc22df983e..9efa18bfa1 100644 --- a/packages/cli/src/evaluation/tests.service.ts +++ b/packages/cli/src/evaluation/tests.service.ts @@ -47,7 +47,7 @@ export class TestsService { return await this.testRepository.getOne(id, accessibleWorkflowIds); } - async save(test: TestEntity) { + async save(test: TestDefinition) { await validateEntity(test); return await this.testRepository.save(test);