Skip to content

Commit 9476714

Browse files
committed
improve integration tests
1 parent f733ca7 commit 9476714

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Sources/Auth/Types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ public struct PageParams {
823823
/// Number of items returned per page.
824824
public let perPage: Int?
825825

826-
public init(page: Int?, perPage: Int?) {
826+
public init(page: Int? = nil, perPage: Int? = nil) {
827827
self.page = page
828828
self.perPage = perPage
829829
}

Tests/IntegrationTests/AuthClientIntegrationTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,10 @@ final class AuthClientIntegrationTests: XCTestCase {
253253

254254
func testListUsers() async throws {
255255
let client = Self.makeClient(serviceRole: true)
256-
let pagination = try await client.admin.listUsers()
257-
XCTAssertFalse(pagination.users.isEmpty)
256+
let pagination = try await client.admin.listUsers(params: PageParams(perPage: 10))
257+
XCTAssertEqual(pagination.users.count, 10)
258258
XCTAssertEqual(pagination.aud, "authenticated")
259+
XCTAssertEqual(pagination.nextPage, 2)
259260
}
260261

261262
@discardableResult

0 commit comments

Comments
 (0)