Show reactions to threads

This commit is contained in:
2026-07-28 12:02:33 +02:00
parent f93c2c517a
commit 72e1eb1fda
6 changed files with 175 additions and 4 deletions

View File

@@ -338,7 +338,12 @@ func TestGetPullRequestUsesOriginalLineAndMetadata(t *testing.T) {
"id":"c","body":"change this","diffHunk":"@@ -1 +1 @@","createdAt":"2026-01-01T00:00:00Z",
"url":"cu","author":{"login":"reviewer"},"outdated":true,
"line":100,"startLine":99,"originalLine":42,"originalStartLine":40,
"originalCommit":{"oid":"0123456789abcdef"}
"originalCommit":{"oid":"0123456789abcdef"},
"reactionGroups":[
{"content":"THUMBS_UP","viewerHasReacted":true,"reactors":{"totalCount":3}},
{"content":"EYES","viewerHasReacted":false,"reactors":{"totalCount":1}},
{"content":"HEART","viewerHasReacted":false,"reactors":{"totalCount":0}}
]
}]}
}]}
}}}}`))
@@ -375,6 +380,11 @@ func TestGetPullRequestUsesOriginalLineAndMetadata(t *testing.T) {
comment.OriginalCommitOID != "0123456789abcdef" || !comment.Outdated {
t.Fatalf("unexpected comment snapshot: %#v", comment)
}
if len(comment.Reactions) != 2 ||
comment.Reactions[0] != (ReactionSummary{Content: "THUMBS_UP", Count: 3, ViewerHasReacted: true}) ||
comment.Reactions[1] != (ReactionSummary{Content: "EYES", Count: 1}) {
t.Fatalf("unexpected comment reactions: %#v", comment.Reactions)
}
}
func TestGetPullRequestLoadsConflictFilesForConflictingPR(t *testing.T) {