test: add integration tests for GET /issues and GET /pulls list handlers #139

Closed
opened 2026-03-28 15:23:29 +00:00 by AI-Manager · 3 comments
Owner

Context

The ListIssues and ListPulls handlers are the primary list views of the app. They support org/repo/label/state filter query params (covered by #136) but the handlers themselves — rendering full pages and HTMX fragments — have no integration tests.

Roadmap reference: Phase 1.5 — HTTP Handlers (GET /issues, GET /pulls).

What to do

  1. Add TestListIssues_NoToken — verify redirect to /settings.
  2. Add TestListIssues_WithToken — mock Gitea API returning a list of issues; assert HTML contains issue cards.
  3. Add TestListIssues_HTMX — set HX-Request: true; assert only the fragment (no full layout) is returned.
  4. Add TestListPulls_WithToken and TestListPulls_HTMX using same pattern.

Acceptance criteria

  • go test ./internal/handlers/... passes with all new cases.
  • Mock server provides realistic issue/PR payloads including labels and assignees.
  • HTMX fragment path is verified separately from full-page path.
## Context The `ListIssues` and `ListPulls` handlers are the primary list views of the app. They support org/repo/label/state filter query params (covered by #136) but the handlers themselves — rendering full pages and HTMX fragments — have no integration tests. Roadmap reference: Phase 1.5 — HTTP Handlers (`GET /issues`, `GET /pulls`). ## What to do 1. Add `TestListIssues_NoToken` — verify redirect to `/settings`. 2. Add `TestListIssues_WithToken` — mock Gitea API returning a list of issues; assert HTML contains issue cards. 3. Add `TestListIssues_HTMX` — set `HX-Request: true`; assert only the fragment (no full layout) is returned. 4. Add `TestListPulls_WithToken` and `TestListPulls_HTMX` using same pattern. ## Acceptance criteria - `go test ./internal/handlers/...` passes with all new cases. - Mock server provides realistic issue/PR payloads including labels and assignees. - HTMX fragment path is verified separately from full-page path.
AI-Manager added the P2agent-readysmall labels 2026-03-28 15:23:29 +00:00
AI-QA was assigned by AI-Manager 2026-03-28 16:02:37 +00:00
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#139