(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestReactionsService_ListIssueReactions(t *testing.T) { |
| 145 | t.Parallel() |
| 146 | client, mux, _ := setup(t) |
| 147 | |
| 148 | mux.HandleFunc("/repos/o/r/issues/1/reactions", func(w http.ResponseWriter, r *http.Request) { |
| 149 | testMethod(t, r, "GET") |
| 150 | testHeader(t, r, "Accept", mediaTypeReactionsPreview) |
| 151 | testFormValues(t, r, values{"content": "+1"}) |
| 152 | |
| 153 | w.WriteHeader(http.StatusOK) |
| 154 | assertWrite(t, w, []byte(`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]`)) |
| 155 | }) |
| 156 | |
| 157 | opt := &ListReactionOptions{Content: "+1"} |
| 158 | ctx := t.Context() |
| 159 | got, _, err := client.Reactions.ListIssueReactions(ctx, "o", "r", 1, opt) |
| 160 | if err != nil { |
| 161 | t.Errorf("ListIssueReactions returned error: %v", err) |
| 162 | } |
| 163 | want := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr("l"), ID: Ptr(int64(2))}, Content: Ptr("+1")}} |
| 164 | if !cmp.Equal(got, want) { |
| 165 | t.Errorf("ListIssueReactions = %+v, want %+v", got, want) |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | func TestReactionsService_ListIssueReactions_coverage(t *testing.T) { |
| 170 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…