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:
@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test';
|
||||
test.describe('Search API', () => {
|
||||
test.describe('GET /search — Text search', () => {
|
||||
test('returns search results for a query', async ({ request }) => {
|
||||
const res = await request.get('/search', {
|
||||
const res = await request.get('search', {
|
||||
params: { q: 'apartment' },
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('returns empty results for nonsense query', async ({ request }) => {
|
||||
const res = await request.get('/search', {
|
||||
const res = await request.get('search', {
|
||||
params: { q: 'zzzznotexistingproperty999' },
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('filters by property type', async ({ request }) => {
|
||||
const res = await request.get('/search', {
|
||||
const res = await request.get('search', {
|
||||
params: { propertyType: 'VILLA', q: '' },
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('filters by price range', async ({ request }) => {
|
||||
const res = await request.get('/search', {
|
||||
const res = await request.get('search', {
|
||||
params: { priceMin: 1000000000, priceMax: 10000000000 },
|
||||
});
|
||||
|
||||
@@ -66,7 +66,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('supports sorting', async ({ request }) => {
|
||||
const res = await request.get('/search', {
|
||||
const res = await request.get('search', {
|
||||
params: { sortBy: 'price_asc' },
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('paginates correctly', async ({ request }) => {
|
||||
const res = await request.get('/search', {
|
||||
const res = await request.get('search', {
|
||||
params: { page: 1, perPage: 5 },
|
||||
});
|
||||
|
||||
@@ -96,7 +96,7 @@ test.describe('Search API', () => {
|
||||
|
||||
test.describe('GET /search/geo — Geo search', () => {
|
||||
test('returns results for geo search in Ho Chi Minh City', async ({ request }) => {
|
||||
const res = await request.get('/search/geo', {
|
||||
const res = await request.get('search/geo', {
|
||||
params: { lat: 10.7769, lng: 106.7009, radiusKm: 5 },
|
||||
});
|
||||
|
||||
@@ -112,7 +112,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('rejects missing required geo params', async ({ request }) => {
|
||||
const res = await request.get('/search/geo', {
|
||||
const res = await request.get('search/geo', {
|
||||
params: { lat: 10.7769 },
|
||||
});
|
||||
|
||||
@@ -121,7 +121,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('rejects invalid latitude', async ({ request }) => {
|
||||
const res = await request.get('/search/geo', {
|
||||
const res = await request.get('search/geo', {
|
||||
params: { lat: 999, lng: 106.7009, radiusKm: 5 },
|
||||
});
|
||||
|
||||
@@ -130,7 +130,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('rejects radius exceeding max', async ({ request }) => {
|
||||
const res = await request.get('/search/geo', {
|
||||
const res = await request.get('search/geo', {
|
||||
params: { lat: 10.7769, lng: 106.7009, radiusKm: 200 },
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ test.describe('Search API', () => {
|
||||
});
|
||||
|
||||
test('filters geo results by property type', async ({ request }) => {
|
||||
const res = await request.get('/search/geo', {
|
||||
const res = await request.get('search/geo', {
|
||||
params: {
|
||||
lat: 10.7769,
|
||||
lng: 106.7009,
|
||||
@@ -159,7 +159,7 @@ test.describe('Search API', () => {
|
||||
|
||||
test.describe('POST /search/reindex — Admin reindex', () => {
|
||||
test('rejects unauthenticated reindex request', async ({ request }) => {
|
||||
const res = await request.post('/search/reindex');
|
||||
const res = await request.post('search/reindex');
|
||||
|
||||
expect(res.ok()).toBeFalsy();
|
||||
expect(res.status()).toBe(401);
|
||||
|
||||
Reference in New Issue
Block a user