This change should have no direct user impact. This tests `TypingIndicatorMessage`'s `isOnline` getter. I plan to add additional tests to this file in a future commit, but I think this is a useful change on its own.
27 lines
751 B
Swift
27 lines
751 B
Swift
//
|
|
// Copyright (c) 2022 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
import SignalServiceKit
|
|
|
|
class TypingIndicatorMessageTest: SSKBaseTestSwift {
|
|
private func makeThread(transaction: SDSAnyWriteTransaction) -> TSThread {
|
|
TSContactThread.getOrCreateThread(
|
|
withContactAddress: SignalServiceAddress(phoneNumber: "+12223334444"),
|
|
transaction: transaction
|
|
)
|
|
}
|
|
|
|
func testIsOnline() throws {
|
|
write { transaction in
|
|
let message = TypingIndicatorMessage(
|
|
thread: makeThread(transaction: transaction),
|
|
action: .started,
|
|
transaction: transaction
|
|
)
|
|
XCTAssertTrue(message.isOnline)
|
|
}
|
|
}
|
|
}
|