mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user