test(e2e): update all E2E specs for latest API and fixtures

Update 17 E2E test files including admin, auth, inquiries, listings,
payments, search, subscriptions, and MCP specs. Update listings fixture
and global setup to align with latest schema changes.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-11 01:40:45 +07:00
parent 9914d02439
commit da10ac64c6
18 changed files with 132 additions and 119 deletions

View File

@@ -5,7 +5,7 @@ test.describe('POST /auth/register', () => {
test('registers a new user and returns token pair', async ({ request }) => {
const user = createTestUser();
const res = await request.post('/auth/register', { data: user });
const res = await request.post('auth/register', { data: user });
expect(res.status()).toBe(201);
const body = await res.json();
@@ -19,17 +19,17 @@ test.describe('POST /auth/register', () => {
const user = createTestUser();
// First registration should succeed
const first = await request.post('/auth/register', { data: user });
const first = await request.post('auth/register', { data: user });
expect(first.ok()).toBeTruthy();
// Second registration with same phone should fail
const second = await request.post('/auth/register', { data: user });
const second = await request.post('auth/register', { data: user });
expect(second.ok()).toBeFalsy();
expect(second.status()).toBeGreaterThanOrEqual(400);
});
test('rejects registration with missing required fields', async ({ request }) => {
const res = await request.post('/auth/register', {
const res = await request.post('auth/register', {
data: { phone: '0912345678' },
});
@@ -38,7 +38,7 @@ test.describe('POST /auth/register', () => {
});
test('rejects registration with short password', async ({ request }) => {
const res = await request.post('/auth/register', {
const res = await request.post('auth/register', {
data: {
phone: '0912345678',
password: 'short',