Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sachdevavaibhav committed Mar 8, 2025
1 parent f2dd336 commit bd21e6a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/dataController/__test__/projects.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('ProjectsController', () => {
status: 'Archived' as IArchiveProjects['status'],
userId: 456,
}
const mockProjectInfo = [{projectName: 'MyProject'}] // Mock response from getProjectInfo
const mockProjectInfo = [{projectName: 'MyProject', status: 'Active'}] // Mock response from getProjectInfo
const mockResponse = {affectedRows: 1} // Mock response from updateProjectStatus

// Mock getProjectInfo and updateProjectStatus
Expand Down Expand Up @@ -195,8 +195,9 @@ describe('ProjectsController', () => {
await expect(
ProjectsController.updateProjectStatus(mockParams),
).rejects.toEqual({
projectId: 123,
reason: 'Project not found',
data: null,
message: 'Project not found',
status: 404,
})

expect(ProjectsDao.getProjectInfo).toHaveBeenCalledWith(123)
Expand Down Expand Up @@ -246,7 +247,7 @@ describe('ProjectsController', () => {
status: 'Archived' as IArchiveProjects['status'],
userId: 456,
}
const mockProjectInfo = [{projectName: 'MyProject'}]
const mockProjectInfo = [{projectName: 'MyProject', status: 'Active'}]
const mockError = new Error('Database error')

;(ProjectsDao.getProjectInfo as jest.Mock).mockResolvedValue(
Expand Down

0 comments on commit bd21e6a

Please # to comment.