Skip to content

Commit 0c391f0

Browse files
committed
Improve tests
1 parent e02d444 commit 0c391f0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Tests/DropboxClientTests/ListFolderTests.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@ final class ListFolderTests: XCTestCase {
4141
)
4242
}
4343
)
44-
45-
let result = try await listFolder(
44+
let params = ListFolder.Params(
4645
path: "test-path",
4746
recursive: true,
4847
includeDeleted: true,
4948
limit: 1234,
5049
includeNonDownloadableFiles: false
5150
)
5251

52+
let result = try await listFolder(params)
53+
5354
await httpRequests.withValue {
5455
let expectedRequest: URLRequest = {
5556
let url = URL(string: "https://api.dropboxapi.com/2/files/list_folder")!
@@ -59,10 +60,12 @@ final class ListFolderTests: XCTestCase {
5960
"Authorization": "\(credentials.tokenType) \(credentials.accessToken)",
6061
"Content-Type": "application/json"
6162
]
63+
request.httpBody = try! JSONEncoder.api.encode(params)
6264
return request
6365
}()
6466

6567
XCTAssertEqual($0, [expectedRequest])
68+
XCTAssertEqual($0.first?.httpBody, expectedRequest.httpBody!)
6669
}
6770
XCTAssertEqual(result, ListFolder.Result(
6871
cursor: "c1234",

0 commit comments

Comments
 (0)