11import CustomDump
22import Foundation
3+ import InlineSnapshotTesting
34@testable import Storage
45import XCTest
56import XCTestDynamicOverlay
@@ -17,7 +18,7 @@ final class SupabaseStorageTests: XCTestCase {
1718 upload: unimplemented ( " StorageHTTPSession.upload " )
1819 )
1920
20- func testGetPublicURL( ) async throws {
21+ func testGetPublicURL( ) throws {
2122 let sut = makeSUT ( )
2223
2324 let path = " README.md "
@@ -29,27 +30,30 @@ final class SupabaseStorageTests: XCTestCase {
2930 path: path,
3031 download: true
3132 )
32- XCTAssertEqual (
33- baseUrlWithDownload. absoluteString,
34- " \( supabaseURL) /object/public/ \( bucketId) / \( path) ?download= "
35- )
33+ assertInlineSnapshot ( of: baseUrlWithDownload, as: . description) {
34+ """
35+ http://localhost:54321/storage/v1/object/public/tests/README.md?download=
36+ """
37+ }
3638
3739 let baseUrlWithDownloadAndFileName = try sut. from ( bucketId) . getPublicURL (
3840 path: path, download: " test "
3941 )
40- XCTAssertEqual (
41- baseUrlWithDownloadAndFileName. absoluteString,
42- " \( supabaseURL) /object/public/ \( bucketId) / \( path) ?download=test "
43- )
42+ assertInlineSnapshot ( of: baseUrlWithDownloadAndFileName, as: . description) {
43+ """
44+ http://localhost:54321/storage/v1/object/public/tests/README.md?download=test
45+ """
46+ }
4447
4548 let baseUrlWithAllOptions = try sut. from ( bucketId) . getPublicURL (
4649 path: path, download: " test " ,
4750 options: TransformOptions ( width: 300 , height: 300 )
4851 )
49- XCTAssertEqual (
50- baseUrlWithAllOptions. absoluteString,
51- " \( supabaseURL) /render/image/public/ \( bucketId) / \( path) ?download=test&width=300&height=300&quality=80 "
52- )
52+ assertInlineSnapshot ( of: baseUrlWithAllOptions, as: . description) {
53+ """
54+ http://localhost:54321/storage/v1/render/image/public/tests/README.md?download=test&width=300&height=300&quality=80
55+ """
56+ }
5357 }
5458
5559 func testCreateSignedURLs( ) async throws {
@@ -80,13 +84,11 @@ final class SupabaseStorageTests: XCTestCase {
8084 expiresIn: 60
8185 )
8286
83- expectNoDifference (
84- urls. map ( \. absoluteString) ,
85- [
86- " \( supabaseURL. absoluteString) /sign/file1.txt?token=abc.def.ghi " ,
87- " \( supabaseURL. absoluteString) /sign/file2.txt?token=abc.def.ghi " ,
88- ]
89- )
87+ assertInlineSnapshot ( of: urls, as: . description) {
88+ """
89+ [http://localhost:54321/storage/v1/sign/file1.txt?token=abc.def.ghi, http://localhost:54321/storage/v1/sign/file2.txt?token=abc.def.ghi]
90+ """
91+ }
9092 }
9193
9294 private func makeSUT( ) -> SupabaseStorageClient {
0 commit comments