42 lines
1.4 KiB
Plaintext
42 lines
1.4 KiB
Plaintext
# Task 5: GET /api/watchlist Test Results
|
|
|
|
## Test Date: 2026-02-26
|
|
|
|
## Server Status
|
|
- Server running on port 3000: ✓
|
|
- Health check: ✓ PASS
|
|
|
|
## Authentication Test
|
|
- Unauthenticated request to /api/watchlist:
|
|
- HTTP Status: 403
|
|
- Response: {"detail":"Not authenticated"}
|
|
|
|
- Authenticated request to /api/watchlist:
|
|
- HTTP Status: 200
|
|
- Response: {"watchlist":[],"total":0,"filters":{"status":null}}
|
|
|
|
## Endpoints Tested
|
|
|
|
| Endpoint | Auth | Expected Status | Actual Status | Result |
|
|
|----------|------|-----------------|---------------|--------|
|
|
| GET /api/watchlist | No | 401/403 | 403 | ✓ PASS |
|
|
| GET /api/watchlist | Yes | 200 | 200 | ✓ PASS |
|
|
| GET /api/watchlist/stats | Yes | 200 | 404 | ✗ FAIL (BUG) |
|
|
| GET /api/watchlist/settings | Yes | 200 | 404 | ✗ FAIL (BUG) |
|
|
| GET /api/watchlist/notifications | Yes | 200 | 404 | ✗ FAIL (BUG) |
|
|
|
|
## Issue Found
|
|
|
|
The following endpoints return 404 "Watchlist item not found" when they should work:
|
|
- /api/watchlist/stats
|
|
- /api/watchlist/settings
|
|
- /api/watchlist/notifications
|
|
|
|
**Root Cause**: Route ordering issue in `app/routes/watchlist.py`
|
|
- The `/{item_id}` catch-all route (line 134) is defined BEFORE the specific routes like `/stats` (line 372), `/settings` (line 335), and `/notifications` (line 285)
|
|
- FastAPI matches these paths as item IDs instead of the intended routes
|
|
|
|
## Test User
|
|
- Username: watchlist_test
|
|
- Token: JWT (7-day expiry)
|