Skip to content

Commit 1cb0c20

Browse files
committed
fix pagination
1 parent e6d415a commit 1cb0c20

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

coderd/audit_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ func TestAuditLogs(t *testing.T) {
165165
require.NoError(t, err)
166166

167167
// Fetching audit logs without an organization selector should fail
168-
_, err = orgAdmin.AuditLogs(ctx, codersdk.AuditLogsRequest{})
168+
_, err = orgAdmin.AuditLogs(ctx, codersdk.AuditLogsRequest{
169+
Pagination: codersdk.Pagination{
170+
Limit: 5,
171+
},
172+
})
169173
var sdkError *codersdk.Error
170174
require.Error(t, err)
171175
require.ErrorAsf(t, err, &sdkError, "error should be of type *codersdk.Error")
@@ -174,6 +178,9 @@ func TestAuditLogs(t *testing.T) {
174178
// Using the organization selector allows the org admin to fetch audit logs
175179
alogs, err := orgAdmin.AuditLogs(ctx, codersdk.AuditLogsRequest{
176180
SearchQuery: fmt.Sprintf("organization_id:%s", owner.OrganizationID.String()),
181+
Pagination: codersdk.Pagination{
182+
Limit: 5,
183+
},
177184
})
178185
require.NoError(t, err)
179186
require.Len(t, alogs.AuditLogs, 1)

0 commit comments

Comments
 (0)