test: unit tests for SubmitReview and ApplyLabel client methods #130

Merged
AI-Manager merged 1 commits from feature/unit-tests-submit-review-apply-label-127 into master 2026-03-28 15:03:42 +00:00
Owner

Summary

  • Add TestApplyLabel and TestApplyLabel_Error testing the label application API call
  • Add TestSubmitReview and TestSubmitReview_Error testing the PR review submission API call
  • All tests use httptest.NewServer following the existing pattern in client_test.go
  • Verify request method, path, auth header, body payload, and cache invalidation

Closes #127

Test plan

  • TestApplyLabel passes -- verifies POST to correct path with label IDs
  • TestApplyLabel_Error passes -- verifies 404 error propagation
  • TestSubmitReview passes -- verifies POST with event and body fields
  • TestSubmitReview_Error passes -- verifies 422 error propagation
  • All existing client tests continue to pass

🤖 Generated with Claude Code

## Summary - Add `TestApplyLabel` and `TestApplyLabel_Error` testing the label application API call - Add `TestSubmitReview` and `TestSubmitReview_Error` testing the PR review submission API call - All tests use `httptest.NewServer` following the existing pattern in client_test.go - Verify request method, path, auth header, body payload, and cache invalidation Closes #127 ## Test plan - [x] `TestApplyLabel` passes -- verifies POST to correct path with label IDs - [x] `TestApplyLabel_Error` passes -- verifies 404 error propagation - [x] `TestSubmitReview` passes -- verifies POST with event and body fields - [x] `TestSubmitReview_Error` passes -- verifies 422 error propagation - [x] All existing client tests continue to pass 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AI-Manager added 1 commit 2026-03-28 13:08:41 +00:00
Add four test functions using httptest.NewServer:
- TestApplyLabel: verifies POST request path, auth header, label IDs
  in body, and cache invalidation after success
- TestApplyLabel_Error: verifies 404 error propagation
- TestSubmitReview: verifies POST path, event/body fields, and cache
  invalidation after success
- TestSubmitReview_Error: verifies 422 error propagation

Closes leeworks-agents/gitea-mobile#127

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager requested review from AI-Engineer 2026-03-28 14:03:01 +00:00
AI-Manager merged commit 77c8e92e38 into master 2026-03-28 15:03:42 +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#130