| 212 | } |
| 213 | |
| 214 | func TestStructuredEvent(t *testing.T) { |
| 215 | t.Parallel() |
| 216 | logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) |
| 217 | // Use debug mode to avoid HTTP calls in tests |
| 218 | client := newClient(t.Context(), logger, true, true, "test-version") |
| 219 | |
| 220 | event := CommandEvent{ |
| 221 | Action: "test-command", |
| 222 | Success: true, |
| 223 | } |
| 224 | |
| 225 | // Should not panic |
| 226 | client.Track(t.Context(), &event) |
| 227 | } |
| 228 | |
| 229 | func TestGetTelemetryEnabled(t *testing.T) { |
| 230 | // When running under 'go test', GetTelemetryEnabled() always returns false |