Skip to content

Commit 48ab575

Browse files
committed
test(auth): test client init
1 parent 13430ee commit 48ab575

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Tests/AuthTests/AuthClientTests.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ final class AuthClientTests: XCTestCase {
5757
storage = nil
5858
}
5959

60+
func testAuthClientInitialization() {
61+
let client = makeSUT()
62+
63+
assertInlineSnapshot(of: client.configuration.headers, as: .customDump) {
64+
"""
65+
[
66+
"X-Client-Info": "auth-swift/0.0.0",
67+
"X-Supabase-Api-Version": "2024-01-01",
68+
"apikey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0"
69+
]
70+
"""
71+
}
72+
73+
XCTAssertEqual(client.clientID, 1)
74+
75+
let client2 = makeSUT()
76+
XCTAssertEqual(client2.clientID, 2)
77+
}
78+
6079
func testOnAuthStateChanges() async throws {
6180
let session = Session.validSession
6281
let sut = makeSUT()

Tests/SupabaseTests/SupabaseClientTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ final class SupabaseClientTests: XCTestCase {
7878
]
7979
"""
8080
}
81-
expectNoDifference(client.headers, client.auth.configuration.headers)
8281
expectNoDifference(client.headers, client.functions.headers.dictionary)
8382
expectNoDifference(client.headers, client.storage.configuration.headers)
8483
expectNoDifference(client.headers, client.rest.configuration.headers)

0 commit comments

Comments
 (0)