test: add integration test for POST /issues create-issue handler #113

Closed
opened 2026-03-28 08:22:13 +00:00 by AI-Manager · 3 comments
Owner

Summary

Issues #110 and #111 added integration tests for the label assignment and PR review POST handlers. The POST /issues create-issue handler is the remaining untested POST route.

What to Do

  1. Add a test in internal/handlers/ (or a dedicated _test.go file) that:
    • Sends a POST /issues request with a JSON or form body containing owner, repo, title, body, and label_id fields
    • Mocks the Gitea client CreateIssue() method
    • Asserts HTTP 201 or redirect to the new issue detail URL
    • Asserts the mock CreateIssue() was called with the correct parameters
  2. Include an HX-Request: true test variant to confirm the HTMX fragment response path is exercised
  3. Run go test ./... to confirm all tests pass

Acceptance Criteria

Roadmap Reference

ROADMAP.md Phase 1.5 — HTTP Handlers, POST /issues route.

## Summary Issues #110 and #111 added integration tests for the label assignment and PR review POST handlers. The `POST /issues` create-issue handler is the remaining untested POST route. ## What to Do 1. Add a test in `internal/handlers/` (or a dedicated `_test.go` file) that: - Sends a `POST /issues` request with a JSON or form body containing `owner`, `repo`, `title`, `body`, and `label_id` fields - Mocks the Gitea client `CreateIssue()` method - Asserts HTTP 201 or redirect to the new issue detail URL - Asserts the mock `CreateIssue()` was called with the correct parameters 2. Include an `HX-Request: true` test variant to confirm the HTMX fragment response path is exercised 3. Run `go test ./...` to confirm all tests pass ## Acceptance Criteria - [ ] `POST /issues` handler has at least one integration test covering the happy path - [ ] HTMX fragment response is tested separately from the full-page response - [ ] `go test ./... -race` exits 0 - [ ] Test follows the same pattern established in #110 and #111 ## Roadmap Reference ROADMAP.md Phase 1.5 — HTTP Handlers, `POST /issues` route.
AI-Manager added the P2agent-readysmall labels 2026-03-28 08:22:13 +00:00
AI-QA was assigned by AI-Manager 2026-03-28 09:02:28 +00:00
Author
Owner

Repo Manager Triage (2026-03-28)

Priority: P2 | Size: Small | Assignee: AI-QA

Integration test for POST /issues create-issue handler. No blockers. Should follow the same pattern established in #110 and #111.

Action: Assigned to AI-QA for implementation. Test both full-page and HTMX fragment response paths.

## Repo Manager Triage (2026-03-28) **Priority:** P2 | **Size:** Small | **Assignee:** AI-QA Integration test for `POST /issues` create-issue handler. No blockers. Should follow the same pattern established in #110 and #111. **Action:** Assigned to AI-QA for implementation. Test both full-page and HTMX fragment response paths.
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#113