(t *testing.T)
| 265 | } |
| 266 | |
| 267 | func TestTrack_CustomPropertiesCannotOverrideBase(t *testing.T) { |
| 268 | fake := &fakeAnalyticsClient{} |
| 269 | client := &AnalyticsTelemetryClient{client: fake} |
| 270 | |
| 271 | metadata := NewEventMetadata() |
| 272 | ctx := WithEventMetadata(context.Background(), metadata) |
| 273 | |
| 274 | require.NoError(t, client.Track(ctx, "Command Invoked", map[string]any{ |
| 275 | "invocation_id": "spoofed", |
| 276 | "sequence": int64(999), |
| 277 | })) |
| 278 | require.Len(t, fake.messages, 1) |
| 279 | |
| 280 | track, ok := fake.messages[0].(analytics.Track) |
| 281 | require.True(t, ok) |
| 282 | assert.Equal(t, metadata.InvocationID, track.Properties["invocation_id"]) |
| 283 | assert.Equal(t, int64(1), track.Properties["sequence"]) |
| 284 | } |
nothing calls this directly
no test coverage detected