Skip to content

Commit

Permalink
fix: fix in update organization test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCodeGhinux committed Jul 24, 2024
1 parent ce49a61 commit 3d23b3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/organisations/tests/organisations.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('OrganisationsService', () => {
.spyOn(organisationRepository, 'findOneBy')
.mockResolvedValueOnce({ ...organisation, ...updateOrganisationDto });

const result = await service.update(id, updateOrganisationDto);
const result = await service.updateOrganisation(id, updateOrganisationDto);

expect(result).toEqual({
message: 'Organisation successfully updated',
Expand All @@ -115,7 +115,7 @@ describe('OrganisationsService', () => {

jest.spyOn(organisationRepository, 'findOneBy').mockResolvedValueOnce(null);

await expect(service.update(id, updateOrganisationDto)).rejects.toThrow(NotFoundException);
await expect(service.updateOrganisation(id, updateOrganisationDto)).rejects.toThrow(NotFoundException);
});

it('should throw InternalServerErrorException if an unexpected error occurs', async () => {
Expand All @@ -124,7 +124,7 @@ describe('OrganisationsService', () => {

jest.spyOn(organisationRepository, 'findOneBy').mockRejectedValueOnce(new Error('Unexpected error'));

await expect(service.update(id, updateOrganisationDto)).rejects.toThrow(InternalServerErrorException);
await expect(service.updateOrganisation(id, updateOrganisationDto)).rejects.toThrow(InternalServerErrorException);
});
});
});

0 comments on commit 3d23b3a

Please sign in to comment.