cli/pkg/cmd/discussion
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 test(discussion/client): improve GetCommentReplies test coverage 2026-04-28 10:38:19 +01:00
list fix(discussion list): include search keywords in web mode 2026-04-14 15:07:32 +01:00
shared feat(discussion view): add cursor-based pagination to comments 2026-04-24 23:50:04 +01:00
view test(discussion view): add tests for view command client methods and --replies mode 2026-04-27 15:42:36 -05:00
discussion.go Add discussion view command 2026-04-24 21:24:25 +01:00