MCPcopy Index your code
hub / github.com/coder/coder / TestUserLatencyInsights_BadRequest

Function TestUserLatencyInsights_BadRequest

coderd/insights_test.go:342–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

340}
341
342func TestUserLatencyInsights_BadRequest(t *testing.T) {
343 t.Parallel()
344
345 client := coderdtest.New(t, &coderdtest.Options{})
346 _ = coderdtest.CreateFirstUser(t, client)
347
348 y, m, d := time.Now().UTC().Date()
349 today := time.Date(y, m, d, 0, 0, 0, 0, time.UTC)
350
351 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
352 defer cancel()
353
354 _, err := client.UserLatencyInsights(ctx, codersdk.UserLatencyInsightsRequest{
355 StartTime: today,
356 EndTime: today.AddDate(0, 0, -1),
357 })
358 assert.Error(t, err, "want error for end time before start time")
359}
360
361func TestUserActivityInsights_BadRequest(t *testing.T) {
362 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
CreateFirstUserFunction · 0.92
UserLatencyInsightsMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected