mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
Switch to using proper SDK Mocks everywhere.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user