-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Overview
Add comprehensive unit tests for all backend API routes and the execution engine.
Test Suites Needed
1. Pipeline CRUD API (/api/pipelines)
POST /api/pipelines— create pipeline with valid/invalid payloadsGET /api/pipelines— list with pagination, empty stateGET /api/pipelines/:id— fetch single, 404 handlingPUT /api/pipelines/:id— update nodes/edges, validate structure- Verify node/edge relationships are persisted correctly
2. Pipeline Execution (/api/pipelines/:id/run)
POST /api/pipelines/:id/run— start execution, verify run record createdGET /api/pipelines/:id/runs— list runs with statusGET /api/runs/:id— single run with step details- Test execution engine: node ordering (topological sort), condition branching
- Test status transitions: pending → running → completed/failed
- Test error handling: missing nodes, circular dependencies, invalid conditions
3. Template API (/api/templates)
GET /api/templates— list seed templatesGET /api/templates/:id— single templatePOST /api/templates/:id/clone— clone to new pipeline, verify deep copy
4. WebSocket Events
- Test event emission on run start/step complete/run complete
- Test client connection/disconnection handling
Setup
- Use Jest or Vitest
- Mock Prisma client for DB isolation
- Add
testscript topackage.json - Target: >80% coverage on API routes