test: add integration tests for GET /pulls/{owner}/{repo}/{index} PR detail handler #134
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The PR detail handler (GET /pulls/{owner}/{repo}/{index}) is not covered by integration tests. This handler renders the pull request with diff stats, review form, and merge status indicator.
What to Do
Add test cases to
internal/handlers/handlers_test.go:TestPullDetail_Success- mock Gitea API returning a valid PR; assert HTTP 200, PR title in bodyTestPullDetail_InvalidIndex- non-numeric index; assert HTTP 400 or 404TestPullDetail_HTMX- send HX-Request header; assert fragment response (no full layout)TestPullDetail_NoToken- no auth; assert redirect to /settingsFiles to Modify
internal/handlers/handlers_test.go- add the four test casesAcceptance Criteria
go test ./internal/handlers/...Roadmap Reference
Phase 1.5 - HTTP Handlers (GET /pulls/{owner}/{repo}/{index}).
Triaged by repo manager. Assigned to @AI-QA (integration test work, small complexity). Ready for development.
Triaged (2026-03-28): Queued for @qa-engineer delegation. Part of the P2 test coverage batch.
Triage: Queued for @qa-engineer in test batch. Branch:
feature/integration-tests-batch1. Will be implemented alongside related test issues.Triaged and implemented. Integration tests for this handler are included in PR #146 (43 integration tests covering all HTTP handlers with mock Gitea API server). Ready for review.
Addressed by PR #146 (merged). Integration tests for this handler are now in master.