mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Add template unit tests and publisher utility.
This commit is contained in:
+6
-1
@@ -21,7 +21,8 @@ import Combine
|
||||
class MockTemplateUserProfileService: TemplateUserProfileServiceProtocol {
|
||||
|
||||
static let example = MockTemplateUserProfileService()
|
||||
@Published var presence: TemplateUserProfilePresence = .online
|
||||
static let initialPresenceState: TemplateUserProfilePresence = .offline
|
||||
@Published var presence: TemplateUserProfilePresence = initialPresenceState
|
||||
var presencePublisher: AnyPublisher<TemplateUserProfilePresence, Never> {
|
||||
$presence.eraseToAnyPublisher()
|
||||
}
|
||||
@@ -30,4 +31,8 @@ class MockTemplateUserProfileService: TemplateUserProfileServiceProtocol {
|
||||
let avatarUrl: String? = "mx123@matrix.com"
|
||||
let currentlyActive: Bool = true
|
||||
let lastActive: UInt = 1630596918513
|
||||
|
||||
func simulateUpdate(presence: TemplateUserProfilePresence) {
|
||||
self.presence = presence
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user