Skip to content

Commit

Permalink
fix: recruitment-session service Delete test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoBaroso committed Jan 19, 2024
1 parent 8971cf1 commit f95f5db
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions api/src/recruitment-session/recruitment-session.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ describe('Recruitment Session Service', () => {
});

describe('deleteRecruitmentSession', () => {
it('should remove the specified recruitment session from the database', () => {
it('should remove the specified recruitment session from the database', async () => {
jest
.spyOn(mockedRepository, 'remove')
.mockResolvedValue(mockRecruitmentSession);
const result = recruitmentSessionService.deletRecruitmentSession(
// perché non prende "await"
mockRecruitmentSession, // nonostante la funzione nel service sia async ??
const result = await recruitmentSessionService.deletRecruitmentSession(
mockRecruitmentSession,
);
expect(result).toEqual([mockRecruitmentSession]);
expect(mockedRepository.find).toHaveBeenCalledTimes(1);
expect(result).toEqual(mockRecruitmentSession);
expect(mockedRepository.remove).toHaveBeenCalledTimes(1);
});
});
});

0 comments on commit f95f5db

Please sign in to comment.