test: add 43 integration tests for all HTTP handlers #146

Merged
AI-Manager merged 1 commits from feature/integration-tests-batch1 into master 2026-03-28 19:03:44 +00:00
Owner

Summary

  • Add comprehensive integration test suite with mock Gitea API server
  • 43 new tests covering all HTTP handlers (GET and POST, regular and HTMX)
  • TestMain sets working directory to project root for template loading
  • Fixes pre-existing TestDashboard_NoToken failure (template not found)

Issues covered

  • #140: GET / dashboard handler
  • #139: GET /issues and GET /pulls list handlers
  • #138: GET /issues/new and GET /issues/new/labels handlers
  • #137: POST state change handlers for issues and pulls
  • #136: org/repo/label/state filter query params
  • #135: POST assignees handler
  • #134: GET /pulls/{owner}/{repo}/{index} PR detail
  • #133: GET /issues/{owner}/{repo}/{index} issue detail
  • #124: GET /settings and POST /settings handlers
  • #118: CloseIssue and AddComment handlers
  • #113: POST /issues create-issue handler
  • #111: POST /pulls/{owner}/{repo}/{index}/review
  • #110: POST /issues/{owner}/{repo}/{index}/labels

Test plan

  • go test ./internal/handlers/ -run TestIntegration_ -v - all 43 pass
  • go test ./... - all packages pass (including previously-failing TestDashboard_NoToken)
## Summary - Add comprehensive integration test suite with mock Gitea API server - 43 new tests covering all HTTP handlers (GET and POST, regular and HTMX) - TestMain sets working directory to project root for template loading - Fixes pre-existing TestDashboard_NoToken failure (template not found) ### Issues covered - #140: GET / dashboard handler - #139: GET /issues and GET /pulls list handlers - #138: GET /issues/new and GET /issues/new/labels handlers - #137: POST state change handlers for issues and pulls - #136: org/repo/label/state filter query params - #135: POST assignees handler - #134: GET /pulls/{owner}/{repo}/{index} PR detail - #133: GET /issues/{owner}/{repo}/{index} issue detail - #124: GET /settings and POST /settings handlers - #118: CloseIssue and AddComment handlers - #113: POST /issues create-issue handler - #111: POST /pulls/{owner}/{repo}/{index}/review - #110: POST /issues/{owner}/{repo}/{index}/labels ## Test plan - [x] `go test ./internal/handlers/ -run TestIntegration_ -v` - all 43 pass - [x] `go test ./...` - all packages pass (including previously-failing TestDashboard_NoToken)
AI-Manager added 1 commit 2026-03-28 18:13:11 +00:00
Add comprehensive integration test suite using httptest with a mock
Gitea API server. Tests cover GET and POST handlers for dashboard,
issues, pulls, issue/PR detail, create issue, state changes, comments,
labels, assignees, reviews, and settings. Both regular and HTMX
request paths are tested. Includes TestMain to set working directory
to project root for template loading.

Covers issues: #140 #139 #138 #137 #136 #135 #134 #133 #124 #118
#113 #111 #110

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit 8c390e7505 into master 2026-03-28 19:03:44 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#146