MCPcopy Index your code
hub / github.com/google/go-github / TestReactionsService_ListIssueCommentReactions

Function TestReactionsService_ListIssueCommentReactions

github/reactions_test.go:227–250  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

225}
226
227func 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
252func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) {
253 t.Parallel()

Callers

nothing calls this directly

Calls 8

testMethodFunction · 0.85
testHeaderFunction · 0.85
testFormValuesFunction · 0.85
assertWriteFunction · 0.85
EqualMethod · 0.80
setupFunction · 0.70
PtrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…