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:
Mauro
2023-05-30 09:48:55 +02:00
committed by GitHub
parent 25e2b05a4a
commit 088ca622a1
39 changed files with 857 additions and 194 deletions
@@ -24,7 +24,7 @@ enum InviteUsersScreenErrorType: Error {
enum InviteUsersScreenViewModelAction {
case proceed
case invite(users: [String])
case toggleUser(UserProfile)
case toggleUser(UserProfileProxy)
}
enum InviteUsersScreenRoomType {
@@ -37,7 +37,7 @@ struct InviteUsersScreenViewState: BindableState {
var usersSection: UserDiscoverySection = .init(type: .suggestions, users: [])
var selectedUsers: [UserProfile] = []
var selectedUsers: [UserProfileProxy] = []
var membershipState: [String: MembershipState] = .init()
var isSearching: Bool {
@@ -50,16 +50,16 @@ struct InviteUsersScreenViewState: BindableState {
var scrollToLastID: String?
func isUserSelected(_ user: UserProfile) -> Bool {
func isUserSelected(_ user: UserProfileProxy) -> Bool {
isUserDisabled(user) || selectedUsers.contains { $0.userID == user.userID }
}
func isUserDisabled(_ user: UserProfile) -> Bool {
func isUserDisabled(_ user: UserProfileProxy) -> Bool {
let membershipState = membershipState(user)
return membershipState == .invite || membershipState == .join
}
func membershipState(_ user: UserProfile) -> MembershipState? {
func membershipState(_ user: UserProfileProxy) -> MembershipState? {
membershipState[user.userID]
}
@@ -87,5 +87,5 @@ struct InviteUsersScreenViewStateBindings {
enum InviteUsersScreenViewAction {
case proceed
case toggleUser(UserProfile)
case toggleUser(UserProfileProxy)
}