unit test fixes + error refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m41s

This commit is contained in:
2025-12-11 21:17:48 -08:00
parent 5d7598eadf
commit d3d637ebfe
12 changed files with 59 additions and 41 deletions

View File

@@ -214,7 +214,7 @@ describe('Admin DB Service', () => {
it('should throw an error if the comment is not found (rowCount is 0)', async () => {
mockPoolInstance.query.mockResolvedValue({ rowCount: 0, rows: [] });
await expect(adminRepo.updateRecipeCommentStatus(999, 'hidden')).rejects.toThrow('Failed to update recipe comment status.');
await expect(adminRepo.updateRecipeCommentStatus(999, 'hidden')).rejects.toThrow('Recipe comment with ID 999 not found.');
});
it('should throw a generic error if the database query fails', async () => {