cli/pkg/cmd/discussion/client
Babak K. Shandiz e263abfb2c
test(discussion/client): improve GetCommentReplies test coverage
Inline all JSON response helpers (getCommentRepliesResp, wrapRepliesBlock,
bareCommentNode, replyNode) to avoid cross-test coupling. Fix JSON response
shape to place "node" as sibling of "repository" under "data", matching the
real GraphQL query structure. Populate "maps all fields" with non-zero
values and use a single assert.Equal for the full Discussion struct.

Match real API error responses: discussions disabled returns NOT_FOUND on
discussion, node not found returns NOT_FOUND with null node, wrong-type
node returns empty object. Add missing test cases for repo not found and
first page newest reversal.

Move shared wantComments/wantTotal/wantCursor/wantNext/wantDirection fields
into assertDisc callbacks for both TestGetWithComments and
TestGetCommentReplies, giving each case full ownership of its assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-28 10:38:19 +01:00
..
client.go feat(discussion/client): add GetCommentReplies with paginated reply fetching 2026-04-27 10:57:45 +01:00
client_impl.go feat(discussion/client): add GetCommentReplies with paginated reply fetching 2026-04-27 10:57:45 +01:00
client_impl_test.go test(discussion/client): improve GetCommentReplies test coverage 2026-04-28 10:38:19 +01:00
client_mock.go feat(discussion/client): add GetCommentReplies with paginated reply fetching 2026-04-27 10:57:45 +01:00
types.go feat(discussion/client): add GetCommentReplies with paginated reply fetching 2026-04-27 10:57:45 +01:00