(t *testing.T, url, bearer string)
| 7 | ) |
| 8 | |
| 9 | func getJSON(t *testing.T, url, bearer string) (int, map[string]any) { |
| 10 | t.Helper() |
| 11 | req, _ := http.NewRequest("GET", url, nil) |
| 12 | if bearer != "" { |
| 13 | req.Header.Set("Authorization", "Bearer "+bearer) |
| 14 | } |
| 15 | resp, err := http.DefaultClient.Do(req) |
| 16 | if err != nil { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | defer resp.Body.Close() |
| 20 | var body map[string]any |
| 21 | _ = json.NewDecoder(resp.Body).Decode(&body) |
| 22 | return resp.StatusCode, body |
| 23 | } |
| 24 | |
| 25 | func TestListMessagesPageEnvelopeAndCursor(t *testing.T) { |
| 26 | srv := testServer(t) |
no test coverage detected