Swift Testing (#748)

* Swift Testing: `PrivateChatE2ETests` + minor refactor

* Swift Testing: `PublicChatE2ETests`

* Swift Testing: `FragmentationTests`

* Fix MockBLEService init to accept PeerID and remove _testRegister call

* Add peerID property to MockBLEService and fix ttlDecrement test

* Remove duplicate peerID property and fix type comparisons

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
Islam
2025-10-06 20:55:52 +02:00
committed by GitHub
co-authored by jack
parent 81c90b2924
commit eb13eec4c5
13 changed files with 631 additions and 655 deletions
+15
View File
@@ -349,3 +349,18 @@ final class MockBLEService: NSObject {
// Backward compatibility for older tests
typealias MockSimplifiedBluetoothService = MockBLEService
// MARK: - Helpers
extension MockBLEService {
convenience init(peerID: PeerID, nickname: String) {
self.init()
myPeerID = peerID.id
mockNickname = nickname
}
func simulateConnection(with otherPeer: MockBLEService) {
simulateConnectedPeer(otherPeer.myPeerID)
otherPeer.simulateConnectedPeer(myPeerID)
}
}