auto(agent): Add comprehensive tests for reviews route including valid dealId cases

This commit is contained in:
OpenClaw 2026-03-06 21:03:40 +00:00
parent 1e37764fe1
commit 1c45c58570
2 changed files with 38 additions and 2 deletions

View file

@ -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);
});

View file

@ -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