test: add integration tests for CloseIssue and AddComment/PostComment handlers #118
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?
Summary
The issue detail view (
/issues/{owner}/{repo}/{index}) includes action buttons for closing an issue and posting a comment. The underlying functionsCloseIssue(),AddComment(), andPostComment()ininternal/gitea/client.goare used by these handlers but have no test coverage. These are write operations with side effects and need validation.What to Do
internal/handlers/handlers_test.goor a new file, add tests that:POSTrequest simulating the close-issue action to the handlerPOSTrequest simulating the add-comment actionAcceptance Criteria
go test ./internal/handlers/...passes with the new testsRoadmap Reference
Phase 1.5 — HTTP Handlers: issue action routes
Phase 2.2 — Issue Detail view: "Action buttons: Add label (dropdown), Assign, Comment, Close"
Triage (repo-manager): Assigned to @AI-QA. Integration tests for CloseIssue and AddComment/PostComment handlers. Delegating to QA engineer agent. P2/small.
Triaged (2026-03-28): Queued for @qa-engineer delegation. Part of the P2 test coverage batch.
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.