| 2569 | } |
| 2570 | |
| 2571 | func TestAuditLogDefaultLimit(t *testing.T) { |
| 2572 | t.Parallel() |
| 2573 | if testing.Short() { |
| 2574 | t.SkipNow() |
| 2575 | } |
| 2576 | |
| 2577 | sqlDB := testSQLDB(t) |
| 2578 | err := migrations.Up(sqlDB) |
| 2579 | require.NoError(t, err) |
| 2580 | db := database.New(sqlDB) |
| 2581 | |
| 2582 | for i := 0; i < 110; i++ { |
| 2583 | dbgen.AuditLog(t, db, database.AuditLog{}) |
| 2584 | } |
| 2585 | |
| 2586 | ctx := testutil.Context(t, testutil.WaitShort) |
| 2587 | rows, err := db.GetAuditLogsOffset(ctx, database.GetAuditLogsOffsetParams{}) |
| 2588 | require.NoError(t, err) |
| 2589 | // The length should match the default limit of the SQL query. |
| 2590 | // Updating the sql query requires changing the number below to match. |
| 2591 | require.Len(t, rows, 100) |
| 2592 | } |
| 2593 | |
| 2594 | func TestAuditLogCount(t *testing.T) { |
| 2595 | t.Parallel() |