|
| 1 | +# Query Route Test Cases |
| 2 | + |
| 3 | +This file documents the test cases for the /query endpoint. These are not executable tests, but serve as a checklist for future test harness development. |
| 4 | + |
| 5 | +## Expected Behaviors |
| 6 | + |
| 7 | +### 1. POST /query with body {} |
| 8 | +- Should return 200 |
| 9 | +- Response: empty result set (e.g., []) |
| 10 | + |
| 11 | +### 2. POST /query with body [] |
| 12 | +- Should return 400 |
| 13 | +- Response: error message indicating invalid query shape |
| 14 | + |
| 15 | +### 3. POST /query with body null |
| 16 | +- Should return 400 |
| 17 | +- Response: error message indicating invalid query |
| 18 | + |
| 19 | +### 4. POST /query with body "" |
| 20 | +- Should return 400 |
| 21 | +- Response: error message indicating invalid query |
| 22 | + |
| 23 | +### 5. POST /query with body 0 |
| 24 | +- Should return 400 |
| 25 | +- Response: error message indicating invalid query |
| 26 | + |
| 27 | +### 6. POST /query with body true |
| 28 | +- Should return 400 |
| 29 | +- Response: error message indicating invalid query |
| 30 | + |
| 31 | +### 7. POST /query with valid query object |
| 32 | +- Should return 200 |
| 33 | +- Response: result set matching query |
| 34 | + |
| 35 | +### 8. POST /query with malformed JSON (e.g., {broken json) |
| 36 | +- Should return 400 or 500 |
| 37 | +- Response: error message, no stack trace |
| 38 | + |
| 39 | +### 9. POST /query with missing limit/skip |
| 40 | +- Should default to limit=10, skip=0 |
| 41 | +- Should return 200 |
| 42 | + |
| 43 | +### 10. POST /query with negative limit/skip |
| 44 | +- Should return 400 |
| 45 | +- Response: error message indicating invalid parameters |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +Add new cases as needed. This file is for planning and tracking test coverage for /query route. |
0 commit comments