mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:25:20 +00:00
Don’t auto-register mock BLE services on creation (#746)
This commit is contained in:
@@ -41,6 +41,31 @@ final class PrivateChatE2ETests: XCTestCase {
|
||||
|
||||
// MARK: - Basic Private Messaging Tests
|
||||
|
||||
func testSimplePrivateMessageShouldNotBeSentWithoutConnection() {
|
||||
// Intentionally commented out to test
|
||||
// simulateConnection(alice, bob)
|
||||
|
||||
let expectation = XCTestExpectation(description: "Bob should not receive a private message")
|
||||
expectation.isInverted = true
|
||||
|
||||
bob.messageDeliveryHandler = { message in
|
||||
if message.content == TestConstants.testMessage1 &&
|
||||
message.isPrivate &&
|
||||
message.sender == TestConstants.testNickname1 {
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
// Alice sends private message to Bob
|
||||
alice.sendPrivateMessage(
|
||||
TestConstants.testMessage1,
|
||||
to: TestConstants.testPeerID2,
|
||||
recipientNickname: TestConstants.testNickname2
|
||||
)
|
||||
|
||||
wait(for: [expectation], timeout: TestConstants.shortTimeout)
|
||||
}
|
||||
|
||||
func testSimplePrivateMessage() {
|
||||
simulateConnection(alice, bob)
|
||||
|
||||
@@ -280,7 +305,6 @@ final class PrivateChatE2ETests: XCTestCase {
|
||||
let service = MockBluetoothMeshService()
|
||||
service.myPeerID = peerID
|
||||
service.mockNickname = nickname
|
||||
service._testRegister()
|
||||
return service
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user