Skip to content

Commit

Permalink
test: update test with new params
Browse files Browse the repository at this point in the history
  • Loading branch information
Manumartin95 committed Sep 18, 2023
1 parent 421c82a commit 6b18aa7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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] })
})
})

Expand Down

0 comments on commit 6b18aa7

Please sign in to comment.