(t *testing.T)
| 225 | } |
| 226 | |
| 227 | func TestReactionsService_ListIssueCommentReactions(t *testing.T) { |
| 228 | t.Parallel() |
| 229 | client, mux, _ := setup(t) |
| 230 | |
| 231 | mux.HandleFunc("/repos/o/r/issues/comments/1/reactions", func(w http.ResponseWriter, r *http.Request) { |
| 232 | testMethod(t, r, "GET") |
| 233 | testHeader(t, r, "Accept", mediaTypeReactionsPreview) |
| 234 | testFormValues(t, r, values{"content": "+1"}) |
| 235 | |
| 236 | w.WriteHeader(http.StatusOK) |
| 237 | assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) |
| 238 | }) |
| 239 | |
| 240 | opt := &ListReactionOptions{Content: "+1"} |
| 241 | ctx := t.Context() |
| 242 | got, _, err := client.Reactions.ListIssueCommentReactions(ctx, "o", "r", 1, opt) |
| 243 | if err != nil { |
| 244 | t.Errorf("ListIssueCommentReactions returned error: %v", err) |
| 245 | } |
| 246 | want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} |
| 247 | if !cmp.Equal(got, want) { |
| 248 | t.Errorf("ListIssueCommentReactions = %+v, want %+v", got, want) |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) { |
| 253 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…