fixed existing tests and added tests for all the threaded flows

This commit is contained in:
Mauro Romito
2025-10-01 19:12:57 +02:00
committed by Mauro
parent a42cb77368
commit 8f31671e10
4 changed files with 106 additions and 5 deletions
+7 -3
View File
@@ -96,11 +96,15 @@ extension ClientProxyMock {
roomForIdentifierClosure = { [weak self] identifier in
if let room = self?.roomSummaryProvider.roomListPublisher.value.first(where: { $0.id == identifier }) {
await .joined(JoinedRoomProxyMock(.init(id: room.id, name: room.name)))
let roomProxy = await JoinedRoomProxyMock(.init(id: room.id, name: room.name))
roomProxy.loadOrFetchEventForReturnValue = .success(TimelineEventSDKMock())
return .joined(roomProxy)
} else if let spaceRoomProxy = configuration.joinedSpaceRooms.first(where: { $0.id == identifier }) {
await .joined(JoinedRoomProxyMock(.init(id: spaceRoomProxy.id, name: spaceRoomProxy.name)))
let roomProxy = await JoinedRoomProxyMock(.init(id: spaceRoomProxy.id, name: spaceRoomProxy.name))
roomProxy.loadOrFetchEventForReturnValue = .success(TimelineEventSDKMock())
return .joined(roomProxy)
} else {
nil
return nil
}
}