test(integration): add comprehensive comment query API tests
Add 11 integration test scenarios covering full stack (600 lines):
Core functionality:
- TestCommentQuery_BasicFetch: Verify basic comment retrieval with stats
- TestCommentQuery_NestedReplies: Validate recursive threading structure
- TestCommentQuery_DepthLimit: Test depth boundaries (0, 3, 10, 100)
- TestCommentQuery_EmptyThread: Handle posts with no comments gracefully
- TestCommentQuery_DeletedComments: Soft-deleted comments excluded
Sorting algorithms:
- TestCommentQuery_HotSorting: Verify Lemmy hot rank formula
- Recent medium score beats old high score
- Negative scores handled (bounded at log(2))
- TestCommentQuery_TopSorting: Score-based with timeframe filters
- TestCommentQuery_NewSorting: Chronological ordering
Pagination:
- TestCommentQuery_Pagination: Cursor stability with 60 comments
- No duplicates between pages
- All comments eventually retrieved
Input validation:
- TestCommentQuery_InvalidInputs: 6 subtests for error cases
- Invalid URI, negative depth, bounds clamping
- Invalid sort/timeframe parameters
HTTP layer:
- TestCommentQuery_HTTPHandler: End-to-end request handling
- Valid requests with query params
- Missing/invalid parameter errors
Test helpers:
- setupCommentService: Initialize service with mocked dependencies
- createTestCommentWithScore: Create comments with specific stats
- Service adapter for HTTP testing
All tests passing ✅
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>