Skip to content

Commit d6ae11c

Browse files
committed
fix
1 parent 6ceac72 commit d6ae11c

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

frontend/e2e/messaging.spec.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import { test, expect } from './fixtures/auth.js';
22

3-
test('User can open a product page', async ({ loggedInPage, request }) => {
4-
// Fetch a real product id to avoid clicking random nav links
5-
const res = await request.get('http://localhost:8000/api/products/?page=1&size=1');
6-
const data = await res.json();
7-
const firstProductId = data?.products?.[0]?.id;
8-
if (!firstProductId) throw new Error('No products returned from API');
3+
// TODO: Add messaging-specific E2E tests here
4+
// Example tests:
5+
// - User can send a message to a product seller
6+
// - User can receive and read messages
7+
// - User can view conversation history
8+
// - User can delete messages/conversations
99

10-
await loggedInPage.goto(`/products/${firstProductId}`);
11-
12-
// Assert product detail page loaded
13-
await expect(loggedInPage).toHaveURL(new RegExp(`/products/${firstProductId}`));
14-
await expect(loggedInPage.getByRole('heading', { level: 1 })).toBeVisible();
15-
});

frontend/e2e/products.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test.describe('Product Creation', () => {
7171
await expect(loggedInPage.getByText('This is a test bicycle in excellent condition')).toBeVisible();
7272
});
7373

74-
test('User can create a product with optional fields', async ({ loggedInPage }) => {
74+
test('User can create a product with condition field', async ({ loggedInPage }) => {
7575
// Navigate to create product page
7676
await loggedInPage.goto('/create-product');
7777
await loggedInPage.waitForLoadState('networkidle');
@@ -83,9 +83,8 @@ test.describe('Product Creation', () => {
8383
await loggedInPage.fill('input[name="price_amount"]', '2500');
8484
await loggedInPage.selectOption('select[name="category_id"]', { index: 1 });
8585

86-
// Fill in optional fields
86+
// Fill in optional condition field (this is visible without toggling advanced options)
8787
await loggedInPage.selectOption('select[name="condition"]', 'like_new');
88-
await loggedInPage.fill('input[name="quantity"]', '2');
8988

9089
// Submit the form
9190
await loggedInPage.click('button[type="submit"]');

0 commit comments

Comments
 (0)