test: add integration tests for markdown comment rendering in issue and PR detail views (after #238) #242
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 #238 implements markdown rendering for comment bodies in issue and PR detail views by adding a
RenderedBody template.HTMLfield and callingRenderMarkdownfor each comment in theIssueDetailandPullDetailhandlers.Currently
integration_test.gotestsIssueDetailandPullDetail(seeTestIntegration_IssueDetail_ValidIndexandTestIntegration_PullDetail_ValidIndex) but neither test asserts that comment bodies are rendered as HTML — they only check status codes and basic content.What to do
In
internal/handlers/integration_test.go, extend or add tests for:TestIntegration_IssueDetail_CommentMarkdown— issue detail with a comment containing markdown (e.g.**bold**): assert response contains<strong>bold</strong>(or similar rendered HTML), not the raw**bold**.TestIntegration_PullDetail_CommentMarkdown— same pattern for PR detail.TestIntegration_IssueDetail_CommentMarkdown_RenderFail— mockRenderMarkdownto return an error; assert plain text fallback is rendered without a 500.Update the mock client in
integration_test.goto stubRenderMarkdownreturning<strong>bold</strong>for input**bold**.Acceptance Criteria
RenderMarkdownin issue detailRenderMarkdownin PR detailRenderMarkdownerror (no 500)go test -race ./...passesDependencies
Roadmap Reference
ROADMAP Phase 2.2 — Issue Detail and PR Detail: "Comments thread" with rendered markdown