TM-SGNL-iOS/SignalServiceKit/tests/Messages/TypingIndicatorMessageTest.swift
TeleMessage developers dde0620daf initial commit
2025-05-03 12:28:28 -07:00

38 lines
1.1 KiB
Swift

//
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import XCTest
import SignalServiceKit
class TypingIndicatorMessageTest: SSKBaseTest {
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)
}
}
func testIsUrgent() throws {
write { transaction in
let message = TypingIndicatorMessage(
thread: makeThread(transaction: transaction),
action: .started,
transaction: transaction
)
XCTAssertFalse(message.isUrgent)
}
}
}