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

@ -0,0 +1,28 @@
import { test, expect } from '@playwright/test';
test.describe('Contacts API', () => {
test('should get contacts (unauthenticated)', async ({ request }) => {
const response = await request.get('/contacts');
// Should return 401 for unauthorized access
expect(response.status()).toBe(401);
});
test('should validate contact data on creation', async ({ request }) => {
const invalidContact = {
name: '',
email: 'invalid-email',
phone: ''
};
const response = await request.post('/contacts', {
headers: {
'Content-Type': 'application/json'
},
data: invalidContact
});
// Should return 400 for invalid data
expect(response.status()).toBe(400);
});
});