mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Generating SDK Mocks through the usage of swift run tools generate-sdk-mocks (#982)
* basic implementation, that works for now only with the local SDK * replaced a handmade mock with a generated mock
This commit is contained in:
@@ -21,12 +21,12 @@ struct CreateRoomCoordinatorParameters {
|
||||
let userSession: UserSessionProtocol
|
||||
weak var userIndicatorController: UserIndicatorControllerProtocol?
|
||||
let createRoomParameters: CurrentValuePublisher<CreateRoomFlowParameters, Never>
|
||||
let selectedUsers: CurrentValuePublisher<[UserProfile], Never>
|
||||
let selectedUsers: CurrentValuePublisher<[UserProfileProxy], Never>
|
||||
}
|
||||
|
||||
enum CreateRoomCoordinatorAction {
|
||||
case openRoom(withIdentifier: String)
|
||||
case deselectUser(UserProfile)
|
||||
case deselectUser(UserProfileProxy)
|
||||
case updateDetails(CreateRoomFlowParameters)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@ enum CreateRoomScreenErrorType: Error {
|
||||
|
||||
enum CreateRoomViewModelAction {
|
||||
case openRoom(withIdentifier: String)
|
||||
case deselectUser(UserProfile)
|
||||
case deselectUser(UserProfileProxy)
|
||||
case updateDetails(CreateRoomFlowParameters)
|
||||
}
|
||||
|
||||
struct CreateRoomViewState: BindableState {
|
||||
var selectedUsers: [UserProfile]
|
||||
var selectedUsers: [UserProfileProxy]
|
||||
var bindings: CreateRoomViewStateBindings
|
||||
|
||||
var canCreateRoom: Bool {
|
||||
@@ -47,5 +47,5 @@ struct CreateRoomViewStateBindings {
|
||||
|
||||
enum CreateRoomViewAction {
|
||||
case createRoom
|
||||
case deselectUser(UserProfile)
|
||||
case deselectUser(UserProfileProxy)
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class CreateRoomViewModel: CreateRoomViewModelType, CreateRoomViewModelProtocol
|
||||
init(userSession: UserSessionProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol?,
|
||||
createRoomParameters: CurrentValuePublisher<CreateRoomFlowParameters, Never>,
|
||||
selectedUsers: CurrentValuePublisher<[UserProfile], Never>) {
|
||||
selectedUsers: CurrentValuePublisher<[UserProfileProxy], Never>) {
|
||||
let parameters = createRoomParameters.value
|
||||
self.userSession = userSession
|
||||
self.userIndicatorController = userIndicatorController
|
||||
|
||||
@@ -164,7 +164,7 @@ struct CreateRoom_Previews: PreviewProvider {
|
||||
let userSession = MockUserSession(clientProxy: MockClientProxy(userID: "@userid:example.com"),
|
||||
mediaProvider: MockMediaProvider())
|
||||
let parameters = CreateRoomFlowParameters()
|
||||
let selectedUsers: [UserProfile] = [.mockAlice, .mockBob, .mockCharlie]
|
||||
let selectedUsers: [UserProfileProxy] = [.mockAlice, .mockBob, .mockCharlie]
|
||||
|
||||
return CreateRoomViewModel(userSession: userSession, userIndicatorController: nil, createRoomParameters: .init(parameters), selectedUsers: .init(selectedUsers))
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user