updated existing preview tests and added a test for the single space cases

fixed a bug where was not possible to re-select the space members option with unknown spaces.

pr suggestions
This commit is contained in:
Mauro Romito
2025-11-26 15:50:22 +01:00
committed by Mauro
parent 997353fdec
commit 051e5ceda6
20 changed files with 147 additions and 55 deletions
@@ -49,11 +49,11 @@ class SpaceServiceProxy: SpaceServiceProxyProtocol {
}
}
func joinedParents(roomID: String) async -> Result<[SpaceRoomProxyProtocol], SpaceServiceProxyError> {
func joinedParents(childID: String) async -> Result<[SpaceRoomProxyProtocol], SpaceServiceProxyError> {
do {
return try await .success(spaceService.joinedParentsOfChild(childId: roomID).map(SpaceRoomProxy.init))
return try await .success(spaceService.joinedParentsOfChild(childId: childID).map(SpaceRoomProxy.init))
} catch {
MXLog.error("Failed to get joined parents for \(roomID): \(error)")
MXLog.error("Failed to get joined parents for \(childID): \(error)")
return .failure(.sdkError(error))
}
}
@@ -19,6 +19,6 @@ protocol SpaceServiceProxyProtocol {
func spaceRoomList(spaceID: String) async -> Result<SpaceRoomListProxyProtocol, SpaceServiceProxyError>
func leaveSpace(spaceID: String) async -> Result<LeaveSpaceHandleProxy, SpaceServiceProxyError>
/// Returns all the parent spaces of a room that user has joined.
func joinedParents(roomID: String) async -> Result<[SpaceRoomProxyProtocol], SpaceServiceProxyError>
/// Returns all the parent spaces of a child that user has joined.
func joinedParents(childID: String) async -> Result<[SpaceRoomProxyProtocol], SpaceServiceProxyError>
}