(t *testing.T)
| 347 | } |
| 348 | |
| 349 | func TestAPILogsList(t *testing.T) { |
| 350 | mux := http.NewServeMux() |
| 351 | seedTestData(t, mux) |
| 352 | |
| 353 | req := httptest.NewRequest("GET", "/api/sentry/logs", nil) |
| 354 | w := httptest.NewRecorder() |
| 355 | mux.ServeHTTP(w, req) |
| 356 | |
| 357 | if w.Code != 200 { |
| 358 | t.Fatalf("status = %d, want 200", w.Code) |
| 359 | } |
| 360 | |
| 361 | var resp map[string]any |
| 362 | json.Unmarshal(w.Body.Bytes(), &resp) |
| 363 | |
| 364 | data := resp["data"].([]any) |
| 365 | if len(data) != 3 { |
| 366 | t.Fatalf("data length = %d, want 3", len(data)) |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | func TestAPILogsFilterByTraceID(t *testing.T) { |
| 371 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected