Summary
Add comprehensive unit and integration tests for the document_list (#658) and document_retrieve (#659) agent tools.
Test Coverage
document_list tool
- Happy paths: list all documents, filter by folder, filter by extension, filter by date range, combined filters
- Sorting: sort by createdAt desc (default), sort by name asc
- Pagination: limit parameter, hasMore flag, totalCount accuracy
- Access control: only returns documents matching user's organizationId and teamTags
- Edge cases: empty results, no matching filters, limit=0, invalid date format
document_retrieve tool
- Happy paths: retrieve full document content, retrieve with pageRange
- Pagination: pageRange="1-5", pageRange="20-30", single page pageRange="5-5"
- Truncation: document exceeding ~50K chars returns truncated=true
- Access control: rejects requests for documents outside user's organization/team
- Error cases: non-existent documentId (404), document without RAG info, invalid pageRange format
- Integration with RAG service: mock RAG endpoint, verify correct parameters passed
Dependencies
Acceptance Criteria
Summary
Add comprehensive unit and integration tests for the
document_list(#658) anddocument_retrieve(#659) agent tools.Test Coverage
document_list tool
document_retrieve tool
Dependencies
document_listtool)document_retrievetool)Acceptance Criteria
services/platform/convex/workflow_engine/test files)