Implemented adding the room to the space after selection, and the editableSpace proxied API. Also updated and added tests.

This commit is contained in:
Mauro Romito
2026-01-21 14:58:03 +01:00
committed by Mauro
parent 07243be949
commit 9dead7ed55
50 changed files with 406 additions and 83 deletions
@@ -17100,6 +17100,70 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable {
return joinedParentsChildIDReturnValue
}
}
//MARK: - editableSpaces
var editableSpacesUnderlyingCallsCount = 0
var editableSpacesCallsCount: Int {
get {
if Thread.isMainThread {
return editableSpacesUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = editableSpacesUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
editableSpacesUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
editableSpacesUnderlyingCallsCount = newValue
}
}
}
}
var editableSpacesCalled: Bool {
return editableSpacesCallsCount > 0
}
var editableSpacesUnderlyingReturnValue: [SpaceServiceRoomProtocol]!
var editableSpacesReturnValue: [SpaceServiceRoomProtocol]! {
get {
if Thread.isMainThread {
return editableSpacesUnderlyingReturnValue
} else {
var returnValue: [SpaceServiceRoomProtocol]? = nil
DispatchQueue.main.sync {
returnValue = editableSpacesUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
editableSpacesUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
editableSpacesUnderlyingReturnValue = newValue
}
}
}
}
var editableSpacesClosure: (() async -> [SpaceServiceRoomProtocol])?
func editableSpaces() async -> [SpaceServiceRoomProtocol] {
editableSpacesCallsCount += 1
if let editableSpacesClosure = editableSpacesClosure {
return await editableSpacesClosure()
} else {
return editableSpacesReturnValue
}
}
//MARK: - addChild
var addChildToUnderlyingCallsCount = 0