Skip to content

Commit

Permalink
Added helper localMembers count assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Feb 22, 2024
1 parent 861920f commit f6e7449
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Test/Tests/RealtimeClientPresenceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,8 @@ class RealtimeClientPresenceTests: XCTestCase {

// RTP17i (already attached case)

XCTAssertEqual(channel.internal.presenceMap.localMembers.count, 2, "p1")

let attachedMessage = ARTProtocolMessage()
attachedMessage.action = .attached
attachedMessage.channel = channel.name
Expand All @@ -2954,11 +2956,15 @@ class RealtimeClientPresenceTests: XCTestCase {
sentPresenceMessages = newTransport.protocolMessagesSent.filter({ $0.action == .presence }).compactMap { $0.presence?.first }
expect(sentPresenceMessages).to(haveCount(2)) // still 2, no presense messages sent

XCTAssertEqual(channel.internal.presenceMap.localMembers.count, 2, "p2")

attachedMessage.flags = 1 // has presense flag, no resume flag

newTransport.receive(attachedMessage)
sentPresenceMessages = newTransport.protocolMessagesSent.filter({ $0.action == .presence }).compactMap { $0.presence?.first }
expect(sentPresenceMessages).to(haveCount(4)) // 2 more presense messages sent

XCTAssertEqual(channel.internal.presenceMap.localMembers.count, 2, "p3")
}

func skipped__test__083__Presence__private_and_internal_PresenceMap_containing_only_members_that_match_the_current_connectionId__events_applied_to_presence_map__should_be_applied_to_any_LEAVE_event_with_a_connectionId_that_matches_the_current_client_s_connectionId_and_is_not_a_synthesized() throws {
Expand Down

0 comments on commit f6e7449

Please sign in to comment.