From 6b18aa70743136f865715c1cce3e2626e5a4cf4b Mon Sep 17 00:00:00 2001 From: Manumartin95 Date: Mon, 18 Sep 2023 12:11:55 +0200 Subject: [PATCH] test: update test with new params --- .../project/application/get-projects-list-qry.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/features/administration/features/project/application/get-projects-list-qry.test.ts b/src/features/administration/features/project/application/get-projects-list-qry.test.ts index ad2716ac..dcaac761 100644 --- a/src/features/administration/features/project/application/get-projects-list-qry.test.ts +++ b/src/features/administration/features/project/application/get-projects-list-qry.test.ts @@ -3,18 +3,24 @@ import { mock } from 'jest-mock-extended' import { ProjectRepository } from '../domain/project-repository' import { ProjectsWithUserName } from '../domain/services/projects-with-user-name' import { GetProjectsListQry } from './get-projects-list-qry' +import { ProjectMother } from '../domain/tests/project-mother' describe('GetProjectsListQry', () => { it('should get the project list', async () => { - const { getProjectsListQry, projectRepository } = setup() + const { getProjectsListQry, projectRepository, getUsersListQry } = setup() const organizationWithStatus = { organizationId: 1, open: true } + projectRepository.getProjects.mockResolvedValue( + ProjectMother.projectsFilteredByOrganizationDateIso() + ) + await getProjectsListQry.internalExecute(organizationWithStatus) expect(projectRepository.getProjects).toBeCalledWith(organizationWithStatus) + expect(getUsersListQry.execute).toHaveBeenCalledWith({ ids: [2, 1] }) }) })