Skip to content

Commit 25f354d

Browse files
committed
test: add code rabbit suggestion
1 parent a1c4811 commit 25f354d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/api/src/subjects/__tests__/subjects.service.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ describe('SubjectsService', () => {
9595
expect(prismaClient.subject.deleteMany).toHaveBeenCalled();
9696
expect(prismaClient.$transaction).toHaveBeenCalledOnce();
9797
});
98+
it('should throw NotFoundException when subject does not exist', async () => {
99+
subjectModel.findFirst.mockResolvedValueOnce(null);
100+
await expect(subjectsService.deleteById('123')).rejects.toBeInstanceOf(NotFoundException);
101+
});
98102
});
99103

100104
describe('findById', () => {

0 commit comments

Comments
 (0)