test: add integration tests for GET /issues/{owner}/{repo}/{index} issue detail handler #133
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 issue detail handler (GET /issues/{owner}/{repo}/{index}) in
internal/handlers/handlers.gois not covered by integration tests. This handler fetches a single issue and renders it with comments, label/assign/close actions.What to Do
Add test cases to
internal/handlers/handlers_test.go:TestIssueDetail_Success- mock Gitea API returning a valid issue; assert HTTP 200, title present in response bodyTestIssueDetail_InvalidIndex- pass a non-numeric index; assert HTTP 400 or 404TestIssueDetail_HTMX- send HX-Request header; assert response is an HTML fragment (no full layout)TestIssueDetail_NoToken- no auth token in request; assert redirect to /settingsFiles to Modify
internal/handlers/handlers_test.go- add the four test cases aboveAcceptance Criteria
go test ./internal/handlers/...Roadmap Reference
Phase 1.5 - HTTP Handlers (GET /issues/{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.