test: add integration tests for POST /pulls assign and label routes (after #216) #218
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Issue #216 adds assign and label action forms to the PR detail template. Issue #228 registers the
POST /pulls/{owner}/{repo}/{index}/assigneesroute. Once both are merged, these routes need integration test coverage.Currently
integration_test.gocoversTestIntegration_AssignIssue_*andTestIntegration_ApplyLabels_*for the issue routes but there are no equivalent tests for the PR variants.What to do
Add to
internal/handlers/integration_test.go:TestIntegration_AssignPull_Valid—POST /pulls/test-org/repo1/1/assigneeswith a valid assignee:TestIntegration_AssignPull_HTMX— same withHX-Request: true:<htmltag)TestIntegration_ApplyLabelsPull_Valid—POST /pulls/test-org/repo1/1/labelswith a label_id:TestIntegration_ApplyLabelsPull_HTMX— same withHX-Request: true:Acceptance Criteria
reqWithToken+httptest.NewRecorder()patterngo test -race ./...Dependencies
References
internal/handlers/integration_test.go— existingTestIntegration_AssignIssue_*patternSprint planning: Adding
blockedlabel — this issue depends on #216 (add assign/label forms to PR detail view). Tests can only be written once the feature is implemented.