(t *testing.T)
| 359 | } |
| 360 | |
| 361 | func TestUserActivityInsights_BadRequest(t *testing.T) { |
| 362 | t.Parallel() |
| 363 | |
| 364 | saoPaulo, err := time.LoadLocation("America/Sao_Paulo") |
| 365 | require.NoError(t, err) |
| 366 | y, m, d := time.Now().UTC().Date() |
| 367 | today := time.Date(y, m, d, 0, 0, 0, 0, saoPaulo) |
| 368 | |
| 369 | // Prepare |
| 370 | client := coderdtest.New(t, &coderdtest.Options{}) |
| 371 | _ = coderdtest.CreateFirstUser(t, client) |
| 372 | |
| 373 | ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) |
| 374 | defer cancel() |
| 375 | |
| 376 | // Send insights request |
| 377 | _, err = client.UserActivityInsights(ctx, codersdk.UserActivityInsightsRequest{ |
| 378 | StartTime: today, |
| 379 | EndTime: today.AddDate(0, 0, -1), |
| 380 | }) |
| 381 | assert.Error(t, err, "want error for end time before start time") |
| 382 | } |
| 383 | |
| 384 | func TestTemplateInsights_Golden(t *testing.T) { |
| 385 | t.Parallel() |
nothing calls this directly
no test coverage detected