mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Switch to using proper SDK Mocks everywhere.
This commit is contained in:
@@ -147,7 +147,7 @@ struct AuthenticationServiceTests {
|
||||
|
||||
let classicAppManager = ClassicAppManagerMock(.init(accounts: classicAppAccounts,
|
||||
availableSecrets: availableSecrets,
|
||||
secretsBundle: .init(noHandle: .init())))
|
||||
secretsBundle: SecretsBundleWithUserIdSDKMock()))
|
||||
|
||||
service = AuthenticationService(userSessionStore: userSessionStore,
|
||||
encryptionKeyProvider: encryptionKeyProvider,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import Combine
|
||||
@testable import ElementX
|
||||
import MatrixRustSDKMocks
|
||||
import Testing
|
||||
|
||||
@MainActor
|
||||
@@ -21,7 +22,7 @@ struct HomeScreenRoomTests {
|
||||
notificationMode: RoomNotificationModeProxy,
|
||||
hasOngoingCall: Bool,
|
||||
activeCallIntent: CallIntent? = nil) {
|
||||
roomSummary = RoomSummary(room: .init(noHandle: .init()),
|
||||
roomSummary = RoomSummary(room: RoomSDKMock(),
|
||||
id: "Test room",
|
||||
joinRequestType: nil,
|
||||
name: "Test room",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
@testable import ElementX
|
||||
import Foundation
|
||||
@testable import MatrixRustSDK
|
||||
import MatrixRustSDKMocks
|
||||
import Testing
|
||||
|
||||
final class LoggingTests {
|
||||
@@ -72,7 +73,7 @@ final class LoggingTests {
|
||||
let roomName = "Private Conversation"
|
||||
let lastMessage = "Secret information"
|
||||
let heroName = "Pseudonym"
|
||||
let roomSummary = RoomSummary(room: .init(noHandle: .init()),
|
||||
let roomSummary = RoomSummary(room: RoomSDKMock(),
|
||||
id: "myroomid",
|
||||
joinRequestType: nil,
|
||||
name: roomName,
|
||||
@@ -223,19 +224,19 @@ final class LoggingTests {
|
||||
let rustImageMessage = ImageMessageContent(filename: "ImageString",
|
||||
caption: "ImageString",
|
||||
formattedCaption: nil,
|
||||
source: MediaSource(noHandle: .init()),
|
||||
source: MediaSourceSDKMock(),
|
||||
info: nil)
|
||||
|
||||
let rustVideoMessage = VideoMessageContent(filename: "VideoString",
|
||||
caption: "VideoString",
|
||||
formattedCaption: nil,
|
||||
source: MediaSource(noHandle: .init()),
|
||||
source: MediaSourceSDKMock(),
|
||||
info: nil)
|
||||
|
||||
let rustFileMessage = FileMessageContent(filename: "FileString",
|
||||
caption: "FileString",
|
||||
formattedCaption: nil,
|
||||
source: MediaSource(noHandle: .init()),
|
||||
source: MediaSourceSDKMock(),
|
||||
info: nil)
|
||||
|
||||
// When logging that value
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
|
||||
import Combine
|
||||
@testable import ElementX
|
||||
import MatrixRustSDKMocks
|
||||
import Testing
|
||||
|
||||
@MainActor
|
||||
struct MessageForwardingScreenViewModelTests {
|
||||
let forwardingItem = MessageForwardingItem(id: .event(uniqueID: .init("t1"), eventOrTransactionID: .eventID("t1")),
|
||||
roomID: "1",
|
||||
content: .init(noHandle: .init()))
|
||||
content: RoomMessageEventContentWithoutRelationSDKMock())
|
||||
var viewModel: MessageForwardingScreenViewModelProtocol!
|
||||
var context: MessageForwardingScreenViewModelType.Context!
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ final class RoomSummaryProviderTests {
|
||||
dynamicAdaptersResult.controllerReturnValue = dynamicEntriesController
|
||||
roomList = RoomListSDKMock()
|
||||
roomList.entriesWithDynamicAdaptersPageSizeListenerReturnValue = dynamicAdaptersResult
|
||||
roomList.loadingStateListenerReturnValue = .some(.init(state: .notLoaded, stateStream: .init(noHandle: .init())))
|
||||
roomList.loadingStateListenerReturnValue = .some(.init(state: .notLoaded, stateStream: TaskHandleSDKMock()))
|
||||
roomSummaryProvider.setRoomList(roomList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
@testable import ElementX
|
||||
import Foundation
|
||||
import MatrixRustSDKMocks
|
||||
import Testing
|
||||
|
||||
struct RoomSummaryTests {
|
||||
@@ -95,7 +96,7 @@ struct RoomSummaryTests {
|
||||
// MARK: - Helpers
|
||||
|
||||
func makeSummary(isDirect: Bool, isSpace: Bool, hasRoomAvatar: Bool, isTombstoned: Bool) -> RoomSummary {
|
||||
RoomSummary(room: .init(noHandle: .init()),
|
||||
RoomSummary(room: RoomSDKMock(),
|
||||
id: roomDetails.id,
|
||||
joinRequestType: nil,
|
||||
name: roomDetails.name,
|
||||
|
||||
Reference in New Issue
Block a user