mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Space flow improvements. (#4430)
* Space flow improvements - Use a state machine to select a space. - Add a SpaceFlowCoordinator for recursively presenting subspaces. - Get the spaceRoomListProxy when tapping on the space so we can indicate failures. - Fix the total room count in SpaceListScreen. * Refactor spaceRoom → spaceRoomProxy. * Add a UI test for the Spaces flow.
This commit is contained in:
@@ -85,6 +85,8 @@ extension ClientProxyMock {
|
||||
secureBackupController = SecureBackupControllerMock(.init(recoveryState: configuration.recoveryState))
|
||||
resetIdentityReturnValue = .success(IdentityResetHandleSDKMock(.init()))
|
||||
|
||||
spaceService = SpaceServiceProxyMock(.init())
|
||||
|
||||
roomForIdentifierClosure = { [weak self] identifier in
|
||||
guard let room = self?.roomSummaryProvider.roomListPublisher.value.first(where: { $0.id == identifier }) else {
|
||||
return nil
|
||||
|
||||
@@ -2156,6 +2156,11 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
|
||||
}
|
||||
var underlyingSecureBackupController: SecureBackupControllerProtocol!
|
||||
var sessionVerificationController: SessionVerificationControllerProxyProtocol?
|
||||
var spaceService: SpaceServiceProxyProtocol {
|
||||
get { return underlyingSpaceService }
|
||||
set(value) { underlyingSpaceService = value }
|
||||
}
|
||||
var underlyingSpaceService: SpaceServiceProxyProtocol!
|
||||
var isReportRoomSupportedCallsCount = 0
|
||||
var isReportRoomSupportedCalled: Bool {
|
||||
return isReportRoomSupportedCallsCount > 0
|
||||
|
||||
@@ -99,6 +99,14 @@ extension [SpaceRoomProxyProtocol] {
|
||||
makeSpaceRooms(isSpace: true) + makeSpaceRooms(isSpace: false)
|
||||
}
|
||||
|
||||
static var mockSingleRoom: [SpaceRoomProxyProtocol] {
|
||||
[SpaceRoomProxyMock(.init(id: "!spaceroom:matrix.org",
|
||||
name: "Management",
|
||||
isSpace: false,
|
||||
joinedMembersCount: 12,
|
||||
topic: "This is where everything gets organised 📋."))]
|
||||
}
|
||||
|
||||
private static func makeSpaceRooms(isSpace: Bool) -> [SpaceRoomProxyMock] {
|
||||
let typeName = isSpace ? "Space" : "Room"
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import MatrixRustSDK
|
||||
|
||||
@@ -27,3 +28,16 @@ extension SpaceServiceProxyMock {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SpaceServiceProxyMock.Configuration {
|
||||
static var populated: SpaceServiceProxyMock.Configuration {
|
||||
let spaceRoomLists = [SpaceRoomProxyProtocol].mockJoinedSpaces.map {
|
||||
($0.id, SpaceRoomListProxyMock(.init(spaceRoomProxy: $0, initialSpaceRooms: .mockSpaceList)))
|
||||
}
|
||||
let subSpaceRoomLists = [SpaceRoomProxyProtocol].mockSpaceList.map {
|
||||
($0.id, SpaceRoomListProxyMock(.init(spaceRoomProxy: $0, initialSpaceRooms: .mockSingleRoom)))
|
||||
}
|
||||
|
||||
return .init(joinedSpaces: .mockJoinedSpaces, spaceRoomLists: .init(uniqueKeysWithValues: spaceRoomLists + subSpaceRoomLists))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user