test: add unit and integration tests for POST /pulls merge handler (after #177) #186
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?
Context
Issue #229 tracks implementing the
POST /pulls/{owner}/{repo}/{index}/mergehandler. Once implemented, this issue covers adding tests to confirm the full merge flow works correctly.What to do
TestMergePRtointernal/gitea/client_test.gousing the mock HTTP server pattern, covering:TestIntegration_MergePRtointernal/handlers/integration_test.go:POST /pulls/{owner}/{repo}/{index}/mergereturns HTMX fragment with updated statego test -race ./...to confirm no data races in the merge path.Acceptance Criteria
TestMergePRandTestMergePR_AlreadyMergedpassTestIntegration_MergePRandTestIntegration_MergePR_NoTokenpassgo test -race ./...passes with no race conditionsDependencies
References
SubmitReview()wrapper pattern (same pattern for merge)[Repo Manager Triage] Assigned to @AI-QA. This is a testing issue that depends on #187 and #188 being completed first. Scope: unit tests for MergePull client method and integration tests for the merge handler endpoint.
Sprint planning note: This issue depends on #229 (implement POST /pulls merge HTTP handler). Do not start until #229 is merged. Downgrading to P2 since the handler implementation (#229, P1) must land first.