Skip to content

Commit

Permalink
test(Socket): Add test for transport disconnecting when re-calling co…
Browse files Browse the repository at this point in the history
…nnect
  • Loading branch information
KaylaBrady committed Sep 5, 2024
1 parent bc18f92 commit e489d92
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tests/SwiftPhoenixClientTests/SocketSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,17 @@ class SocketSpec: QuickSpec {

expect(mockWebSocket.connectCallsCount).to(equal(1))
})


it("disconnects from old socket before connecting to a new one", closure: {
mockWebSocket.readyState = .connecting

socket.connect()
socket.connect()

expect(mockWebSocket.disconnectCodeReasonCallsCount).to(equal(1))
expect(mockWebSocket.connectCallsCount).to(equal(2))
})
}


Expand Down

0 comments on commit e489d92

Please sign in to comment.