Add Playwright tests for contacts API and cleanup duplicate config files

This commit is contained in:
OpenClaw 2026-03-06 20:57:20 +00:00
parent 1e91647618
commit 5d5b2460b5
4 changed files with 52 additions and 29 deletions

View file

@ -128,4 +128,26 @@ test('POST /contacts/respond should validate requestId and accept (zod)', async
});
assert.strictEqual(response.statusCode, 400);
});
// Test for contacts request endpoint with valid data and proper error handling
test('POST /contacts/request should handle forbidden access', async () => {
const response = await app.inject({
method: 'POST',
url: '/contacts/request',
payload: { dealId: 1, targetUserId: 2 }
});
assert.strictEqual(response.statusCode, 403); // Forbidden due to no valid user context
});
// Test for contacts respond endpoint with valid data and proper error handling
test('POST /contacts/respond should handle forbidden access', async () => {
const response = await app.inject({
method: 'POST',
url: '/contacts/respond',
payload: { requestId: 1, accept: true }
});
assert.strictEqual(response.statusCode, 403); // Forbidden due to no valid user context
});