Skip to content

Commit

Permalink
Realtime sends PRESENT among ENTER every other time and it fails test…
Browse files Browse the repository at this point in the history
… because decodeNumberOfCalls == 2 in such case.
  • Loading branch information
maratal committed Apr 30, 2024
1 parent f169e1b commit 85de5f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Test/Tests/RealtimeClientPresenceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3904,15 +3904,15 @@ class RealtimeClientPresenceTests: XCTestCase {

let expectedData = ["test": 1]

var encodeNumberOfCalls = 0
var encodeWasCalled = false
let hookEncode = channel.internal.dataEncoder.testSuite_injectIntoMethod(after: #selector(ARTDataEncoder.encode(_:))) {
encodeNumberOfCalls += 1
encodeWasCalled = true
}
defer { hookEncode.remove() }

var decodeNumberOfCalls = 0
var decodeWasCalled = false
let hookDecode = channel.internal.dataEncoder.testSuite_injectIntoMethod(after: #selector(ARTDataEncoder.decode(_:encoding:))) {
decodeNumberOfCalls += 1
decodeWasCalled = true
}
defer { hookDecode.remove() }

Expand Down Expand Up @@ -3940,8 +3940,8 @@ class RealtimeClientPresenceTests: XCTestCase {
}
}

XCTAssertEqual(encodeNumberOfCalls, 1)
XCTAssertEqual(decodeNumberOfCalls, 1)
XCTAssertTrue(encodeWasCalled)
XCTAssertTrue(decodeWasCalled)
}

// RTP14d
Expand Down

0 comments on commit 85de5f5

Please sign in to comment.