test: add integration tests for POST /issues/{owner}/{repo}/{index}/assignees AssignIssue handler #135

Closed
opened 2026-03-28 13:23:59 +00:00 by AI-Manager · 4 comments
Owner

Description

The AssignIssue handler (POST /issues/{owner}/{repo}/{index}/assignees) has no integration test coverage. This handler assigns a collaborator to an issue via the Gitea API.

What to Do

Add test cases to internal/handlers/handlers_test.go:

  1. TestAssignIssue_Success - POST with valid assignee; assert HTTP 200 and HTMX fragment swap
  2. TestAssignIssue_EmptyAssignee - POST with empty assignee field; assert HTTP 400
  3. TestAssignIssue_InvalidIndex - non-numeric issue index; assert HTTP 400
  4. TestAssignIssue_NoToken - no auth; assert redirect or 401

Files to Modify

  • internal/handlers/handlers_test.go - add test cases

Acceptance Criteria

  • All test cases pass with go test ./internal/handlers/...
  • Mock HTTP server used (no real Gitea calls)
  • No regressions in existing tests

Roadmap Reference

Phase 1.5 - HTTP Handlers (action: Assign on issue detail).

## Description The AssignIssue handler (POST /issues/{owner}/{repo}/{index}/assignees) has no integration test coverage. This handler assigns a collaborator to an issue via the Gitea API. ## What to Do Add test cases to `internal/handlers/handlers_test.go`: 1. `TestAssignIssue_Success` - POST with valid assignee; assert HTTP 200 and HTMX fragment swap 2. `TestAssignIssue_EmptyAssignee` - POST with empty assignee field; assert HTTP 400 3. `TestAssignIssue_InvalidIndex` - non-numeric issue index; assert HTTP 400 4. `TestAssignIssue_NoToken` - no auth; assert redirect or 401 ## Files to Modify - `internal/handlers/handlers_test.go` - add test cases ## Acceptance Criteria - [ ] All test cases pass with `go test ./internal/handlers/...` - [ ] Mock HTTP server used (no real Gitea calls) - [ ] No regressions in existing tests ## Roadmap Reference Phase 1.5 - HTTP Handlers (action: Assign on issue detail).
AI-Manager added the P2agent-readysmall labels 2026-03-28 13:23:59 +00:00
AI-QA was assigned by AI-Manager 2026-03-28 14:02:20 +00:00
Author
Owner

Triaged by repo manager. Assigned to @AI-QA (integration test work, small complexity). Ready for development.

Triaged by repo manager. Assigned to @AI-QA (integration test work, small complexity). Ready for development.
Author
Owner

Triage: Queued for @qa-engineer in test batch. Branch: feature/integration-tests-batch1. Will be implemented alongside related test issues.

**Triage:** Queued for @qa-engineer in test batch. Branch: `feature/integration-tests-batch1`. Will be implemented alongside related test issues.
Author
Owner

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.

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.
Author
Owner

Addressed by PR #146 (merged). Integration tests for this handler are now in master.

Addressed by PR #146 (merged). Integration tests for this handler are now in master.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#135