mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
UITests and Mock Screens
Adds the test targets for Unit and UI tests Adds mock screen data and utilities to render each mock screen for previews/ui tests. Changes Published property in the service to CurrentValueSubject. we don't need the synthesized aspect of Published and property wrappers cannot be included in protocols.
This commit is contained in:
@@ -36,7 +36,7 @@ class TemplateUserProfileViewModel: ObservableObject, TemplateUserProfileViewMod
|
||||
self.userService = userService
|
||||
self.viewState = initialState ?? Self.defaultState(userService: userService)
|
||||
|
||||
userService.presencePublisher
|
||||
userService.presenceSubject
|
||||
.map(TemplateUserProfileStateAction.updatePresence)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveValue: { [weak self] action in
|
||||
@@ -46,7 +46,7 @@ class TemplateUserProfileViewModel: ObservableObject, TemplateUserProfileViewMod
|
||||
}
|
||||
|
||||
private static func defaultState(userService: TemplateUserProfileServiceProtocol) -> TemplateUserProfileViewState {
|
||||
return TemplateUserProfileViewState(avatar: userService.avatarData, displayName: userService.displayName, presence: .offline)
|
||||
return TemplateUserProfileViewState(avatar: userService.avatarData, displayName: userService.displayName, presence: userService.presenceSubject.value)
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
Reference in New Issue
Block a user