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:
@@ -10,7 +10,7 @@ test.describe('Payments API', () => {
|
||||
|
||||
test.describe('POST /payments — Create payment', () => {
|
||||
test('creates a VNPay payment and returns payment URL', async ({ request }) => {
|
||||
const res = await request.post('/payments', {
|
||||
const res = await request.post('payments', {
|
||||
data: {
|
||||
provider: 'VNPAY',
|
||||
type: 'LISTING_FEE',
|
||||
@@ -34,7 +34,7 @@ test.describe('Payments API', () => {
|
||||
});
|
||||
|
||||
test('rejects payment with missing required fields', async ({ request }) => {
|
||||
const res = await request.post('/payments', {
|
||||
const res = await request.post('payments', {
|
||||
data: { provider: 'VNPAY' },
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
@@ -44,7 +44,7 @@ test.describe('Payments API', () => {
|
||||
});
|
||||
|
||||
test('rejects payment with invalid provider', async ({ request }) => {
|
||||
const res = await request.post('/payments', {
|
||||
const res = await request.post('payments', {
|
||||
data: {
|
||||
provider: 'INVALID_PROVIDER',
|
||||
type: 'LISTING_FEE',
|
||||
@@ -60,7 +60,7 @@ test.describe('Payments API', () => {
|
||||
});
|
||||
|
||||
test('rejects payment with invalid type', async ({ request }) => {
|
||||
const res = await request.post('/payments', {
|
||||
const res = await request.post('payments', {
|
||||
data: {
|
||||
provider: 'VNPAY',
|
||||
type: 'INVALID_TYPE',
|
||||
@@ -76,7 +76,7 @@ test.describe('Payments API', () => {
|
||||
});
|
||||
|
||||
test('rejects unauthenticated payment creation', async ({ request }) => {
|
||||
const res = await request.post('/payments', {
|
||||
const res = await request.post('payments', {
|
||||
data: {
|
||||
provider: 'VNPAY',
|
||||
type: 'LISTING_FEE',
|
||||
@@ -92,7 +92,7 @@ test.describe('Payments API', () => {
|
||||
|
||||
test.describe('GET /payments — List transactions', () => {
|
||||
test('returns paginated transaction list for authenticated user', async ({ request }) => {
|
||||
const res = await request.get('/payments', {
|
||||
const res = await request.get('payments', {
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
@@ -103,7 +103,7 @@ test.describe('Payments API', () => {
|
||||
});
|
||||
|
||||
test('supports pagination params', async ({ request }) => {
|
||||
const res = await request.get('/payments', {
|
||||
const res = await request.get('payments', {
|
||||
params: { limit: 5, offset: 0 },
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
@@ -114,7 +114,7 @@ test.describe('Payments API', () => {
|
||||
});
|
||||
|
||||
test('rejects unauthenticated transaction list', async ({ request }) => {
|
||||
const res = await request.get('/payments');
|
||||
const res = await request.get('payments');
|
||||
|
||||
expect(res.status()).toBe(401);
|
||||
});
|
||||
@@ -122,13 +122,13 @@ test.describe('Payments API', () => {
|
||||
|
||||
test.describe('GET /payments/:id — Get payment status', () => {
|
||||
test('returns 401 for unauthenticated request', async ({ request }) => {
|
||||
const res = await request.get('/payments/some-payment-id');
|
||||
const res = await request.get('payments/some-payment-id');
|
||||
|
||||
expect(res.status()).toBe(401);
|
||||
});
|
||||
|
||||
test('returns 404 for non-existent payment', async ({ request }) => {
|
||||
const res = await request.get('/payments/non-existent-payment-id', {
|
||||
const res = await request.get('payments/non-existent-payment-id', {
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ test.describe('Payments API', () => {
|
||||
|
||||
test.describe('POST /payments/:id/refund — Refund (admin only)', () => {
|
||||
test('rejects refund from non-admin user', async ({ request }) => {
|
||||
const res = await request.post('/payments/some-id/refund', {
|
||||
const res = await request.post('payments/some-id/refund', {
|
||||
data: { reason: 'Test refund from non-admin' },
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user