many fixes resulting from latest refactoring
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 5m56s

This commit is contained in:
2025-12-09 12:14:38 -08:00
parent ca570b6c03
commit 365bd7cce0
5 changed files with 23 additions and 11 deletions

View File

@@ -246,6 +246,10 @@ describe('Admin Content Management Routes (/api/admin)', () => {
});
it('PUT /comments/:id/status should return 400 for an invalid status', async () => {
// Mock the database call to prevent it from executing. The route should validate
// the status and return 400 before the DB is ever touched.
vi.mocked(mockedDb.adminRepo.updateRecipeCommentStatus).mockResolvedValue({} as any);
const response = await supertest(app).put('/api/admin/comments/301').send({ status: 'invalid-status' });
expect(response.status).toBe(400);
expect(response.body.message).toContain('A valid status');