diff --git a/internal/handlers/integration_test.go b/internal/handlers/integration_test.go index b5dcd3e..eb1d067 100644 --- a/internal/handlers/integration_test.go +++ b/internal/handlers/integration_test.go @@ -489,6 +489,78 @@ func TestIntegration_PullDetail_InvalidIndex(t *testing.T) { } } +// --- Issue #217: HTMX fragment assertions for IssueDetail and PullDetail --- + +func TestIntegration_IssueDetail_HTMX(t *testing.T) { + h, srv := newTestHandlerWithMock(t) + defer srv.Close() + + mux := http.NewServeMux() + mux.HandleFunc("GET /issues/{owner}/{repo}/{index}", h.IssueDetail) + + req := reqWithToken(http.MethodGet, "/issues/test-org/repo1/1", "") + req.Header.Set("HX-Request", "true") + w := httptest.NewRecorder() + + mux.ServeHTTP(w, req) + + if w.Code != http.StatusOK { + t.Errorf("status = %d, want %d", w.Code, http.StatusOK) + } + body := w.Body.String() + + // HTMX response must NOT contain layout boilerplate. + if contains(body, "