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
@@ -10,6 +10,7 @@ import Foundation
extension TimelineControllerFactoryMock {
struct Configuration {
var timelineController: TimelineControllerProtocol?
var threadTimelineController: TimelineControllerProtocol?
}
convenience init(_ configuration: Configuration) {
@@ -20,5 +21,15 @@ extension TimelineControllerFactoryMock {
timelineController.timelineItems = RoomTimelineItemFixtures.largeChunk
return timelineController
}()
buildThreadTimelineControllerEventIDRoomProxyTimelineItemFactoryMediaProviderClosure = { threadRootEventID, _, _, _ in
if let threadTimelineController = configuration.threadTimelineController {
return .success(threadTimelineController)
} else {
let timelineController = MockTimelineController(timelineKind: .thread(rootEventID: threadRootEventID))
timelineController.timelineItems = RoomTimelineItemFixtures.largeChunk
return .success(timelineController)
}
}
}
}