Move MockTimelineController signalling to a new SignallingTimelineItemProviderMock

This allows for testing more of a flows and using a real TimelineController in
a lot of the UI tests
This commit is contained in:
Stefan Ceriu
2026-05-28 18:44:03 +03:00
parent bb2cbb6592
commit 4830424427
5 changed files with 219 additions and 104 deletions
@@ -8,11 +8,13 @@
import Combine
import Foundation
import MatrixRustSDK
extension TimelineProxyMock {
struct Configuration {
var isAutoUpdating = false
var timelineStartReached = false
var timelineItemProvider: TimelineItemProviderProtocol?
}
@MainActor
@@ -20,13 +22,18 @@ extension TimelineProxyMock {
self.init()
sendMessageEventContentReturnValue = .success(())
sendMessageHtmlInReplyToEventIDIntentionalMentionsReturnValue = .success(())
editNewContentReturnValue = .success(())
buildMessageContentForHtmlIntentionalMentionsReturnValue = RoomMessageEventContentWithoutRelation(noHandle: .init())
paginateBackwardsRequestSizeReturnValue = .success(())
paginateForwardsRequestSizeReturnValue = .success(())
sendReadReceiptForTypeReturnValue = .success(())
createPollQuestionAnswersPollKindReturnValue = .success(())
editPollOriginalQuestionAnswersPollKindReturnValue = .success(())
if configuration.isAutoUpdating {
if let provider = configuration.timelineItemProvider {
underlyingTimelineItemProvider = provider
} else if configuration.isAutoUpdating {
underlyingTimelineItemProvider = AutoUpdatingTimelineItemProviderMock()
} else {
let timelineItemProvider = TimelineItemProviderMock()