File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -516,6 +516,29 @@ func TestDefaultOrg(t *testing.T) {
516
516
require .True (t , all [0 ].IsDefault , "first org should always be default" )
517
517
}
518
518
519
+ func TestAuditLogDefaultLimit (t * testing.T ) {
520
+ t .Parallel ()
521
+ if testing .Short () {
522
+ t .SkipNow ()
523
+ }
524
+
525
+ sqlDB := testSQLDB (t )
526
+ err := migrations .Up (sqlDB )
527
+ require .NoError (t , err )
528
+ db := database .New (sqlDB )
529
+
530
+ for i := 0 ; i < 110 ; i ++ {
531
+ dbgen .AuditLog (t , db , database.AuditLog {})
532
+ }
533
+
534
+ ctx := testutil .Context (t , testutil .WaitShort )
535
+ rows , err := db .GetAuditLogsOffset (ctx , database.GetAuditLogsOffsetParams {})
536
+ require .NoError (t , err )
537
+ // The length should match the default limit of the SQL query.
538
+ // Updating the sql query requires changing the number below to match.
539
+ require .Len (t , rows , 100 )
540
+ }
541
+
519
542
// TestReadCustomRoles tests the input params returns the correct set of roles.
520
543
func TestReadCustomRoles (t * testing.T ) {
521
544
t .Parallel ()
You can’t perform that action at this time.
0 commit comments