Signal-iOS/SignalServiceKit/tests/Messages/TypingIndicatorMessageTest.swift
Evan Hahn 8e5009bbf7
Add simple test for TypingIndicatorMessage
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.
2022-08-01 11:44:16 -05:00

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)
}
}
}