Switch to using proper SDK Mocks everywhere.

This commit is contained in:
Stefan Ceriu
2026-06-03 11:49:36 +03:00
parent d2f1e5caed
commit 9615e184ad
11 changed files with 23 additions and 14 deletions
@@ -11,6 +11,7 @@
import Combine
import Foundation
import MatrixRustSDK
import MatrixRustSDKMocks
struct TimelineControllerMockConfiguration {
var roomProxy: JoinedRoomProxyProtocol?
@@ -204,7 +205,7 @@ extension TimelineControllerMock {
return .success(())
}
messageEventContentForReturnValue = .init(noHandle: .init())
messageEventContentForReturnValue = RoomMessageEventContentWithoutRelationSDKMock()
debugInfoForReturnValue = .init(model: "Mock debug description", originalJSON: nil, latestEditJSON: nil)
eventTimestampForClosure = { [timelineItemsTimestamps] itemID in
@@ -9,6 +9,7 @@
import Combine
import Foundation
import MatrixRustSDK
import MatrixRustSDKMocks
extension TimelineProxyMock {
struct Configuration {
@@ -24,7 +25,7 @@ extension TimelineProxyMock {
sendMessageEventContentReturnValue = .success(())
sendMessageHtmlInReplyToEventIDIntentionalMentionsReturnValue = .success(())
editNewContentReturnValue = .success(())
buildMessageContentForHtmlIntentionalMentionsReturnValue = RoomMessageEventContentWithoutRelation(noHandle: .init())
buildMessageContentForHtmlIntentionalMentionsReturnValue = RoomMessageEventContentWithoutRelationSDKMock()
paginateBackwardsRequestSizeReturnValue = .success(())
paginateForwardsRequestSizeReturnValue = .success(())
sendReadReceiptForTypeReturnValue = .success(())
@@ -7,6 +7,7 @@
//
import Compound
import MatrixRustSDKMocks
import SwiftUI
struct MessageForwardingScreen: View {
@@ -97,7 +98,7 @@ struct MessageForwardingScreen_Previews: PreviewProvider, TestablePreview {
let summaryProvider = RoomSummaryProviderMock(.init(state: .loaded(.mockRooms)))
let viewModel = MessageForwardingScreenViewModel(forwardingItem: .init(id: .randomEvent,
roomID: "",
content: .init(noHandle: .init())),
content: RoomMessageEventContentWithoutRelationSDKMock()),
userSession: UserSessionMock(.init()),
roomSummaryProvider: summaryProvider,
userIndicatorController: UserIndicatorControllerMock())
@@ -8,6 +8,7 @@
import Foundation
import MatrixRustSDK
import MatrixRustSDKMocks
/// A light wrapper around timeline items returned from Rust.
enum TimelineItemProxy {
@@ -204,7 +205,7 @@ struct SendHandleProxy: Hashable {
static var mock: SendHandleProxy {
.init(itemID: .event(uniqueID: .init(UUID().uuidString),
eventOrTransactionID: .eventID(UUID().uuidString)),
underlyingHandle: .init(noHandle: .init()))
underlyingHandle: SendHandleSDKMock())
}
}
@@ -8,6 +8,7 @@
import Combine
import MatrixRustSDK
import MatrixRustSDKMocks
import SwiftUI
import UIKit
@@ -876,7 +877,7 @@ class MockScreen: Identifiable {
timelineProxy.buildMessageContentForHtmlIntentionalMentionsClosure = { text, _, _ in
pendingEditText = text
return RoomMessageEventContentWithoutRelation(noHandle: .init())
return RoomMessageEventContentWithoutRelationSDKMock()
}
timelineProxy.editNewContentClosure = { [weak itemProvider] _, _ in