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:
@@ -17,13 +17,13 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('GET /admin/moderation — Moderation queue', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.get('/admin/moderation');
|
||||
const res = await request.get('admin/moderation');
|
||||
|
||||
expect(res.status()).toBe(401);
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.get('/admin/moderation', {
|
||||
const res = await request.get('admin/moderation', {
|
||||
headers: { Authorization: `Bearer ${regularToken}` },
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('POST /admin/moderation/approve — Approve listing', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.post('/admin/moderation/approve', {
|
||||
const res = await request.post('admin/moderation/approve', {
|
||||
data: { listingId: 'test-id' },
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.post('/admin/moderation/approve', {
|
||||
const res = await request.post('admin/moderation/approve', {
|
||||
data: { listingId: 'test-id' },
|
||||
headers: { Authorization: `Bearer ${regularToken}` },
|
||||
});
|
||||
@@ -52,7 +52,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('POST /admin/moderation/reject — Reject listing', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.post('/admin/moderation/reject', {
|
||||
const res = await request.post('admin/moderation/reject', {
|
||||
data: { listingId: 'test-id', reason: 'E2E test rejection reason' },
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.post('/admin/moderation/reject', {
|
||||
const res = await request.post('admin/moderation/reject', {
|
||||
data: { listingId: 'test-id', reason: 'E2E test rejection reason' },
|
||||
headers: { Authorization: `Bearer ${regularToken}` },
|
||||
});
|
||||
@@ -71,7 +71,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('POST /admin/users/ban — Ban user', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.post('/admin/users/ban', {
|
||||
const res = await request.post('admin/users/ban', {
|
||||
data: { userId: 'test-id', reason: 'E2E test ban reason text' },
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.post('/admin/users/ban', {
|
||||
const res = await request.post('admin/users/ban', {
|
||||
data: { userId: 'test-id', reason: 'E2E test ban reason text' },
|
||||
headers: { Authorization: `Bearer ${regularToken}` },
|
||||
});
|
||||
@@ -90,7 +90,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('POST /admin/subscriptions/adjust — Adjust subscription', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.post('/admin/subscriptions/adjust', {
|
||||
const res = await request.post('admin/subscriptions/adjust', {
|
||||
data: {
|
||||
userId: 'test-id',
|
||||
newPlanTier: 'AGENT_PRO',
|
||||
@@ -102,7 +102,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.post('/admin/subscriptions/adjust', {
|
||||
const res = await request.post('admin/subscriptions/adjust', {
|
||||
data: {
|
||||
userId: 'test-id',
|
||||
newPlanTier: 'AGENT_PRO',
|
||||
@@ -117,13 +117,13 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('GET /admin/dashboard — Dashboard stats', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.get('/admin/dashboard');
|
||||
const res = await request.get('admin/dashboard');
|
||||
|
||||
expect(res.status()).toBe(401);
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.get('/admin/dashboard', {
|
||||
const res = await request.get('admin/dashboard', {
|
||||
headers: { Authorization: `Bearer ${regularToken}` },
|
||||
});
|
||||
|
||||
@@ -133,7 +133,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
|
||||
test.describe('GET /admin/revenue — Revenue stats', () => {
|
||||
test('rejects unauthenticated request', async ({ request }) => {
|
||||
const res = await request.get('/admin/revenue', {
|
||||
const res = await request.get('admin/revenue', {
|
||||
params: { startDate: '2026-01-01', endDate: '2026-12-31' },
|
||||
});
|
||||
|
||||
@@ -141,7 +141,7 @@ test.describe('Admin API — Authorization', () => {
|
||||
});
|
||||
|
||||
test('rejects non-admin user', async ({ request }) => {
|
||||
const res = await request.get('/admin/revenue', {
|
||||
const res = await request.get('admin/revenue', {
|
||||
params: { startDate: '2026-01-01', endDate: '2026-12-31' },
|
||||
headers: { Authorization: `Bearer ${regularToken}` },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user