Add more tests vibe coding ftw (#1699)
* Initial plan
* Add test files for missing API endpoints
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Fix import ordering in test files
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Add test cases with different payloads for each endpoint
- Add TCP monitor tests for run and trigger endpoints
- Add multiple region tests for run and trigger endpoints
- Add different status tests for status report updates
- Add result validation tests for monitor results endpoint
- Total: 8 new test cases across 4 test files
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Add 11 test cases with different payloads to post_tcp.test.ts
- Test different ports (80, 443, 8080)
- Test different frequencies (30s, 1m, 5m, 10m, 30m, 1h)
- Test with/without optional fields (timeout, retry, degradedAfter, description)
- Test OpenTelemetry configuration
- Test multiple regions
- Test public/private monitors
- Test active/inactive monitors
- Test invalid host and port
- Test deprecated regions
- Total: 14 test cases (was 3, added 11)
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Add test cases with different payloads to post_http and statusReportUpdates
HTTP Monitor Tests (post_http.test.ts):
- Different HTTP methods: GET, PUT, PATCH, DELETE
- Different frequencies: 30s, 1h
- Different assertion types: textBody, multiple assertions
- Configuration variants: timeout, retry, degradedAfter
- OpenTelemetry configuration with custom headers
- Minimal payload (only required fields)
- Invalid URL and deprecated regions validation
Total: 16 test cases (was 3, added 13)
Status Report Update Tests (post.test.ts):
- All status types: investigating, identified, monitoring, resolved
- With/without explicit date (testing defaults)
- Past dates and long messages
- Different status report IDs
- Invalid payloads: invalid status, missing message, missing statusReportId, empty message
Total: 14 test cases (was 3, added 11)
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Fix date manipulation in statusReportUpdates test
Use explicit time subtraction instead of setDate for clearer 24-hour subtraction
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Fix empty message validation in StatusReportUpdate schema (#1703)
* Initial plan
* Fix validation issues in statusReportUpdates schema and deprecated endpoint
- Add .min(1) validation to message field to reject empty messages
- Fix deprecated endpoint schema to omit statusReportId from request body
- Fix deprecated endpoint to return correct StatusReport schema
- Fix test to use correct workspace for cross-workspace access check
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* Remove redundant database update in deprecated endpoint
- Consolidate status and updatedAt updates into single query
- Remove duplicate update operation that was updating the same fields
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
* ci: apply automated fixes
* fix test
* ci: apply automated fixes
* fixing test
* fix test
* ci: apply automated fixes
* add more test
* ci: apply automated fixes
* todo test
* ci: apply automated fixes
* todo test
* ci: apply automated fixes
* todo test
* ci: apply automated fixes
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thibaultleouay <13894054+thibaultleouay@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Thibault Le Ouay Ducasse <thibaultleouay@gmail.com>
authored by