Skip to content

Commit fc406ea

Browse files
committed
add tests
1 parent 88780b6 commit fc406ea

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Tests/RealtimeTests/RealtimeTests.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ final class RealtimeTests: XCTestCase {
3636
headers: ["apikey": apiKey],
3737
heartbeatInterval: 1,
3838
reconnectDelay: 1,
39-
timeoutInterval: 2
39+
timeoutInterval: 2,
40+
accessToken: {
41+
"custom.access.token"
42+
}
4043
),
4144
ws: ws,
4245
http: http
@@ -100,7 +103,7 @@ final class RealtimeTests: XCTestCase {
100103
"event" : "phx_join",
101104
"join_ref" : "1",
102105
"payload" : {
103-
"access_token" : "anon.api.key",
106+
"access_token" : "custom.access.token",
104107
"config" : {
105108
"broadcast" : {
106109
"ack" : false,
@@ -179,7 +182,7 @@ final class RealtimeTests: XCTestCase {
179182
"event" : "phx_join",
180183
"join_ref" : "1",
181184
"payload" : {
182-
"access_token" : "anon.api.key",
185+
"access_token" : "custom.access.token",
183186
"config" : {
184187
"broadcast" : {
185188
"ack" : false,
@@ -201,7 +204,7 @@ final class RealtimeTests: XCTestCase {
201204
"event" : "phx_join",
202205
"join_ref" : "2",
203206
"payload" : {
204-
"access_token" : "anon.api.key",
207+
"access_token" : "custom.access.token",
205208
"config" : {
206209
"broadcast" : {
207210
"ack" : false,
@@ -322,7 +325,7 @@ final class RealtimeTests: XCTestCase {
322325
assertInlineSnapshot(of: request?.urlRequest, as: .raw(pretty: true)) {
323326
"""
324327
POST https://localhost:54321/realtime/v1/api/broadcast
325-
Authorization: Bearer anon.api.key
328+
Authorization: Bearer custom.access.token
326329
Content-Type: application/json
327330
apiKey: anon.api.key
328331

0 commit comments

Comments
 (0)