diff --git a/backend/src/__tests__/reviews.test.js b/backend/src/__tests__/reviews.test.js index b57a8bc..067fd9c 100644 --- a/backend/src/__tests__/reviews.test.js +++ b/backend/src/__tests__/reviews.test.js @@ -187,4 +187,40 @@ test('POST /reviews should return 400 for missing rating', async () => { }); assert.strictEqual(response.statusCode, 400); +}); + +// Additional test for valid dealId (number) +test('POST /reviews should accept valid numeric dealId', async () => { + const newReview = { + dealId: 1, + revieweeId: 2, + rating: 5, + comment: 'Great product' + }; + + const response = await app.inject({ + method: 'POST', + url: '/reviews/1', + payload: newReview + }); + + assert.strictEqual(response.statusCode, 201); +}); + +// Additional test for valid dealId (string number) +test('POST /reviews should accept valid string numeric dealId', async () => { + const newReview = { + dealId: '1', + revieweeId: 2, + rating: 5, + comment: 'Great product' + }; + + const response = await app.inject({ + method: 'POST', + url: '/reviews/1', + payload: newReview + }); + + assert.strictEqual(response.statusCode, 201); }); \ No newline at end of file diff --git a/docs/runtime/pick_next_task_state.env b/docs/runtime/pick_next_task_state.env index dd1702b..152af69 100644 --- a/docs/runtime/pick_next_task_state.env +++ b/docs/runtime/pick_next_task_state.env @@ -1,2 +1,2 @@ -LAST_ROUTE=profile.js -UPDATED_AT=2026-03-06T21:01:14Z +LAST_ROUTE=reviews.js +UPDATED_AT=2026-03-06T21:03:06Z