diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index d6f89bba6..89463250f 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -319,7 +319,6 @@ 340D39DB87F3800D53A6A621 /* EmojiPickerScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00245D40CD90FD71D6A05239 /* EmojiPickerScreen.swift */; }; 34357B287357BC0B9715DD51 /* UserAgentBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2529D434C750ED78ADF1ED /* UserAgentBuilder.swift */; }; 34390DAE0C574DAD30CCA7D9 /* DeclineAndBlockScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ADF12A50186B75C68017B61 /* DeclineAndBlockScreenViewModelTests.swift */; }; - 3467FEE8210D301FF1B77001 /* UserIndicatorControllerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7893780A1FD6E3F38B3E9049 /* UserIndicatorControllerMock.swift */; }; 34ADC506C929D10B138EBA51 /* AdvancedSettingsScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42C58159916ABD7F454CE689 /* AdvancedSettingsScreenCoordinator.swift */; }; 34C752A73717C691582DC6C7 /* UnsupportedRoomTimelineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1B8500C152BC59445647DA8 /* UnsupportedRoomTimelineItem.swift */; }; 34F1261CEF6D6A00D559B520 /* SettingsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CFD5EB0B0EEA4549FB49784 /* SettingsScreen.swift */; }; @@ -2309,7 +2308,6 @@ 787E84119E626E2F0E0BFBE8 /* ManageRoomMemberSheetModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageRoomMemberSheetModels.swift; sourceTree = ""; }; 78910787F967CBC6042A101E /* StartChatScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartChatScreenViewModelProtocol.swift; sourceTree = ""; }; 78913D6E120D46138E97C107 /* NavigationSplitCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationSplitCoordinatorTests.swift; sourceTree = ""; }; - 7893780A1FD6E3F38B3E9049 /* UserIndicatorControllerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIndicatorControllerMock.swift; sourceTree = ""; }; 78BBDF7A05CF53B5CDC13682 /* landscape_test_video.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = landscape_test_video.mov; sourceTree = ""; }; 796CBD0C56FA0D3AEDAB255B /* SessionVerificationScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenCoordinator.swift; sourceTree = ""; }; 79A106D76741914F82664959 /* StateStoreViewModelV2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateStoreViewModelV2.swift; sourceTree = ""; }; @@ -3839,7 +3837,6 @@ 62EACAFB3F3E017060F9F1C5 /* TimelineProviderMock.swift */, 17A8AA0DFA06012A9DAB951E /* TimelineProxyMock.swift */, 8536B40F578BA7FDB23D97B1 /* UserIdentityProxyMock.swift */, - 7893780A1FD6E3F38B3E9049 /* UserIndicatorControllerMock.swift */, AAD01F7FC2BBAC7351948595 /* UserProfile+Mock.swift */, F4469F6AE311BDC439B3A5EC /* UserSessionMock.swift */, 9EB9BA2F30EB8C33226D8FF1 /* UserSessionStoreMock.swift */, @@ -9145,7 +9142,6 @@ 4E9782D683660463804C2DC3 /* UserIdentityProxyProtocol.swift in Sources */, 988BA75A182738150894A23F /* UserIndicator.swift in Sources */, C4E0D03DF88242697545A9B7 /* UserIndicatorController.swift in Sources */, - 3467FEE8210D301FF1B77001 /* UserIndicatorControllerMock.swift in Sources */, E3E1E255DC8CB34BD8573E0D /* UserIndicatorControllerProtocol.swift in Sources */, A14A9419105A1CD42F0511C4 /* UserIndicatorModalView.swift in Sources */, 9E838A62918E47BC72D6640D /* UserIndicatorPresenter.swift in Sources */, diff --git a/ElementX/Sources/Mocks/AnalyticsServiceMock.swift b/ElementX/Sources/Mocks/AnalyticsServiceMock.swift index 1606efa7c..9b7e5e756 100644 --- a/ElementX/Sources/Mocks/AnalyticsServiceMock.swift +++ b/ElementX/Sources/Mocks/AnalyticsServiceMock.swift @@ -6,11 +6,17 @@ // extension AnalyticsServiceMock { - static var `default`: AnalyticsServiceMock { - let mock = AnalyticsServiceMock() - mock.isEnabled = false - mock.shouldShowAnalyticsPrompt = false - mock.signpost = Signposter() - return mock + struct Configuration { + var isEnabled = false + var shouldShowAnalyticsPrompt = false + var signpost = Signposter() + } + + convenience init(_ configuration: Configuration) { + self.init() + + isEnabled = configuration.isEnabled + shouldShowAnalyticsPrompt = configuration.shouldShowAnalyticsPrompt + signpost = configuration.signpost } } diff --git a/ElementX/Sources/Mocks/AppMediatorMock.swift b/ElementX/Sources/Mocks/AppMediatorMock.swift index 99e470dca..7c615b93a 100644 --- a/ElementX/Sources/Mocks/AppMediatorMock.swift +++ b/ElementX/Sources/Mocks/AppMediatorMock.swift @@ -9,18 +9,22 @@ import UIKit extension AppMediatorMock { - static var `default`: AppMediatorMock { - let mock = AppMediatorMock() + struct Configuration { + var appState = UIApplication.State.active + var isCameraAuthorized = true + var networkMonitor = NetworkMonitorMock(.init()) + } + + convenience init(_ configuration: Configuration) { + self.init() - mock.underlyingAppState = .active - mock.requestAuthorizationIfNeededUnderlyingReturnValue = true - mock.underlyingNetworkMonitor = NetworkMonitorMock.default + underlyingAppState = configuration.appState + requestAuthorizationIfNeededUnderlyingReturnValue = configuration.isCameraAuthorized + underlyingNetworkMonitor = configuration.networkMonitor let windowManagerMock = WindowManagerMock() windowManagerMock.closeAllSecondaryWindowsClosure = { } windowManagerMock.closeSecondaryWindowForTypeClosure = { _ in } - mock.underlyingWindowManager = windowManagerMock - - return mock + underlyingWindowManager = windowManagerMock } } diff --git a/ElementX/Sources/Mocks/AuthenticationClientBuilderFactoryMock.swift b/ElementX/Sources/Mocks/AuthenticationClientBuilderFactoryMock.swift index b3ff45c78..6a63bc9a3 100644 --- a/ElementX/Sources/Mocks/AuthenticationClientBuilderFactoryMock.swift +++ b/ElementX/Sources/Mocks/AuthenticationClientBuilderFactoryMock.swift @@ -13,37 +13,37 @@ import MatrixRustSDKMocks extension AuthenticationClientFactoryMock { struct Configuration { var homeserverClients = [ - "matrix.org": ClientSDKMock(configuration: .init()), - "https://matrix-client.matrix.org": ClientSDKMock(configuration: .init()), - "example.com": ClientSDKMock(configuration: .init(serverAddress: "example.com", - homeserverURL: "https://matrix.example.com", - slidingSyncVersion: .native, - oAuthLoginURL: nil, - supportsOAuthCreatePrompt: false, - supportsPasswordLogin: true)), - "company.com": ClientSDKMock(configuration: .init(serverAddress: "company.com", - homeserverURL: "https://matrix.company.com", - slidingSyncVersion: .native, - oAuthLoginURL: "https://auth.company.com/login", - supportsOAuthCreatePrompt: false, - supportsPasswordLogin: false)), - "server.net": ClientSDKMock(configuration: .init(serverAddress: "server.net", - homeserverURL: "https://matrix.server.net", - slidingSyncVersion: .native, - oAuthLoginURL: nil, - supportsOAuthCreatePrompt: false, - supportsPasswordLogin: false)), - "secure.gov": ClientSDKMock(configuration: .init(serverAddress: "secure.gov", - homeserverURL: "https://ess.secure.gov", - slidingSyncVersion: .native, - oAuthLoginURL: "https://auth.secure.gov/login", - supportsOAuthCreatePrompt: false, - supportsPasswordLogin: false, - elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}")) + "matrix.org": ClientSDKMock(.init()), + "https://matrix-client.matrix.org": ClientSDKMock(.init()), + "example.com": ClientSDKMock(.init(serverAddress: "example.com", + homeserverURL: "https://matrix.example.com", + slidingSyncVersion: .native, + oAuthLoginURL: nil, + supportsOAuthCreatePrompt: false, + supportsPasswordLogin: true)), + "company.com": ClientSDKMock(.init(serverAddress: "company.com", + homeserverURL: "https://matrix.company.com", + slidingSyncVersion: .native, + oAuthLoginURL: "https://auth.company.com/login", + supportsOAuthCreatePrompt: false, + supportsPasswordLogin: false)), + "server.net": ClientSDKMock(.init(serverAddress: "server.net", + homeserverURL: "https://matrix.server.net", + slidingSyncVersion: .native, + oAuthLoginURL: nil, + supportsOAuthCreatePrompt: false, + supportsPasswordLogin: false)), + "secure.gov": ClientSDKMock(.init(serverAddress: "secure.gov", + homeserverURL: "https://ess.secure.gov", + slidingSyncVersion: .native, + oAuthLoginURL: "https://auth.secure.gov/login", + supportsOAuthCreatePrompt: false, + supportsPasswordLogin: false, + elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}")) ] } - convenience init(configuration: Configuration) { + convenience init(_ configuration: Configuration) { self.init() makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksClosure = { address, _, _, _, _, _ in diff --git a/ElementX/Sources/Mocks/BannedRoomProxyMock.swift b/ElementX/Sources/Mocks/BannedRoomProxyMock.swift index 0ba59062c..b8dbb7046 100644 --- a/ElementX/Sources/Mocks/BannedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/BannedRoomProxyMock.swift @@ -65,6 +65,6 @@ extension RoomInfoProxyMock { joinRule = .knock historyVisibility = .shared - powerLevels = RoomPowerLevelsProxyMock(configuration: .init()) + powerLevels = RoomPowerLevelsProxyMock(.init()) } } diff --git a/ElementX/Sources/Mocks/ClientProxyMock.swift b/ElementX/Sources/Mocks/ClientProxyMock.swift index 84dae9a9a..f29a12e97 100644 --- a/ElementX/Sources/Mocks/ClientProxyMock.swift +++ b/ElementX/Sources/Mocks/ClientProxyMock.swift @@ -151,7 +151,7 @@ extension ClientProxyMock { } } - userIdentityForFallBackToServerReturnValue = .success(UserIdentityProxyMock(configuration: .init())) + userIdentityForFallBackToServerReturnValue = .success(UserIdentityProxyMock(.init())) underlyingIsReportRoomSupported = true underlyingIsLiveKitRTCSupported = true diff --git a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift index b552d2a6d..85976bfa9 100644 --- a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift @@ -70,7 +70,7 @@ extension RoomInfoProxyMock { joinRule = .invite historyVisibility = .shared - powerLevels = RoomPowerLevelsProxyMock(configuration: .init()) + powerLevels = RoomPowerLevelsProxyMock(.init()) } } diff --git a/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift b/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift index 40594c3b0..a971036be 100644 --- a/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift @@ -46,7 +46,7 @@ struct JoinedRoomProxyMockConfiguration { var predecessor: PredecessorRoom? var successor: SuccessorRoom? - var powerLevelsConfiguration = RoomPowerLevelsProxyMockConfiguration() + var powerLevelsConfiguration = RoomPowerLevelsProxyMock.Configuration() } extension JoinedRoomProxyMock { @@ -97,7 +97,7 @@ extension JoinedRoomProxyMock { } updatePowerLevelsForUsersReturnValue = .success(()) - let powerLevelsProxyMock = RoomPowerLevelsProxyMock(configuration: configuration.powerLevelsConfiguration) + let powerLevelsProxyMock = RoomPowerLevelsProxyMock(configuration.powerLevelsConfiguration) powerLevelsProxyMock.canUserUserIDSendStateEventClosure = { [weak self] userID, _ in .success(self?.membersPublisher.value.first { $0.userID == userID }?.role ?? .user != .user) @@ -196,7 +196,7 @@ extension RoomInfoProxyMock { joinRule = configuration.joinRule historyVisibility = configuration.historyVisibility - powerLevels = RoomPowerLevelsProxyMock(configuration: configuration.powerLevelsConfiguration) + powerLevels = RoomPowerLevelsProxyMock(configuration.powerLevelsConfiguration) } } diff --git a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift index 3ffa74e85..fe27aa387 100644 --- a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift @@ -65,6 +65,6 @@ extension RoomInfoProxyMock { joinRule = .knock historyVisibility = .shared - powerLevels = RoomPowerLevelsProxyMock(configuration: .init()) + powerLevels = RoomPowerLevelsProxyMock(.init()) } } diff --git a/ElementX/Sources/Mocks/MediaProviderMock.swift b/ElementX/Sources/Mocks/MediaProviderMock.swift index 4d7e47551..cc7dca195 100644 --- a/ElementX/Sources/Mocks/MediaProviderMock.swift +++ b/ElementX/Sources/Mocks/MediaProviderMock.swift @@ -12,7 +12,7 @@ extension MediaProviderMock { struct Configuration { } // swiftlint:disable:next cyclomatic_complexity - convenience init(configuration: Configuration) { + convenience init(_ configuration: Configuration) { self.init() imageFromSourceSizeClosure = { mediaSource, _ in diff --git a/ElementX/Sources/Mocks/NetworkMonitorMock.swift b/ElementX/Sources/Mocks/NetworkMonitorMock.swift index 4a30b4a26..19a04a068 100644 --- a/ElementX/Sources/Mocks/NetworkMonitorMock.swift +++ b/ElementX/Sources/Mocks/NetworkMonitorMock.swift @@ -10,9 +10,13 @@ import Combine import Foundation extension NetworkMonitorMock { - static var `default`: NetworkMonitorMock { - let mock = NetworkMonitorMock() - mock.underlyingReachabilityPublisher = .init(.init(.reachable)) - return mock + struct Configuration { + var reachabilityPublisher = CurrentValuePublisher(.init(.reachable)) + } + + convenience init(_ configuration: Configuration) { + self.init() + + underlyingReachabilityPublisher = configuration.reachabilityPublisher } } diff --git a/ElementX/Sources/Mocks/NotificationToneManagerMock.swift b/ElementX/Sources/Mocks/NotificationToneManagerMock.swift index df38e5333..e0ef8c82e 100644 --- a/ElementX/Sources/Mocks/NotificationToneManagerMock.swift +++ b/ElementX/Sources/Mocks/NotificationToneManagerMock.swift @@ -6,9 +6,13 @@ // extension NotificationToneManagerMock { - static var `default`: NotificationToneManagerMock { - let mock = NotificationToneManagerMock() - mock.customTonesReturnValue = [] - return mock + struct Configuration { + let customTones: [NotificationTone] = [] + } + + convenience init(_ configuration: Configuration) { + self.init() + + customTonesReturnValue = configuration.customTones } } diff --git a/ElementX/Sources/Mocks/RoomDirectorySearchMock.swift b/ElementX/Sources/Mocks/RoomDirectorySearchMock.swift index f688c6d71..d1c2a6c82 100644 --- a/ElementX/Sources/Mocks/RoomDirectorySearchMock.swift +++ b/ElementX/Sources/Mocks/RoomDirectorySearchMock.swift @@ -9,12 +9,12 @@ import Combine import Foundation -struct RoomDirectorySearchProxyMockConfiguration { - let results: [RoomDirectorySearchResult] -} - extension RoomDirectorySearchProxyMock { - convenience init(configuration: RoomDirectorySearchProxyMockConfiguration) { + struct Configuration { + let results: [RoomDirectorySearchResult] + } + + convenience init(_ configuration: Configuration) { self.init() resultsPublisher = CurrentValueSubject(configuration.results).asCurrentValuePublisher() searchQueryReturnValue = .success(()) diff --git a/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift b/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift index 104733878..d96f652fb 100644 --- a/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift @@ -8,22 +8,22 @@ import MatrixRustSDK -struct RoomPowerLevelsProxyMockConfiguration { - var canUserSendMessage = true - var canUserSendState = false - var canUserInvite = true - var canUserRedactOther = false - var canUserRedactOwn = true - var canUserKick = false - var canUserBan = false - var canUserTriggerRoomNotification = false - var canUserPin = true - var canUserJoinCall = true - var canUserEditRoomsAndPermissions = true -} - extension RoomPowerLevelsProxyMock { - convenience init(configuration: RoomPowerLevelsProxyMockConfiguration) { + struct Configuration { + var canUserSendMessage = true + var canUserSendState = false + var canUserInvite = true + var canUserRedactOther = false + var canUserRedactOwn = true + var canUserKick = false + var canUserBan = false + var canUserTriggerRoomNotification = false + var canUserPin = true + var canUserJoinCall = true + var canUserEditRoomsAndPermissions = true + } + + convenience init(_ configuration: Configuration) { self.init() underlyingValues = RoomPowerLevelsValues.mock diff --git a/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift b/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift index 9d139c151..41e2dab0a 100644 --- a/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift +++ b/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift @@ -37,7 +37,7 @@ extension ClientSDKMock { enum MockError: Error { case generic } - convenience init(configuration: Configuration) { + convenience init(_ configuration: Configuration) { self.init() homeserverLoginDetailsReturnValue = HomeserverLoginDetailsSDKMock(configuration: configuration) diff --git a/ElementX/Sources/Mocks/UserIdentityProxyMock.swift b/ElementX/Sources/Mocks/UserIdentityProxyMock.swift index 71a7d3803..a24b3781a 100644 --- a/ElementX/Sources/Mocks/UserIdentityProxyMock.swift +++ b/ElementX/Sources/Mocks/UserIdentityProxyMock.swift @@ -11,7 +11,7 @@ extension UserIdentityProxyMock { var verificationState: UserIdentityVerificationState = .notVerified } - convenience init(configuration: Configuration) { + convenience init(_ configuration: Configuration) { self.init() underlyingVerificationState = configuration.verificationState diff --git a/ElementX/Sources/Mocks/UserIndicatorControllerMock.swift b/ElementX/Sources/Mocks/UserIndicatorControllerMock.swift deleted file mode 100644 index a10a1a961..000000000 --- a/ElementX/Sources/Mocks/UserIndicatorControllerMock.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright 2025 Element Creations Ltd. -// Copyright 2023-2025 New Vector Ltd. -// -// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. -// Please see LICENSE files in the repository root for full details. -// - -import Combine -import Foundation - -extension UserIndicatorControllerMock { - static var `default`: UserIndicatorControllerMock { - let mock = UserIndicatorControllerMock() - mock.submitIndicatorDelayClosure = { _, _ in } - mock.retractIndicatorWithIdClosure = { _ in } - mock.retractAllIndicatorsClosure = { } - return mock - } -} diff --git a/ElementX/Sources/Mocks/UserSessionMock.swift b/ElementX/Sources/Mocks/UserSessionMock.swift index 3300540cd..7eee9a90c 100644 --- a/ElementX/Sources/Mocks/UserSessionMock.swift +++ b/ElementX/Sources/Mocks/UserSessionMock.swift @@ -18,7 +18,7 @@ extension UserSessionMock { self.init() clientProxy = configuration.clientProxy - mediaProvider = MediaProviderMock(configuration: .init()) + mediaProvider = MediaProviderMock(.init()) voiceMessageMediaManager = VoiceMessageMediaManagerMock() sessionSecurityStatePublisher = CurrentValueSubject(.init(verificationState: .verified, recoveryState: .enabled)).asCurrentValuePublisher() diff --git a/ElementX/Sources/Mocks/UserSessionStoreMock.swift b/ElementX/Sources/Mocks/UserSessionStoreMock.swift index 99d796f9b..992325129 100644 --- a/ElementX/Sources/Mocks/UserSessionStoreMock.swift +++ b/ElementX/Sources/Mocks/UserSessionStoreMock.swift @@ -9,7 +9,7 @@ extension UserSessionStoreMock { struct Configuration { } - convenience init(configuration: Configuration) { + convenience init(_ configuration: Configuration) { self.init() userSessionForSessionDirectoriesPassphraseReturnValue = .success(UserSessionMock(.init())) diff --git a/ElementX/Sources/Other/Pills/PillView.swift b/ElementX/Sources/Other/Pills/PillView.swift index c041e7a15..881ace1dd 100644 --- a/ElementX/Sources/Other/Pills/PillView.swift +++ b/ElementX/Sources/Other/Pills/PillView.swift @@ -42,7 +42,7 @@ struct PillView: View { } struct PillView_Previews: PreviewProvider, TestablePreview { - static let mockMediaProvider = MediaProviderMock(configuration: .init()) + static let mockMediaProvider = MediaProviderMock(.init()) static var previews: some View { PillView(context: PillContext.mock(viewState: .mention(isOwnMention: false, diff --git a/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift b/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift index 6ede2a7e2..0ed769801 100644 --- a/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift +++ b/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift @@ -71,7 +71,7 @@ struct ShimmerOverlay_Previews: PreviewProvider, TestablePreview { static var previews: some View { VStack(spacing: 0) { ForEach(0...8, id: \.self) { _ in - HomeScreenRoomCell(room: .placeholder(), isSelected: false, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + HomeScreenRoomCell(room: .placeholder(), isSelected: false, mediaProvider: MediaProviderMock(.init())) { _ in } } } .redacted(reason: .placeholder) diff --git a/ElementX/Sources/Other/SwiftUI/Views/AvatarHeaderView.swift b/ElementX/Sources/Other/SwiftUI/Views/AvatarHeaderView.swift index 6b0e9170f..04a9c7198 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/AvatarHeaderView.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/AvatarHeaderView.swift @@ -256,7 +256,7 @@ struct AvatarHeaderView_Previews: PreviewProvider, TestablePreview { isDirect: false, historySharingState: nil), avatarSize: .room(on: .details), - mediaProvider: MediaProviderMock(configuration: .init())) { + mediaProvider: MediaProviderMock(.init())) { HStack(spacing: 32) { ShareLink(item: "test") { CompoundIcon(\.shareIos) @@ -270,7 +270,7 @@ struct AvatarHeaderView_Previews: PreviewProvider, TestablePreview { Form { AvatarHeaderView(accountOwner: RoomMemberDetails(withProxy: RoomMemberProxyMock.mockMe), dmRecipient: RoomMemberDetails(withProxy: RoomMemberProxyMock.mockAlice), - mediaProvider: MediaProviderMock(configuration: .init())) { + mediaProvider: MediaProviderMock(.init())) { HStack(spacing: 32) { ShareLink(item: "test") { CompoundIcon(\.shareIos) @@ -285,16 +285,16 @@ struct AvatarHeaderView_Previews: PreviewProvider, TestablePreview { VStack(spacing: 16) { AvatarHeaderView(member: RoomMemberDetails(withProxy: RoomMemberProxyMock.mockAlice), avatarSize: .room(on: .details), - mediaProvider: MediaProviderMock(configuration: .init())) { Text("") } + mediaProvider: MediaProviderMock(.init())) { Text("") } AvatarHeaderView(member: RoomMemberDetails(withProxy: RoomMemberProxyMock.mockBob), isVerified: true, avatarSize: .room(on: .details), - mediaProvider: MediaProviderMock(configuration: .init())) { Text("") } + mediaProvider: MediaProviderMock(.init())) { Text("") } AvatarHeaderView(member: RoomMemberDetails(withProxy: RoomMemberProxyMock.mockBanned[3]), avatarSize: .room(on: .details), - mediaProvider: MediaProviderMock(configuration: .init())) { Text("") } + mediaProvider: MediaProviderMock(.init())) { Text("") } } .padding() .background(Color.compound.bgSubtleSecondaryLevel0) @@ -319,7 +319,7 @@ struct AvatarHeaderView_Previews: PreviewProvider, TestablePreview { isDirect: false, historySharingState: state), avatarSize: .room(on: .details), - mediaProvider: MediaProviderMock(configuration: .init())) { + mediaProvider: MediaProviderMock(.init())) { HStack(spacing: 32) { ShareLink(item: "test") { CompoundIcon(\.shareIos) diff --git a/ElementX/Sources/Other/SwiftUI/Views/EditAvatarButtonStyle.swift b/ElementX/Sources/Other/SwiftUI/Views/EditAvatarButtonStyle.swift index 39018b906..e28b6a544 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/EditAvatarButtonStyle.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/EditAvatarButtonStyle.swift @@ -50,7 +50,7 @@ struct EditAvatarButtonStyle_Previews: PreviewProvider { LoadableAvatarImage(url: nil, name: "Test", contentID: "test", avatarSize: .user(on: .editUserDetails), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } .buttonStyle(EditAvatarButtonStyle()) @@ -58,7 +58,7 @@ struct EditAvatarButtonStyle_Previews: PreviewProvider { LoadableAvatarImage(url: nil, name: "Test", contentID: "test", avatarSize: .user(on: .editUserDetails), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } .buttonStyle(EditAvatarButtonStyle()) .disabled(true) diff --git a/ElementX/Sources/Other/SwiftUI/Views/JoinedMembersBadgeView.swift b/ElementX/Sources/Other/SwiftUI/Views/JoinedMembersBadgeView.swift index 6d9d48498..6f5d0e7cc 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/JoinedMembersBadgeView.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/JoinedMembersBadgeView.swift @@ -71,7 +71,7 @@ struct JoinedMembersBadgeView: View { // MARK: - Previews struct JoinedMembersBadgeView_Previews: PreviewProvider, TestablePreview { - static let mediaProvider = MediaProviderMock(configuration: .init()) + static let mediaProvider = MediaProviderMock(.init()) static var previews: some View { VStack(spacing: 16) { diff --git a/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift b/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift index 0904e9042..c02bca337 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift @@ -398,7 +398,7 @@ struct LoadableImage_Previews: PreviewProvider, TestablePreview { } static func makeMediaProvider(isLoading: Bool = false) -> MediaProviderProtocol { - let mediaProvider = MediaProviderMock(configuration: .init()) + let mediaProvider = MediaProviderMock(.init()) if isLoading { mediaProvider.imageFromSourceSizeClosure = { _, _ in nil } diff --git a/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift b/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift index c9f065313..f64acc6e9 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift @@ -141,7 +141,7 @@ struct LocationMarkerView_Previews: PreviewProvider, TestablePreview { // Static user with avatar LocationMarkerView(kind: .staticUser(.mockDan), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) // Static user without avatar LocationMarkerView(kind: .staticUser(.init(userID: "@someone:matrix.org", @@ -149,7 +149,7 @@ struct LocationMarkerView_Previews: PreviewProvider, TestablePreview { // Live user with avatar LocationMarkerView(kind: .liveUser(.mockDan), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) // Live user without avatar LocationMarkerView(kind: .liveUser(.init(userID: "@someone:matrix.org", diff --git a/ElementX/Sources/Other/SwiftUI/Views/RoomAvatarImage.swift b/ElementX/Sources/Other/SwiftUI/Views/RoomAvatarImage.swift index cb19fe6e7..a4ec63bf4 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/RoomAvatarImage.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/RoomAvatarImage.swift @@ -134,27 +134,27 @@ struct RoomAvatarImage_Previews: PreviewProvider, TestablePreview { name: "Room", avatarURL: nil), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomAvatarImage(avatar: .room(id: "!2:server.com", name: "Room", avatarURL: .mockMXCAvatar), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomAvatarImage(avatar: .space(id: "!space:server.com", name: "Room", avatarURL: nil), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomAvatarImage(avatar: .space(id: "!otherspace:server.com", name: "Room", avatarURL: .mockMXCAvatar), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) - RoomAvatarImage(avatar: .tombstoned, avatarSize: .room(on: .chats), mediaProvider: MediaProviderMock(configuration: .init())) + RoomAvatarImage(avatar: .tombstoned, avatarSize: .room(on: .chats), mediaProvider: MediaProviderMock(.init())) } HStack(spacing: 12) { @@ -162,18 +162,18 @@ struct RoomAvatarImage_Previews: PreviewProvider, TestablePreview { displayName: "User", avatarURL: nil)]), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomAvatarImage(avatar: .heroes([.init(userID: "@user:server.com", displayName: "User", avatarURL: .mockMXCAvatar)]), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomAvatarImage(avatar: .heroes([.init(userID: "@alice:server.com", displayName: "Alice", avatarURL: nil), .init(userID: "@bob:server.net", displayName: "Bob", avatarURL: nil)]), avatarSize: .room(on: .chats), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } } } diff --git a/ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift b/ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift index f19f859ac..c4f239fe0 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift @@ -140,7 +140,7 @@ struct RoomHeaderView_Previews: PreviewProvider, TestablePreview { dmRecipientVerificationState: verificationState, roomHistorySharingState: historySharingState, - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } .padding() } } diff --git a/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift b/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift index 09ab61915..687ae8ff8 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift @@ -65,13 +65,13 @@ struct RoomInviterLabel_Previews: PreviewProvider, TestablePreview { static var previews: some View { VStack(spacing: 10) { RoomInviterLabel(inviter: .init(member: RoomMemberProxyMock.mockAlice), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomInviterLabel(inviter: .init(member: RoomMemberProxyMock.mockDan), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomInviterLabel(inviter: .init(member: RoomMemberProxyMock.mockNoName), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) RoomInviterLabel(inviter: .init(member: RoomMemberProxyMock.mockCharlie), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .foregroundStyle(.compound.textPrimary) } .font(.compound.bodyMD) diff --git a/ElementX/Sources/Other/SwiftUI/Views/UserProfileListRow.swift b/ElementX/Sources/Other/SwiftUI/Views/UserProfileListRow.swift index 8a8b3a48d..3aff52387 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/UserProfileListRow.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/UserProfileListRow.swift @@ -68,21 +68,21 @@ struct UserProfileCell_Previews: PreviewProvider, TestablePreview { static var previews: some View { Form { - UserProfileListRow(user: .mockAlice, membership: nil, mediaProvider: MediaProviderMock(configuration: .init()), + UserProfileListRow(user: .mockAlice, membership: nil, mediaProvider: MediaProviderMock(.init()), kind: .multiSelection(isSelected: true, action: action)) - UserProfileListRow(user: .mockBob, membership: nil, mediaProvider: MediaProviderMock(configuration: .init()), + UserProfileListRow(user: .mockBob, membership: nil, mediaProvider: MediaProviderMock(.init()), kind: .multiSelection(isSelected: false, action: action)) - UserProfileListRow(user: .mockCharlie, membership: .join, mediaProvider: MediaProviderMock(configuration: .init()), + UserProfileListRow(user: .mockCharlie, membership: .join, mediaProvider: MediaProviderMock(.init()), kind: .multiSelection(isSelected: true, action: action)) .disabled(true) - UserProfileListRow(user: .init(userID: "@someone:matrix.org"), membership: .join, mediaProvider: MediaProviderMock(configuration: .init()), + UserProfileListRow(user: .init(userID: "@someone:matrix.org"), membership: .join, mediaProvider: MediaProviderMock(.init()), kind: .multiSelection(isSelected: false, action: action)) .disabled(true) - UserProfileListRow(user: .init(userID: "@someone:matrix.org"), membership: nil, mediaProvider: MediaProviderMock(configuration: .init()), + UserProfileListRow(user: .init(userID: "@someone:matrix.org"), membership: nil, mediaProvider: MediaProviderMock(.init()), kind: .multiSelection(isSelected: false, action: action)) } .compoundList() diff --git a/ElementX/Sources/Screens/Authentication/LoginScreen/View/LoginScreen.swift b/ElementX/Sources/Screens/Authentication/LoginScreen/View/LoginScreen.swift index b29772903..25da7739d 100644 --- a/ElementX/Sources/Screens/Authentication/LoginScreen/View/LoginScreen.swift +++ b/ElementX/Sources/Screens/Authentication/LoginScreen/View/LoginScreen.swift @@ -162,7 +162,7 @@ struct LoginScreen_Previews: PreviewProvider, TestablePreview { loginHint: nil, userIndicatorController: UserIndicatorControllerMock(), appSettings: .volatile(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) if withCredentials { viewModel.context.username = "alice" diff --git a/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/View/ServerConfirmationScreen.swift b/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/View/ServerConfirmationScreen.swift index a34575494..3bd6b3035 100644 --- a/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/View/ServerConfirmationScreen.swift +++ b/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/View/ServerConfirmationScreen.swift @@ -164,6 +164,6 @@ struct ServerConfirmationScreen_Previews: PreviewProvider, TestablePreview { mode: mode, authenticationFlow: flow, appSettings: .volatile(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/View/ServerSelectionScreen.swift b/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/View/ServerSelectionScreen.swift index e72059e5a..6451c10e4 100644 --- a/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/View/ServerSelectionScreen.swift +++ b/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/View/ServerSelectionScreen.swift @@ -117,7 +117,7 @@ struct ServerSelection_Previews: PreviewProvider, TestablePreview { let viewModel = ServerSelectionScreenViewModel(authenticationService: authenticationService, authenticationFlow: .login, appSettings: .volatile(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) viewModel.context.homeserverAddress = homeserverAddress if homeserverAddress == "thisisbad" { viewModel.context.send(viewAction: .confirm) diff --git a/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationClassicAppAccountView.swift b/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationClassicAppAccountView.swift index de053bd4a..b9c43a037 100644 --- a/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationClassicAppAccountView.swift +++ b/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationClassicAppAccountView.swift @@ -152,7 +152,7 @@ struct AuthenticationClassicAppAccountView_Previews: PreviewProvider { // Not Te isBugReportServiceEnabled: false, appMediator: AppMediatorMock(), appSettings: .volatile(), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationStartScreen.swift b/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationStartScreen.swift index 47b799cd4..786598ba0 100644 --- a/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationStartScreen.swift +++ b/ElementX/Sources/Screens/Authentication/StartScreen/View/AuthenticationStartScreen.swift @@ -196,7 +196,7 @@ struct AuthenticationStartScreen_Previews: PreviewProvider, TestablePreview { isBugReportServiceEnabled: true, appMediator: AppMediatorMock(), appSettings: .volatile(), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift index a2d38508d..951e7466b 100644 --- a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift +++ b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift @@ -374,6 +374,6 @@ struct CallScreen_Previews: PreviewProvider { colorScheme: .light), allowPictureInPicture: false, appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default) + analyticsService: AnalyticsServiceMock(.init())) } } diff --git a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift index 73d9b0e24..686def107 100644 --- a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift +++ b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift @@ -96,7 +96,7 @@ struct ChatsSpaceFilterCell: View { } struct ChatsSpaceFilterCell_Previews: PreviewProvider, TestablePreview { - static let mediaProvider = MediaProviderMock(configuration: .init()) + static let mediaProvider = MediaProviderMock(.init()) static let spaces = [SpaceServiceRoom].mockJoinedSpaces2 diff --git a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFiltersScreen.swift b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFiltersScreen.swift index 056d1f095..d2330df88 100644 --- a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFiltersScreen.swift +++ b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFiltersScreen.swift @@ -54,6 +54,6 @@ struct ChatsSpaceFiltersScreen_Previews: PreviewProvider, TestablePreview { static func makeViewModel() -> ChatsSpaceFiltersScreenViewModel { ChatsSpaceFiltersScreenViewModel(spaceService: SpaceServiceProxyMock(.populated), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } } diff --git a/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift b/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift index 99fdf03b4..2f41697df 100644 --- a/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift +++ b/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift @@ -227,8 +227,8 @@ struct PollFormScreen_Previews: PreviewProvider, TestablePreview { static func makeViewModel(mode: PollFormMode) -> PollFormScreenViewModel { PollFormScreenViewModel(mode: mode, timelineController: MockTimelineController(), - analytics: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analytics: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift index ad17321d3..1baa346ca 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift @@ -460,8 +460,8 @@ struct CreateRoom_Previews: PreviewProvider, TestablePreview { spaceSelectionMode: selectionMode, shouldShowCancelButton: isSpace, userSession: userSession, - analytics: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analytics: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), appSettings: appSettings) } } diff --git a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift index ea6612a7a..2cebea7eb 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift @@ -73,8 +73,8 @@ struct CreateRoomSpaceSelectionSheet_Previews: PreviewProvider, TestablePreview spaceSelectionMode: .editableSpacesList(preSelectedSpace: nil), shouldShowCancelButton: false, userSession: userSession, - analytics: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analytics: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), appSettings: appSettings) }() diff --git a/ElementX/Sources/Screens/FilePreviewScreen/TimelineMediaPreviewModifier.swift b/ElementX/Sources/Screens/FilePreviewScreen/TimelineMediaPreviewModifier.swift index 2014054cb..1c732d084 100644 --- a/ElementX/Sources/Screens/FilePreviewScreen/TimelineMediaPreviewModifier.swift +++ b/ElementX/Sources/Screens/FilePreviewScreen/TimelineMediaPreviewModifier.swift @@ -166,7 +166,7 @@ struct TimelineMediaPreviewModifier_Previews: PreviewProvider { let timelineController = MockTimelineController(timelineKind: .media(.mediaFilesScreen)) timelineController.timelineItems = [item] - let mediaProvider = MediaProviderMock(configuration: .init()) + let mediaProvider = MediaProviderMock(.init()) if isDownloading { mediaProvider.loadFileFromSourceFilenameClosure = { _, _ in diff --git a/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewDetailsView.swift b/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewDetailsView.swift index 721eb6f91..8505da802 100644 --- a/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewDetailsView.swift +++ b/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewDetailsView.swift @@ -230,7 +230,7 @@ struct TimelineMediaPreviewDetailsView_Previews: PreviewProvider, TestablePrevie let viewModel = TimelineMediaPreviewViewModel(initialItem: item, timelineViewModel: TimelineViewModel.mock(timelineKind: timelineKind, timelineController: timelineController), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), photoLibraryManager: PhotoLibraryManagerMock(.init()), userIndicatorController: UserIndicatorControllerMock(), appMediator: AppMediatorMock()) diff --git a/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewRedactConfirmationView.swift b/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewRedactConfirmationView.swift index d7eab8b4d..840b53c6f 100644 --- a/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewRedactConfirmationView.swift +++ b/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewRedactConfirmationView.swift @@ -147,7 +147,7 @@ struct TimelineMediaPreviewRedactConfirmationView_Previews: PreviewProvider, Tes return TimelineMediaPreviewViewModel(initialItem: item, timelineViewModel: TimelineViewModel.mock(timelineKind: timelineController.timelineKind, timelineController: timelineController), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), photoLibraryManager: PhotoLibraryManagerMock(.init()), userIndicatorController: UserIndicatorControllerMock(), appMediator: AppMediatorMock()) diff --git a/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreen.swift b/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreen.swift index 33f30e65b..97ae1cd58 100644 --- a/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreen.swift +++ b/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreen.swift @@ -207,7 +207,7 @@ private class GlobalSearchTextField: UITextField { struct GlobalSearchScreen_Previews: PreviewProvider, TestablePreview { static let viewModel = GlobalSearchScreenViewModel(roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) static var previews: some View { ElementNavigationStack { diff --git a/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift b/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift index 648bf4403..e02876a34 100644 --- a/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift +++ b/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift @@ -38,7 +38,7 @@ struct GlobalSearchScreenListRow: View { struct GlobalSearchScreenListRow_Previews: PreviewProvider, TestablePreview { static let viewModel = GlobalSearchScreenViewModel(roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) static var previews: some View { List { diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift index 90e702c3f..24cd17169 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift @@ -225,8 +225,8 @@ struct HomeScreen_Previews: PreviewProvider, TestablePreview { return HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: NotificationManagerMock(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift index 521a89121..d4148d087 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift @@ -146,8 +146,8 @@ struct HomeScreenEmptyStateView_Previews: PreviewProvider, TestablePreview { return HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: NotificationManagerMock(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) }() } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift index 8ea9fecbc..31ed08642 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift @@ -203,9 +203,9 @@ struct HomeScreenInviteCell_Previews: PreviewProvider, TestablePreview { return HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: NotificationManagerMock(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift index 4353589d5..b1cf99382 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift @@ -135,9 +135,9 @@ struct HomeScreenKnockedCell_Previews: PreviewProvider, TestablePreview { return HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: NotificationManagerMock(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift index b3550f876..fdf2ce95a 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift @@ -124,8 +124,8 @@ struct HomeScreenRecoveryKeyConfirmationBanner_Previews: PreviewProvider, Testab return HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: NotificationManagerMock(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift index b5a854ecb..c0e1fdb72 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift @@ -221,17 +221,17 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview { static var previews: some View { VStack(spacing: 0) { ForEach(genericRooms) { room in - HomeScreenRoomCell(room: room, isSelected: false, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + HomeScreenRoomCell(room: room, isSelected: false, mediaProvider: MediaProviderMock(.init())) { _ in } } - HomeScreenRoomCell(room: .placeholder(), isSelected: false, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + HomeScreenRoomCell(room: .placeholder(), isSelected: false, mediaProvider: MediaProviderMock(.init())) { _ in } .redacted(reason: .placeholder) } .previewDisplayName("Generic") VStack(spacing: 0) { ForEach(notificationsStateRooms) { room in - HomeScreenRoomCell(room: room, isSelected: false, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + HomeScreenRoomCell(room: room, isSelected: false, mediaProvider: MediaProviderMock(.init())) { _ in } } } .previewLayout(.sizeThatFits) @@ -239,7 +239,7 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview { VStack(spacing: 0) { ForEach(lastMessageStateRooms) { room in - HomeScreenRoomCell(room: room, isSelected: false, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + HomeScreenRoomCell(room: room, isSelected: false, mediaProvider: MediaProviderMock(.init())) { _ in } } } .previewLayout(.sizeThatFits) @@ -256,9 +256,9 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview { return HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: NotificationManagerMock(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } static func makeRoom(lastMessageState: RoomSummary.LastMessageState) -> HomeScreenRoom { diff --git a/ElementX/Sources/Screens/InviteUsersScreen/View/InviteUsersScreenSelectedItem.swift b/ElementX/Sources/Screens/InviteUsersScreen/View/InviteUsersScreenSelectedItem.swift index 4d205a78a..963a19430 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/View/InviteUsersScreenSelectedItem.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/View/InviteUsersScreenSelectedItem.swift @@ -64,7 +64,7 @@ struct InviteUsersScreenSelectedItem_Previews: PreviewProvider, TestablePreview ScrollView(.horizontal) { HStack(spacing: 8) { ForEach(people, id: \.userID) { user in - InviteUsersScreenSelectedItem(user: user, mediaProvider: MediaProviderMock(configuration: .init())) { } + InviteUsersScreenSelectedItem(user: user, mediaProvider: MediaProviderMock(.init())) { } .frame(width: 80) } } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index a6eedb47f..8c1b920c6 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -458,7 +458,7 @@ struct JoinRoomScreenPreviewWrapper: Identifiable { viewModel = JoinRoomScreenViewModel(source: source, appSettings: appSettings, userSession: UserSessionMock(.init(clientProxy: clientProxy)), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } var previewDisplayName: String { diff --git a/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModel.swift b/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModel.swift index d8fd248da..d81d9a499 100644 --- a/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModel.swift +++ b/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModel.swift @@ -394,8 +394,8 @@ extension LocationSharingScreenViewModel { roomProxy: roomProxy, timelineController: MockTimelineController(), liveLocationManager: LiveLocationManagerMock(), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } } diff --git a/ElementX/Sources/Screens/LocationSharing/View/UserLocationCell.swift b/ElementX/Sources/Screens/LocationSharing/View/UserLocationCell.swift index 7d21615d9..447c9c35f 100644 --- a/ElementX/Sources/Screens/LocationSharing/View/UserLocationCell.swift +++ b/ElementX/Sources/Screens/LocationSharing/View/UserLocationCell.swift @@ -90,19 +90,19 @@ struct UserLocationCell_Previews: PreviewProvider, TestablePreview { UserLocationCell(profile: .mockDan, isOwnUser: true, kind: .static(isUserLocation: true, timestamp: .mock), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .previewDisplayName("Stiatc user locaton") .previewLayout(.sizeThatFits) UserLocationCell(profile: .mockDan, isOwnUser: false, kind: .static(isUserLocation: false, timestamp: .mock), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .previewDisplayName("Static pin location") .previewLayout(.sizeThatFits) UserLocationCell(profile: .mockDan, isOwnUser: true, kind: .live, - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .previewDisplayName("Live location") .previewLayout(.sizeThatFits) } diff --git a/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/View/ManageAuthorizedSpacesScreen.swift b/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/View/ManageAuthorizedSpacesScreen.swift index 108207243..50656b4e2 100644 --- a/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/View/ManageAuthorizedSpacesScreen.swift +++ b/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/View/ManageAuthorizedSpacesScreen.swift @@ -109,7 +109,7 @@ struct ManageAuthorizedSpacesScreen_Previews: PreviewProvider, TestablePreview { initialSelectedIDs: ["space1", "space3", "!unknown-space-id-2"]), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) static var previews: some View { ElementNavigationStack { diff --git a/ElementX/Sources/Screens/ManageRoomMemberSheet/View/ManageRoomMemberSheetView.swift b/ElementX/Sources/Screens/ManageRoomMemberSheet/View/ManageRoomMemberSheetView.swift index 67bc7a328..dd7c3b817 100644 --- a/ElementX/Sources/Screens/ManageRoomMemberSheet/View/ManageRoomMemberSheetView.swift +++ b/ElementX/Sources/Screens/ManageRoomMemberSheet/View/ManageRoomMemberSheetView.swift @@ -120,7 +120,7 @@ private extension ManageRoomMemberSheetViewModel { ownPowerLevel: powerLevel), roomProxy: JoinedRoomProxyMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - analyticsService: AnalyticsServiceMock.default, - mediaProvider: MediaProviderMock(configuration: .init())) + analyticsService: AnalyticsServiceMock(.init()), + mediaProvider: MediaProviderMock(.init())) } } diff --git a/ElementX/Sources/Screens/MediaEventsTimelineScreen/View/MediaEventsTimelineScreen.swift b/ElementX/Sources/Screens/MediaEventsTimelineScreen/View/MediaEventsTimelineScreen.swift index 0b491e1cb..12b35e528 100644 --- a/ElementX/Sources/Screens/MediaEventsTimelineScreen/View/MediaEventsTimelineScreen.swift +++ b/ElementX/Sources/Screens/MediaEventsTimelineScreen/View/MediaEventsTimelineScreen.swift @@ -298,7 +298,7 @@ struct MediaEventsTimelineScreen_Previews: PreviewProvider, TestablePreview { MediaEventsTimelineScreenViewModel(mediaTimelineViewModel: makeTimelineViewModel(empty: empty), filesTimelineViewModel: makeTimelineViewModel(empty: empty), initialScreenMode: screenMode, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), userIndicatorController: UserIndicatorControllerMock(), appMediator: AppMediatorMock()) } @@ -316,9 +316,9 @@ struct MediaEventsTimelineScreen_Previews: PreviewProvider, TestablePreview { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: UserIndicatorControllerMock(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift b/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift index 60edb4cdb..1d03b13c8 100644 --- a/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift +++ b/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift @@ -374,7 +374,7 @@ struct MediaUploadPreviewScreen_Previews: PreviewProvider, TestablePreview { mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: .volatile()), timelineController: MockTimelineController(), clientProxy: ClientProxyMock(.init()), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) static var previews: some View { ElementNavigationStack { MediaUploadPreviewScreen(context: viewModel.context) diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift index 7f07c179c..d4636d0c2 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift @@ -141,6 +141,6 @@ struct IdentityConfirmationScreen_Previews: PreviewProvider, TestablePreview { return IdentityConfirmationScreenViewModel(userSession: userSession, appSettings: .volatile(), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationRequestDetailsView.swift b/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationRequestDetailsView.swift index 04172f6d2..fb22fd0e4 100644 --- a/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationRequestDetailsView.swift +++ b/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationRequestDetailsView.swift @@ -121,13 +121,13 @@ struct SessionVerificationRequestDetailsView_Previews: PreviewProvider, Testable static var previews: some View { SessionVerificationRequestDetailsView(details: details, isUserVerification: true, - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .padding() .previewDisplayName("User") SessionVerificationRequestDetailsView(details: details, isUserVerification: false, - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .padding() .previewDisplayName("Device") } diff --git a/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationScreen.swift b/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationScreen.swift index 01eda6c5b..ac6db74ef 100644 --- a/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationScreen.swift +++ b/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationScreen.swift @@ -290,7 +290,7 @@ struct SessionVerification_Previews: PreviewProvider, TestablePreview { let viewModel = SessionVerificationScreenViewModel(sessionVerificationControllerProxy: SessionVerificationControllerProxyMock.configureMock(), flow: flow, appSettings: .volatile(), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), verificationState: state) return SessionVerificationScreen(context: viewModel.context) diff --git a/ElementX/Sources/Screens/PinnedEventsTimelineScreen/View/PinnedEventsTimelineScreen.swift b/ElementX/Sources/Screens/PinnedEventsTimelineScreen/View/PinnedEventsTimelineScreen.swift index 53bb444f3..ed80c9b72 100644 --- a/ElementX/Sources/Screens/PinnedEventsTimelineScreen/View/PinnedEventsTimelineScreen.swift +++ b/ElementX/Sources/Screens/PinnedEventsTimelineScreen/View/PinnedEventsTimelineScreen.swift @@ -69,7 +69,7 @@ struct PinnedEventsTimelineScreen_Previews: PreviewProvider, TestablePreview { static let viewModel = PinnedEventsTimelineScreenViewModel(roomProxy: JoinedRoomProxyMock(.init()), userIndicatorController: UserIndicatorControllerMock(), appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default) + analyticsService: AnalyticsServiceMock(.init())) static let emptyTimelineViewModel: TimelineViewModel = { let timelineController = MockTimelineController(timelineKind: .pinned) @@ -82,9 +82,9 @@ struct PinnedEventsTimelineScreen_Previews: PreviewProvider, TestablePreview { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: UserIndicatorControllerMock(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModel.swift b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModel.swift index 15a3a7250..c6136019a 100644 --- a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModel.swift +++ b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModel.swift @@ -340,7 +340,7 @@ class QRCodeLoginScreenViewModel: QRCodeLoginScreenViewModelType, QRCodeLoginScr /// Only for mocking initial states fileprivate init(state: QRCodeLoginState, mode: QRCodeLoginScreenMode, canSignInManually: Bool, checkCodeInput: String) { - appMediator = AppMediatorMock.default + appMediator = AppMediatorMock(.init()) super.init(initialViewState: .init(state: state, mode: mode, canSignInManually: canSignInManually, diff --git a/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift b/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift index 3fa00a1e3..0956a1833 100644 --- a/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift +++ b/ElementX/Sources/Screens/RoomChangePermissionsScreen/View/RoomChangePermissionsScreen.swift @@ -91,6 +91,6 @@ struct RoomChangePermissionsScreen_Previews: PreviewProvider, TestablePreview { ownPowerLevel: ownPowerLevel, roomProxy: JoinedRoomProxyMock(.init(isSpace: isSpace)), userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) } } diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift index 053858d88..45d640648 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreen.swift @@ -149,8 +149,8 @@ struct RoomChangeRolesScreen_Previews: PreviewProvider, TestablePreview { return RoomChangeRolesScreenViewModel(mode: mode, roomProxy: JoinedRoomProxyMock(.init(members: members)), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) } } diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenRow.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenRow.swift index 9e7c6f7fa..1deb5465a 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenRow.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenRow.swift @@ -40,34 +40,34 @@ struct RoomChangeRolesScreenRow_Previews: PreviewProvider, TestablePreview { static var previews: some View { Form { RoomChangeRolesScreenRow(member: .init(withProxy: RoomMemberProxyMock.mockAlice), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), isSelected: true, action: action) RoomChangeRolesScreenRow(member: .init(withProxy: RoomMemberProxyMock.mockBob), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), isSelected: false, action: action) RoomChangeRolesScreenRow(member: .init(withProxy: RoomMemberProxyMock.mockInvited), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), isSelected: false, action: action) RoomChangeRolesScreenRow(member: .init(withProxy: RoomMemberProxyMock.mockCharlie), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), isSelected: true, action: action) .disabled(true) RoomChangeRolesScreenRow(member: .init(withProxy: RoomMemberProxyMock(with: .init(userID: "@someone:matrix.org", membership: .join))), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), isSelected: false, action: action) .disabled(true) RoomChangeRolesScreenRow(member: .init(withProxy: RoomMemberProxyMock(with: .init(userID: "@someone:matrix.org", membership: .join))), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), isSelected: false, action: action) } diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenSelectedItem.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenSelectedItem.swift index 28b3b05af..bde489788 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenSelectedItem.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/View/RoomChangeRolesScreenSelectedItem.swift @@ -76,7 +76,7 @@ struct RoomChangeRolesScreenSelectedItem_Previews: PreviewProvider, TestablePrev HStack(spacing: 12) { ForEach(members, id: \.id) { member in RoomChangeRolesScreenSelectedItem(member: member, - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } .frame(width: 72) } } diff --git a/ElementX/Sources/Screens/RoomDetailsEditScreen/View/RoomDetailsEditScreen.swift b/ElementX/Sources/Screens/RoomDetailsEditScreen/View/RoomDetailsEditScreen.swift index 9c5d45b3c..364c3591b 100644 --- a/ElementX/Sources/Screens/RoomDetailsEditScreen/View/RoomDetailsEditScreen.swift +++ b/ElementX/Sources/Screens/RoomDetailsEditScreen/View/RoomDetailsEditScreen.swift @@ -178,6 +178,6 @@ struct RoomDetailsEditScreen_Previews: PreviewProvider, TestablePreview { return RoomDetailsEditScreenViewModel(roomProxy: roomProxy, userSession: UserSessionMock(.init()), mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: .volatile()), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/View/RoomDetailsScreen.swift b/ElementX/Sources/Screens/RoomDetailsScreen/View/RoomDetailsScreen.swift index c04e4db43..08c27d7ac 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/View/RoomDetailsScreen.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/View/RoomDetailsScreen.swift @@ -420,8 +420,8 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview { return .init(roomProxy: roomProxy, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxy, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -448,8 +448,8 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview { return .init(roomProxy: roomProxy, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxy, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -474,9 +474,9 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview { clientProxyMock.userIdentityForFallBackToServerClosure = { userID, _ in let identity = switch userID { case RoomMemberProxyMock.mockDan.userID: - UserIdentityProxyMock(configuration: .init(verificationState: verificationState)) + UserIdentityProxyMock(.init(verificationState: verificationState)) default: - UserIdentityProxyMock(configuration: .init()) + UserIdentityProxyMock(.init()) } return .success(identity) @@ -486,8 +486,8 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview { return .init(roomProxy: roomProxy, userSession: UserSessionMock(.init(clientProxy: clientProxyMock)), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxy, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) diff --git a/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectoryCell.swift b/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectoryCell.swift index 2aaccde5f..0e2cd8e1a 100644 --- a/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectoryCell.swift +++ b/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectoryCell.swift @@ -56,7 +56,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: "Test title", avatarURL: nil), canBeJoined: true), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_2:matrix.org", alias: "#test:example.com", @@ -66,7 +66,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: nil, avatarURL: nil), canBeJoined: true), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_3:example.com", alias: "#test_no_topic:example.com", @@ -76,7 +76,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: "Test title no topic", avatarURL: nil), canBeJoined: true), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_4:example.com", alias: "#test_no_topic:example.com", @@ -86,7 +86,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: nil, avatarURL: nil), canBeJoined: true), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_5:example.com", alias: nil, @@ -96,7 +96,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: "Test title no alias", avatarURL: nil), canBeJoined: false), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_6:example.com", alias: nil, @@ -106,7 +106,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: "Test title no alias", avatarURL: nil), canBeJoined: false), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_7:example.com", alias: nil, @@ -116,7 +116,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: nil, avatarURL: nil), canBeJoined: false), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } RoomDirectorySearchCell(result: .init(id: "!test_id_8:example.com", alias: nil, name: nil, @@ -125,7 +125,7 @@ struct RoomDirectorySearchCell_Previews: PreviewProvider, TestablePreview { name: nil, avatarURL: nil), canBeJoined: false), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } } .compoundList() } diff --git a/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectorySearchScreen.swift b/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectorySearchScreen.swift index 893d0638a..749dc41cf 100644 --- a/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectorySearchScreen.swift +++ b/ElementX/Sources/Screens/RoomDirectorySearchScreen/View/RoomDirectorySearchScreen.swift @@ -88,7 +88,7 @@ struct RoomDirectorySearchScreen_Previews: PreviewProvider, TestablePreview { avatarURL: .mockMXCAvatar), canBeJoined: false)] - let roomDirectorySearchProxy = RoomDirectorySearchProxyMock(configuration: .init(results: results)) + let roomDirectorySearchProxy = RoomDirectorySearchProxyMock(.init(results: results)) let clientProxy = ClientProxyMock(.init(roomDirectorySearchProxy: roomDirectorySearchProxy)) diff --git a/ElementX/Sources/Screens/RoomMemberDetailsScreen/View/RoomMemberDetailsScreen.swift b/ElementX/Sources/Screens/RoomMemberDetailsScreen/View/RoomMemberDetailsScreen.swift index 76bfb3e49..8f40a133a 100644 --- a/ElementX/Sources/Screens/RoomMemberDetailsScreen/View/RoomMemberDetailsScreen.swift +++ b/ElementX/Sources/Screens/RoomMemberDetailsScreen/View/RoomMemberDetailsScreen.swift @@ -221,11 +221,11 @@ struct RoomMemberDetailsScreen_Previews: PreviewProvider, TestablePreview { clientProxyMock.userIdentityForFallBackToServerClosure = { userID, _ in let identity = switch userID { case RoomMemberProxyMock.mockDan.userID: - UserIdentityProxyMock(configuration: .init(verificationState: .verified)) + UserIdentityProxyMock(.init(verificationState: .verified)) case RoomMemberProxyMock.mockBob.userID: - UserIdentityProxyMock(configuration: .init(verificationState: .verificationViolation)) + UserIdentityProxyMock(.init(verificationState: .verificationViolation)) default: - UserIdentityProxyMock(configuration: .init()) + UserIdentityProxyMock(.init()) } return .success(identity) @@ -239,8 +239,8 @@ struct RoomMemberDetailsScreen_Previews: PreviewProvider, TestablePreview { return RoomMemberDetailsScreenViewModel(userID: member.userID, roomProxy: roomProxyMock, userSession: UserSessionMock(.init(clientProxy: clientProxyMock)), - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default, + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init()), appSettings: .volatile()) } } diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift index 82454f579..20e1adf8a 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift @@ -245,11 +245,11 @@ struct RoomMembersListScreen_Previews: PreviewProvider, TestablePreview { clientProxyMock.userIdentityForFallBackToServerClosure = { userID, _ in let identity = switch userID { case RoomMemberProxyMock.mockAlice.userID: - UserIdentityProxyMock(configuration: .init(verificationState: .verified)) + UserIdentityProxyMock(.init(verificationState: .verified)) case RoomMemberProxyMock.mockBob.userID: - UserIdentityProxyMock(configuration: .init(verificationState: .verificationViolation)) + UserIdentityProxyMock(.init(verificationState: .verificationViolation)) default: - UserIdentityProxyMock(configuration: .init()) + UserIdentityProxyMock(.init()) } return .success(identity) @@ -261,7 +261,7 @@ struct RoomMembersListScreen_Previews: PreviewProvider, TestablePreview { members: members, ownUserID: ownUserID, powerLevelsConfiguration: .init(canUserInvite: false))), - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default) + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init())) } } diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreenMemberCell.swift b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreenMemberCell.swift index c85506108..3e2dea229 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreenMemberCell.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreenMemberCell.swift @@ -131,8 +131,8 @@ struct RoomMembersListMemberCell_Previews: PreviewProvider, TestablePreview { static let viewModel = RoomMembersListScreenViewModel(userSession: UserSessionMock(.init()), roomProxy: JoinedRoomProxyMock(.init(name: "Some room", members: [])), - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default) + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init())) static var previews: some View { VStack(spacing: 0) { Section("Invited/Joined") { diff --git a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/View/RoomRolesAndPermissionsScreen.swift b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/View/RoomRolesAndPermissionsScreen.swift index 8bc94e74a..8de4b3536 100644 --- a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/View/RoomRolesAndPermissionsScreen.swift +++ b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/View/RoomRolesAndPermissionsScreen.swift @@ -121,12 +121,12 @@ struct RoomRolesAndPermissionsScreen_Previews: PreviewProvider, TestablePreview static let viewModel = RoomRolesAndPermissionsScreenViewModel(initialPermissions: RoomPermissions(powerLevels: .mock), roomProxy: JoinedRoomProxyMock(.init(members: .allMembersAsAdmin)), userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) static let creatorViewModel = RoomRolesAndPermissionsScreenViewModel(initialPermissions: RoomPermissions(powerLevels: .mock), roomProxy: JoinedRoomProxyMock(.init(members: .allMembersAsCreator)), userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) static var previews: some View { ElementNavigationStack { RoomRolesAndPermissionsScreen(context: viewModel.context) diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift index f095edc43..ac75d5e14 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift @@ -824,10 +824,10 @@ extension ComposerToolbarViewModel { let viewModel = ComposerToolbarViewModel(roomProxy: roomProxy, wysiwygViewModel: wysiwygViewModel, completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init(suggestions: suggestions)), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: .volatile(), - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: ComposerDraftServiceMock(.init())) viewModel.state.bindings.composerFocused = focused viewModel.state.bindings.plainComposerText = NSAttributedString(string: message) diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/CompletionSuggestionView.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/CompletionSuggestionView.swift index 4afa789bd..90d5e77c7 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/CompletionSuggestionView.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/CompletionSuggestionView.swift @@ -109,13 +109,13 @@ struct CompletionSuggestion_Previews: PreviewProvider, TestablePreview { static var previews: some View { // Putting them is VStack allows the preview to work properly in tests VStack(spacing: 8) { - CompletionSuggestionView(mediaProvider: MediaProviderMock(configuration: .init()), + CompletionSuggestionView(mediaProvider: MediaProviderMock(.init()), items: [.init(suggestionType: .user(.init(id: "@user_mention_1:matrix.org", displayName: "User 1", avatarURL: nil)), range: .init(), rawSuggestionText: ""), .init(suggestionType: .user(.init(id: "@user_mention_2:matrix.org", displayName: "User 2", avatarURL: .mockMXCUserAvatar)), range: .init(), rawSuggestionText: "")]) { _ in } } VStack(spacing: 8) { - CompletionSuggestionView(mediaProvider: MediaProviderMock(configuration: .init()), + CompletionSuggestionView(mediaProvider: MediaProviderMock(.init()), items: multipleItems) { _ in } } } diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MentionSuggestionItemView.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MentionSuggestionItemView.swift index fac3dce72..a5240e1be 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MentionSuggestionItemView.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MentionSuggestionItemView.swift @@ -46,7 +46,7 @@ struct MentionSuggestionItemView: View { } struct MentionSuggestionItemView_Previews: PreviewProvider, TestablePreview { - static let mockMediaProvider = MediaProviderMock(configuration: .init()) + static let mockMediaProvider = MediaProviderMock(.init()) static var previews: some View { MentionSuggestionItemView(mediaProvider: mockMediaProvider, item: .init(suggestionType: .user(.init(id: "test", displayName: "Test", avatarURL: .mockMXCUserAvatar)), range: .init(), rawSuggestionText: "")) diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/RoomAttachmentPicker.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/RoomAttachmentPicker.swift index 007823c1c..bb4966de3 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/RoomAttachmentPicker.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/RoomAttachmentPicker.swift @@ -86,10 +86,10 @@ struct RoomAttachmentPicker_Previews: PreviewProvider, TestablePreview { return ComposerToolbarViewModel(roomProxy: JoinedRoomProxyMock(.init()), wysiwygViewModel: WysiwygComposerViewModel(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: ComposerDraftServiceMock(.init())) } diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift index 7770a7a25..728b02757 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift @@ -463,8 +463,8 @@ extension RoomScreenViewModel { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: .volatile(), appHooks: appHooks, - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift b/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift index b9d3ea981..5240c970a 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/RoomScreen.swift @@ -367,10 +367,10 @@ struct RoomScreen_Previews: PreviewProvider, TestablePreview { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomScreenFooterView.swift b/ElementX/Sources/Screens/RoomScreen/View/RoomScreenFooterView.swift index e08f63c3a..e71267722 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/RoomScreenFooterView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/RoomScreenFooterView.swift @@ -165,11 +165,11 @@ struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview { learnMoreURL: "https://element.io/") static var previews: some View { - RoomScreenFooterView(details: bobDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + RoomScreenFooterView(details: bobDetails, mediaProvider: MediaProviderMock(.init())) { _ in } .previewDisplayName("With displayname") - RoomScreenFooterView(details: noNameDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + RoomScreenFooterView(details: noNameDetails, mediaProvider: MediaProviderMock(.init())) { _ in } .previewDisplayName("Without displayname") - RoomScreenFooterView(details: verificationViolationDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in } + RoomScreenFooterView(details: verificationViolationDetails, mediaProvider: MediaProviderMock(.init())) { _ in } .previewDisplayName("Verification Violation") } } diff --git a/ElementX/Sources/Screens/RoomThreadListScreen/View/RoomThreadListScreen.swift b/ElementX/Sources/Screens/RoomThreadListScreen/View/RoomThreadListScreen.swift index b24593fed..26eac35b1 100644 --- a/ElementX/Sources/Screens/RoomThreadListScreen/View/RoomThreadListScreen.swift +++ b/ElementX/Sources/Screens/RoomThreadListScreen/View/RoomThreadListScreen.swift @@ -161,6 +161,6 @@ struct RoomThreadListScreen_Previews: PreviewProvider, TestablePreview { static func makeViewModel() -> RoomThreadListScreenViewModel { RoomThreadListScreenViewModel(threadListServiceProxy: RoomThreadListServiceProxyMock(.init()), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } } diff --git a/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/View/AdvancedSettingsScreen.swift b/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/View/AdvancedSettingsScreen.swift index dca4b3bd6..8b47f2da8 100644 --- a/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/View/AdvancedSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/View/AdvancedSettingsScreen.swift @@ -163,9 +163,9 @@ struct AdvancedSettingsScreen_Previews: PreviewProvider, TestablePreview { static let viewModel = { let appSettings = AppSettings.volatile() return AdvancedSettingsScreenViewModel(advancedSettings: appSettings, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), clientProxy: ClientProxyMock(.init()), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) }() static var previews: some View { diff --git a/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/View/AnalyticsSettingsScreen.swift b/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/View/AnalyticsSettingsScreen.swift index 6a35c809f..df423bb7e 100644 --- a/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/View/AnalyticsSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/View/AnalyticsSettingsScreen.swift @@ -41,7 +41,7 @@ struct AnalyticsSettingsScreen_Previews: PreviewProvider, TestablePreview { static var previews: some View { let appSettings = AppSettings.volatile() let viewModel = AnalyticsSettingsScreenViewModel(appSettings: appSettings, - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) AnalyticsSettingsScreen(context: viewModel.context) } } diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift index 1fbf50ba6..b53203aa1 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift @@ -283,9 +283,9 @@ struct NotificationSettingsScreen_Previews: PreviewProvider, TestablePreview { var viewModel = NotificationSettingsScreenViewModel(appSettings: appSettings, userNotificationCenter: notificationCenter, - notificationToneManager: NotificationToneManagerMock.default, + notificationToneManager: NotificationToneManagerMock(.init()), notificationSettingsProxy: notificationSettingsProxy, - userIndicatorController: UserIndicatorControllerMock.default, + userIndicatorController: UserIndicatorControllerMock(), isModallyPresented: true) viewModel.fetchInitialContent() return viewModel @@ -313,7 +313,7 @@ struct NotificationSettingsScreen_Previews: PreviewProvider, TestablePreview { var viewModel = NotificationSettingsScreenViewModel(appSettings: appSettings, userNotificationCenter: notificationCenter, - notificationToneManager: NotificationToneManagerMock.default, + notificationToneManager: NotificationToneManagerMock(.init()), notificationSettingsProxy: notificationSettingsProxy, userIndicatorController: UserIndicatorControllerMock(), isModallyPresented: true) diff --git a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/View/UserDetailsEditScreen.swift b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/View/UserDetailsEditScreen.swift index 82047193f..3e09bfd06 100644 --- a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/View/UserDetailsEditScreen.swift +++ b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/View/UserDetailsEditScreen.swift @@ -142,6 +142,6 @@ struct UserDetailsEditScreen_Previews: PreviewProvider, TestablePreview { canChangeAvatar: canChangeProfile, canChangeDisplayName: canChangeProfile)))), mediaUploadingPreprocessor: .init(appSettings: .volatile()), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/ElementX/Sources/Screens/Spaces/Common/SpaceHeaderView.swift b/ElementX/Sources/Screens/Spaces/Common/SpaceHeaderView.swift index cfdf50b3a..262e11cca 100644 --- a/ElementX/Sources/Screens/Spaces/Common/SpaceHeaderView.swift +++ b/ElementX/Sources/Screens/Spaces/Common/SpaceHeaderView.swift @@ -101,7 +101,7 @@ struct SpaceHeaderView: View { // MARK: - Previews struct SpaceHeaderView_Previews: PreviewProvider, TestablePreview { - static let mediaProvider = MediaProviderMock(configuration: .init()) + static let mediaProvider = MediaProviderMock(.init()) static let spaces = makeSpaceRooms() diff --git a/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift b/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift index 6b6796f53..dcb1cfb9a 100644 --- a/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift +++ b/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift @@ -167,7 +167,7 @@ struct SpaceRoomCellButtonStyle: ButtonStyle { } struct SpaceRoomCell_Previews: PreviewProvider, TestablePreview { - static let mediaProvider = MediaProviderMock(configuration: .init()) + static let mediaProvider = MediaProviderMock(.init()) static let spaces = [SpaceServiceRoom].mockSpaceList diff --git a/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceRoomDetailsCell.swift b/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceRoomDetailsCell.swift index 989edb446..32a9d4c9e 100644 --- a/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceRoomDetailsCell.swift +++ b/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceRoomDetailsCell.swift @@ -96,14 +96,14 @@ struct LeaveSpaceRoomDetailsCell_Previews: PreviewProvider, TestablePreview { isLastOwner: false, areCreatorsPrivileged: false, isSelected: true), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } LeaveSpaceRoomDetailsCell(room: .init(spaceServiceRoom: SpaceServiceRoom.mock(id: "2", name: "My Space", isSpace: true), isLastOwner: true, areCreatorsPrivileged: false, isSelected: false), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } LeaveSpaceRoomDetailsCell(room: .init(spaceServiceRoom: SpaceServiceRoom.mock(id: "2", name: "My Space", isSpace: true), @@ -111,21 +111,21 @@ struct LeaveSpaceRoomDetailsCell_Previews: PreviewProvider, TestablePreview { areCreatorsPrivileged: false, isSelected: false), hideSelection: true, - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } LeaveSpaceRoomDetailsCell(room: .init(spaceServiceRoom: SpaceServiceRoom.mock(id: "3", name: "Room", isSpace: false), isLastOwner: false, areCreatorsPrivileged: false, isSelected: true), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } LeaveSpaceRoomDetailsCell(room: .init(spaceServiceRoom: SpaceServiceRoom.mock(id: "4", name: "My Room", isSpace: false), isLastOwner: true, areCreatorsPrivileged: false, isSelected: false), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } LeaveSpaceRoomDetailsCell(room: .init(spaceServiceRoom: SpaceServiceRoom.mock(id: "4", name: "My Room", isSpace: false), @@ -133,7 +133,7 @@ struct LeaveSpaceRoomDetailsCell_Previews: PreviewProvider, TestablePreview { areCreatorsPrivileged: false, isSelected: false), hideSelection: true, - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } } } } diff --git a/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceView.swift b/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceView.swift index 31ab6e469..aec115175 100644 --- a/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceView.swift +++ b/ElementX/Sources/Screens/Spaces/LeaveSpace/View/LeaveSpaceView.swift @@ -177,6 +177,6 @@ struct LeaveSpaceView_Previews: PreviewProvider, TestablePreview { canEditRolesAndPermissions: true, leaveHandle: leaveHandle, userIndicatorController: UserIndicatorControllerMock(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } } diff --git a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreenSelectedItem.swift b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreenSelectedItem.swift index 936d15eef..7c842bcf2 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreenSelectedItem.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreenSelectedItem.swift @@ -46,7 +46,7 @@ struct SpaceAddRoomsScreenSelectedItem_Previews: PreviewProvider, TestablePrevie avatar: .room(id: "", name: "Selected Room", avatarURL: .mockMXCAvatar)), - mediaProvider: MediaProviderMock(configuration: .init())) { } + mediaProvider: MediaProviderMock(.init())) { } .frame(width: 80) } } diff --git a/ElementX/Sources/Screens/Spaces/SpaceSettingsScreen/View/SpaceSettingsScreen.swift b/ElementX/Sources/Screens/Spaces/SpaceSettingsScreen/View/SpaceSettingsScreen.swift index cc03c045b..339ac6cad 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceSettingsScreen/View/SpaceSettingsScreen.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceSettingsScreen/View/SpaceSettingsScreen.swift @@ -132,8 +132,8 @@ struct SpaceSettingsScreen_Previews: PreviewProvider, TestablePreview { canonicalAlias: "#space:matrix.org", members: members)), userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) diff --git a/ElementX/Sources/Screens/StartChatScreen/View/JoinRoomByAddressView.swift b/ElementX/Sources/Screens/StartChatScreen/View/JoinRoomByAddressView.swift index 24066e0d9..49450fdf9 100644 --- a/ElementX/Sources/Screens/StartChatScreen/View/JoinRoomByAddressView.swift +++ b/ElementX/Sources/Screens/StartChatScreen/View/JoinRoomByAddressView.swift @@ -84,7 +84,7 @@ struct JoinRoomByAddressView_Previews: PreviewProvider, TestablePreview { userDiscoveryService.searchProfilesWithReturnValue = .success([.mockAlice]) return StartChatScreenViewModel(userSession: userSession, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), userDiscoveryService: userDiscoveryService, appSettings: .volatile()) diff --git a/ElementX/Sources/Screens/StartChatScreen/View/StartChatScreen.swift b/ElementX/Sources/Screens/StartChatScreen/View/StartChatScreen.swift index e280aad03..6d9f151aa 100644 --- a/ElementX/Sources/Screens/StartChatScreen/View/StartChatScreen.swift +++ b/ElementX/Sources/Screens/StartChatScreen/View/StartChatScreen.swift @@ -159,7 +159,7 @@ struct StartChatScreen_Previews: PreviewProvider, TestablePreview { let userDiscoveryService = UserDiscoveryServiceMock() userDiscoveryService.searchProfilesWithReturnValue = .success([.mockAlice]) return StartChatScreenViewModel(userSession: userSession, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), userDiscoveryService: userDiscoveryService, appSettings: appSettings) diff --git a/ElementX/Sources/Screens/Timeline/TimelineViewModel.swift b/ElementX/Sources/Screens/Timeline/TimelineViewModel.swift index f4eb57462..b69fbed79 100644 --- a/ElementX/Sources/Screens/Timeline/TimelineViewModel.swift +++ b/ElementX/Sources/Screens/Timeline/TimelineViewModel.swift @@ -1128,10 +1128,10 @@ extension TimelineViewModel { timelineController: timelineController ?? MockTimelineController(timelineKind: timelineKind), userSession: UserSessionMock(.init(clientProxy: clientProxyMock)), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift b/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift index 01e1c8ac2..1d614282e 100644 --- a/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift +++ b/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift @@ -64,18 +64,18 @@ struct ReadReceiptCell_Previews: PreviewProvider, TestablePreview { formattedTimestamp: "10:00"), memberState: .init(displayName: "Test", avatarURL: nil), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .previewDisplayName("No Image") ReadReceiptCell(readReceipt: .init(userID: "@test:matrix.org", formattedTimestamp: "10:00"), memberState: .init(displayName: "Test", avatarURL: .mockMXCUserAvatar), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .previewDisplayName("With Image") ReadReceiptCell(readReceipt: .init(userID: "@test:matrix.org", formattedTimestamp: "10:00"), memberState: nil, - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) .previewDisplayName("Loading Member") } } diff --git a/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptsSummaryView.swift b/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptsSummaryView.swift index b57ba5253..63b9964fb 100644 --- a/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptsSummaryView.swift +++ b/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptsSummaryView.swift @@ -52,9 +52,9 @@ struct ReadReceiptsSummaryView_Previews: PreviewProvider, TestablePreview { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: UserIndicatorControllerMock(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift index 0bd21eba0..a3f0830b9 100644 --- a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift @@ -343,10 +343,10 @@ struct TimelineItemBubbledStylerView_Previews: PreviewProvider, TestablePreview timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -362,10 +362,10 @@ struct TimelineItemBubbledStylerView_Previews: PreviewProvider, TestablePreview timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/Timeline/View/Supplementary/ReactionsSummaryView.swift b/ElementX/Sources/Screens/Timeline/View/Supplementary/ReactionsSummaryView.swift index 3e28ce745..ae6837dc1 100644 --- a/ElementX/Sources/Screens/Timeline/View/Supplementary/ReactionsSummaryView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Supplementary/ReactionsSummaryView.swift @@ -140,7 +140,7 @@ struct ReactionsSummaryView_Previews: PreviewProvider, TestablePreview { static var previews: some View { ReactionsSummaryView(reactions: AggregatedReaction.mockReactions, members: [:], - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), selectedReactionKey: AggregatedReaction.mockReactions[0].key) } } diff --git a/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReadReceiptsView.swift b/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReadReceiptsView.swift index 25b037c12..3a8dc4827 100644 --- a/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReadReceiptsView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReadReceiptsView.swift @@ -86,10 +86,10 @@ struct TimelineReadReceiptsView_Previews: PreviewProvider, TestablePreview { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/HighlightedTimelineItemModifier.swift b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/HighlightedTimelineItemModifier.swift index 78f8fabb5..11526621a 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/HighlightedTimelineItemModifier.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/HighlightedTimelineItemModifier.swift @@ -97,10 +97,10 @@ struct HighlightedTimelineItemTimeline_Previews: PreviewProvider { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineView.swift index b96a6c488..3aae2bef3 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineView.swift @@ -159,10 +159,10 @@ struct TimelineView_Previews: PreviewProvider { // Not testable as this preview timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/ElementX/Sources/Screens/UserProfileScreen/View/UserProfileScreen.swift b/ElementX/Sources/Screens/UserProfileScreen/View/UserProfileScreen.swift index 12602193f..14ec7e88e 100644 --- a/ElementX/Sources/Screens/UserProfileScreen/View/UserProfileScreen.swift +++ b/ElementX/Sources/Screens/UserProfileScreen/View/UserProfileScreen.swift @@ -131,9 +131,9 @@ struct UserProfileScreen_Previews: PreviewProvider, TestablePreview { clientProxyMock.userIdentityForFallBackToServerClosure = { userID, _ in let identity = switch userID { case RoomMemberProxyMock.mockDan.userID: - UserIdentityProxyMock(configuration: .init(verificationState: .verified)) + UserIdentityProxyMock(.init(verificationState: .verified)) default: - UserIdentityProxyMock(configuration: .init()) + UserIdentityProxyMock(.init()) } return .success(identity) @@ -146,8 +146,8 @@ struct UserProfileScreen_Previews: PreviewProvider, TestablePreview { return UserProfileScreenViewModel(userID: userID, isPresentedModally: false, userSession: UserSessionMock(.init(clientProxy: clientProxyMock)), - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default, + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init()), appSettings: .volatile()) } } diff --git a/ElementX/Sources/Services/Authentication/AuthenticationService.swift b/ElementX/Sources/Services/Authentication/AuthenticationService.swift index ff9ace529..96b5f8498 100644 --- a/ElementX/Sources/Services/Authentication/AuthenticationService.swift +++ b/ElementX/Sources/Services/Authentication/AuthenticationService.swift @@ -384,10 +384,10 @@ extension AuthenticationService { } static func mock(classicAppManager: ClassicAppManagerProtocol?) -> AuthenticationService { - AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()), + AuthenticationService(userSessionStore: UserSessionStoreMock(.init()), encryptionKeyProvider: EncryptionKeyProvider(), classicAppManager: classicAppManager, - clientFactory: AuthenticationClientFactoryMock(configuration: .init()), + clientFactory: AuthenticationClientFactoryMock(.init()), appSettings: .volatile(), appHooks: AppHooks()) } diff --git a/ElementX/Sources/UITests/UITestsAppCoordinator.swift b/ElementX/Sources/UITests/UITestsAppCoordinator.swift index e2360e6e3..f8dc3209d 100644 --- a/ElementX/Sources/UITests/UITestsAppCoordinator.swift +++ b/ElementX/Sources/UITests/UITestsAppCoordinator.swift @@ -40,7 +40,7 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, SecureWindowManagerDelegate let analyticsClient = AnalyticsClientMock() analyticsClient.isRunning = false - analytics = AnalyticsServiceMock.default + analytics = AnalyticsServiceMock(.init()) userIndicatorController = UserIndicatorController() windowManager.delegate = self @@ -175,7 +175,7 @@ class MockScreen: Identifiable { let flowCoordinator = AuthenticationFlowCoordinator(authenticationService: AuthenticationService.mock, bugReportService: BugReportServiceMock(.init()), navigationRootCoordinator: navigationRootCoordinator, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -296,7 +296,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -318,7 +318,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -340,7 +340,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -361,7 +361,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -385,7 +385,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -409,7 +409,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -432,7 +432,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -457,7 +457,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -481,7 +481,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -504,7 +504,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -541,7 +541,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -565,7 +565,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -589,7 +589,7 @@ class MockScreen: Identifiable { linkMetadataProvider: LinkMetadataProvider(), completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()), ongoingCallRoomIDPublisher: .init(.init(nil)), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -605,7 +605,7 @@ class MockScreen: Identifiable { let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationControllerProxy, flow: .deviceInitiator, appSettings: appSettings, - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) return SessionVerificationScreenCoordinator(parameters: parameters) case .userSessionScreen, .userSessionScreenReply, .userSessionSpacesFlow: let appSettings: AppSettings = appSettings @@ -630,7 +630,7 @@ class MockScreen: Identifiable { let spaceServiceProxy = SpaceServiceProxyMock(id == .userSessionSpacesFlow ? .populated : .init()) clientProxy.spaceService = spaceServiceProxy - let appMediator = AppMediatorMock.default + let appMediator = AppMediatorMock(.init()) appMediator.underlyingWindowManager = windowManager let flowCoordinator = UserSessionFlowCoordinator(isNewLogin: false, @@ -669,7 +669,7 @@ class MockScreen: Identifiable { let navigationStackCoordinator = NavigationStackCoordinator() navigationStackCoordinator.setRootCoordinator(BlankFormCoordinator()) let coordinator = RoomRolesAndPermissionsFlowCoordinator(parameters: .init(roomProxy: JoinedRoomProxyMock(.init(members: .allMembersAsAdmin)), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), navigationStackCoordinator: navigationStackCoordinator, userIndicatorController: userIndicatorController, analytics: analytics)) @@ -695,7 +695,7 @@ class MockScreen: Identifiable { timelineControllerFactory: TimelineControllerFactoryMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -755,7 +755,7 @@ class MockScreen: Identifiable { let navigationStackCoordinator = NavigationStackCoordinator() let coordinator = EncryptionResetFlowCoordinator(parameters: .init(userSession: userSession, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), userIndicatorController: userIndicatorController, @@ -781,7 +781,7 @@ class MockScreen: Identifiable { timelineControllerFactory: TimelineControllerFactoryMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, @@ -826,7 +826,7 @@ class MockScreen: Identifiable { timelineItemFactory: RoomTimelineItemFactory(userID: "@alice:matrix.org", attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), stateEventStringBuilder: RoomStateEventStringBuilder(userID: "@alice:matrix.org")), - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), appSettings: appSettings) let flowCoordinator = ChatsTabFlowCoordinator(isNewLogin: false, @@ -837,7 +837,7 @@ class MockScreen: Identifiable { timelineControllerFactory: TimelineControllerFactoryMock(.init(timelineController: timelineController)), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), analytics: analytics, diff --git a/Enterprise b/Enterprise index a8ea823ff..8bbd9a530 160000 --- a/Enterprise +++ b/Enterprise @@ -1 +1 @@ -Subproject commit a8ea823ff9796f6485e4c34de9ddb1d309a8dc63 +Subproject commit 8bbd9a5301609b3b4448c7027434330b6c516c76 diff --git a/UnitTests/Sources/AuthenticationServiceTests.swift b/UnitTests/Sources/AuthenticationServiceTests.swift index 046e5f60a..f833dcc10 100644 --- a/UnitTests/Sources/AuthenticationServiceTests.swift +++ b/UnitTests/Sources/AuthenticationServiceTests.swift @@ -136,13 +136,13 @@ struct AuthenticationServiceTests { classicAppAccounts: [ClassicAppAccount] = [], availableSecrets: ClassicAppAccount.AvailableSecrets = .complete) async throws { let configuration: AuthenticationClientFactoryMock.Configuration = .init() - let clientFactory = AuthenticationClientFactoryMock(configuration: configuration) + let clientFactory = AuthenticationClientFactoryMock(configuration) client = configuration.homeserverClients[serverAddress] encryption = EncryptionSDKMock() client.encryptionReturnValue = encryption - userSessionStore = UserSessionStoreMock(configuration: .init()) + userSessionStore = UserSessionStoreMock(.init()) encryptionKeyProvider = MockEncryptionKeyProvider() let classicAppManager = ClassicAppManagerMock(.init(accounts: classicAppAccounts, diff --git a/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift b/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift index de4953553..4f09f5091 100644 --- a/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift +++ b/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift @@ -279,9 +279,9 @@ final class AuthenticationStartScreenViewModelTests { supportsPasswordLogin: Bool = true, availableSecrets: ClassicAppAccount.AvailableSecrets = .complete) async { // Manually create a configuration as the default homeserver address setting is immutable. - client = ClientSDKMock(configuration: .init(oAuthLoginURL: supportsOAuth ? "https://account.company.com/authorize" : nil, - supportsOAuthCreatePrompt: false, - supportsPasswordLogin: supportsPasswordLogin)) + client = ClientSDKMock(.init(oAuthLoginURL: supportsOAuth ? "https://account.company.com/authorize" : nil, + supportsOAuthCreatePrompt: false, + supportsPasswordLogin: supportsPasswordLogin)) // Map both the server name and the homeserver URL so fallback lookups work. let homeserverClients: [String: ClientSDKMock] = ["company.com": client, "https://matrix.company.com": client] @@ -295,8 +295,8 @@ final class AuthenticationStartScreenViewModelTests { notificationCenter = NotificationCenter() - clientFactory = AuthenticationClientFactoryMock(configuration: configuration) - authenticationService = AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()), + clientFactory = AuthenticationClientFactoryMock(configuration) + authenticationService = AuthenticationService(userSessionStore: UserSessionStoreMock(.init()), encryptionKeyProvider: EncryptionKeyProvider(), classicAppManager: classicAppManager, clientFactory: clientFactory, @@ -310,7 +310,7 @@ final class AuthenticationStartScreenViewModelTests { isBugReportServiceEnabled: true, appMediator: AppMediatorMock(), appSettings: appSettings, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), notificationCenter: notificationCenter, userIndicatorController: UserIndicatorControllerMock()) diff --git a/UnitTests/Sources/BlockedUsersScreenViewModelTests.swift b/UnitTests/Sources/BlockedUsersScreenViewModelTests.swift index 1f19065f6..dbe65cc05 100644 --- a/UnitTests/Sources/BlockedUsersScreenViewModelTests.swift +++ b/UnitTests/Sources/BlockedUsersScreenViewModelTests.swift @@ -19,7 +19,7 @@ struct BlockedUsersScreenViewModelTests { let viewModel = BlockedUsersScreenViewModel(hideProfiles: true, userSession: UserSessionMock(.init(clientProxy: clientProxy)), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) let deferred = deferFailure(viewModel.context.observe(\.viewState.blockedUsers), timeout: .seconds(1)) { $0.contains { $0.displayName != nil } } try await deferred.fulfill() @@ -34,7 +34,7 @@ struct BlockedUsersScreenViewModelTests { let viewModel = BlockedUsersScreenViewModel(hideProfiles: false, userSession: UserSessionMock(.init(clientProxy: clientProxy)), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) let deferred = deferFulfillment(viewModel.context.observe(\.viewState.blockedUsers)) { $0.contains { $0.displayName != nil } } try await deferred.fulfill() diff --git a/UnitTests/Sources/ChatsTabFlowCoordinatorTests.swift b/UnitTests/Sources/ChatsTabFlowCoordinatorTests.swift index c4fb079d2..8ac4fdecd 100644 --- a/UnitTests/Sources/ChatsTabFlowCoordinatorTests.swift +++ b/UnitTests/Sources/ChatsTabFlowCoordinatorTests.swift @@ -46,10 +46,10 @@ struct ChatsTabFlowCoordinatorTests { timelineControllerFactory: timelineControllerFactory, emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), notificationManager: notificationManager, stateMachineFactory: stateMachineFactory) diff --git a/UnitTests/Sources/ComposerToolbarViewModelTests.swift b/UnitTests/Sources/ComposerToolbarViewModelTests.swift index fd6f03d98..cde58f20b 100644 --- a/UnitTests/Sources/ComposerToolbarViewModelTests.swift +++ b/UnitTests/Sources/ComposerToolbarViewModelTests.swift @@ -88,10 +88,10 @@ final class ComposerToolbarViewModelTests { viewModel = ComposerToolbarViewModel(roomProxy: JoinedRoomProxyMock(.init()), wysiwygViewModel: wysiwygViewModel, completionSuggestionService: mockCompletionSuggestionService, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: draftServiceMock) #expect(viewModel.state.suggestions == suggestions) @@ -707,10 +707,10 @@ final class ComposerToolbarViewModelTests { viewModel = ComposerToolbarViewModel(roomProxy: roomProxyMock, wysiwygViewModel: wysiwygViewModel, completionSuggestionService: mockCompletionSuggestionService, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: draftServiceMock) var fulfillment = deferFulfillment(viewModel.context.$viewState, message: "Composer is disabled") { $0.canSend == false } @@ -754,10 +754,10 @@ final class ComposerToolbarViewModelTests { viewModel = ComposerToolbarViewModel(roomProxy: roomProxyMock, wysiwygViewModel: wysiwygViewModel, completionSuggestionService: mockCompletionSuggestionService, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: draftServiceMock) var fulfillment = deferFulfillment(viewModel.context.$viewState, message: "Composer is disabled") { $0.canSend == false } @@ -790,10 +790,10 @@ final class ComposerToolbarViewModelTests { viewModel = ComposerToolbarViewModel(roomProxy: roomProxyMock, wysiwygViewModel: wysiwygViewModel, completionSuggestionService: mockCompletionSuggestionService, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: draftServiceMock) let deferred = deferFulfillment(viewModel.context.$viewState, message: "Composer should be enabled") { $0.canSend == true } @@ -816,10 +816,10 @@ final class ComposerToolbarViewModelTests { roomProxy: JoinedRoomProxyMock(.init()), wysiwygViewModel: wysiwygViewModel, completionSuggestionService: completionSuggestionServiceMock, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), mentionDisplayHelper: ComposerMentionDisplayHelper.mock, appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), composerDraftService: draftServiceMock) viewModel.context.composerFormattingEnabled = true } diff --git a/UnitTests/Sources/CreateRoomViewModelTests.swift b/UnitTests/Sources/CreateRoomViewModelTests.swift index b0cd0c85e..226fc693e 100644 --- a/UnitTests/Sources/CreateRoomViewModelTests.swift +++ b/UnitTests/Sources/CreateRoomViewModelTests.swift @@ -92,7 +92,7 @@ final class CreateRoomScreenViewModelTests { spaceSelectionMode: .none, shouldShowCancelButton: false, userSession: userSession, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), appSettings: appSettings) self.viewModel = viewModel @@ -342,7 +342,7 @@ final class CreateRoomScreenViewModelTests { spaceSelectionMode: spacesSelectionMode, shouldShowCancelButton: false, userSession: userSession, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), appSettings: appSettings) self.viewModel = viewModel diff --git a/UnitTests/Sources/GlobalSearchScreenViewModelTests.swift b/UnitTests/Sources/GlobalSearchScreenViewModelTests.swift index 435fa71dc..55bcbb9ed 100644 --- a/UnitTests/Sources/GlobalSearchScreenViewModelTests.swift +++ b/UnitTests/Sources/GlobalSearchScreenViewModelTests.swift @@ -17,7 +17,7 @@ struct GlobalSearchScreenViewModelTests { init() { viewModel = GlobalSearchScreenViewModel(roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) context = viewModel.context } diff --git a/UnitTests/Sources/HomeScreenViewModelTests.swift b/UnitTests/Sources/HomeScreenViewModelTests.swift index 99946d5c2..60a72ef10 100644 --- a/UnitTests/Sources/HomeScreenViewModelTests.swift +++ b/UnitTests/Sources/HomeScreenViewModelTests.swift @@ -435,9 +435,9 @@ final class HomeScreenViewModelTests { viewModel = HomeScreenViewModel(userSession: userSession, selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), notificationManager: notificationManager, - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift index 509fd631b..150384ac1 100644 --- a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift +++ b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift @@ -203,7 +203,7 @@ final class JoinRoomScreenViewModelTests { viewModel = JoinRoomScreenViewModel(source: .generic(roomID: "1", via: []), appSettings: appSettings, userSession: UserSessionMock(.init(clientProxy: clientProxy)), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/UnitTests/Sources/LocationSharingScreenViewModelTests.swift b/UnitTests/Sources/LocationSharingScreenViewModelTests.swift index 878720a46..a2339e29f 100644 --- a/UnitTests/Sources/LocationSharingScreenViewModelTests.swift +++ b/UnitTests/Sources/LocationSharingScreenViewModelTests.swift @@ -401,9 +401,9 @@ struct LocationSharingScreenViewModelTests { roomProxy: roomProxyMock, timelineController: MockTimelineController(timelineProxy: TimelineProxyMock(.init())), liveLocationManager: LiveLocationManagerMock(.init()), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) // Initially no annotations and no map center since sender and share are both nil. #expect(context.viewState.annotations.isEmpty) @@ -436,9 +436,9 @@ struct LocationSharingScreenViewModelTests { roomProxy: JoinedRoomProxyMock(.init(members: members)), timelineController: MockTimelineController(timelineProxy: timelineProxy), liveLocationManager: LiveLocationManagerMock(liveLocationManagerConfiguration), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) viewModel.state.bindings.isLocationAuthorized = true } @@ -451,9 +451,9 @@ struct LocationSharingScreenViewModelTests { roomProxy: JoinedRoomProxyMock(.init(members: members)), timelineController: MockTimelineController(timelineProxy: timelineProxy), liveLocationManager: liveLocationManagerMock, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) viewModel.state.bindings.isLocationAuthorized = true } @@ -473,9 +473,9 @@ struct LocationSharingScreenViewModelTests { roomProxy: roomProxyMock, timelineController: MockTimelineController(timelineProxy: TimelineProxyMock(.init())), liveLocationManager: LiveLocationManagerMock(.init()), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) } private func makeLiveLocationShare(userID: String, latitude: Double = 0.0, longitude: Double = 0.0) -> LiveLocationShare { diff --git a/UnitTests/Sources/LoginScreenViewModelTests.swift b/UnitTests/Sources/LoginScreenViewModelTests.swift index c45d00400..4c32a9dbb 100644 --- a/UnitTests/Sources/LoginScreenViewModelTests.swift +++ b/UnitTests/Sources/LoginScreenViewModelTests.swift @@ -229,8 +229,8 @@ struct LoginScreenViewModelTests { private mutating func setupViewModel(homeserverAddress: String = "example.com", loginHint: String? = nil) async { let appSettings = AppSettings.volatile() - clientFactory = AuthenticationClientFactoryMock(configuration: .init()) - service = AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()), + clientFactory = AuthenticationClientFactoryMock(.init()) + service = AuthenticationService(userSessionStore: UserSessionStoreMock(.init()), encryptionKeyProvider: EncryptionKeyProvider(), classicAppManager: nil, clientFactory: clientFactory, @@ -247,6 +247,6 @@ struct LoginScreenViewModelTests { loginHint: loginHint, userIndicatorController: UserIndicatorControllerMock(), appSettings: appSettings, - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) } } diff --git a/UnitTests/Sources/ManageRoomMemberSheetViewModelTests.swift b/UnitTests/Sources/ManageRoomMemberSheetViewModelTests.swift index 8e98dbb7d..9785eabc7 100644 --- a/UnitTests/Sources/ManageRoomMemberSheetViewModelTests.swift +++ b/UnitTests/Sources/ManageRoomMemberSheetViewModelTests.swift @@ -32,8 +32,8 @@ struct ManageRoomMemberSheetViewModelTests { permissions: .init(canKick: true, canBan: true, ownPowerLevel: RoomMemberProxyMock.mockAdmin.powerLevel), roomProxy: roomProxy, userIndicatorController: UserIndicatorControllerMock(), - analyticsService: AnalyticsServiceMock.default, - mediaProvider: MediaProviderMock(configuration: .init())) + analyticsService: AnalyticsServiceMock(.init()), + mediaProvider: MediaProviderMock(.init())) let deferred = deferFulfillment(context.observe(\.viewState.bindings.alertInfo)) { $0 != nil } let deferredAction = deferFulfillment(viewModel.actions) { action in @@ -64,8 +64,8 @@ struct ManageRoomMemberSheetViewModelTests { permissions: .init(canKick: true, canBan: true, ownPowerLevel: RoomMemberProxyMock.mockAdmin.powerLevel), roomProxy: roomProxy, userIndicatorController: UserIndicatorControllerMock(), - analyticsService: AnalyticsServiceMock.default, - mediaProvider: MediaProviderMock(configuration: .init())) + analyticsService: AnalyticsServiceMock(.init()), + mediaProvider: MediaProviderMock(.init())) let deferred = deferFulfillment(context.observe(\.viewState.bindings.alertInfo)) { $0 != nil } context.send(viewAction: .ban) @@ -87,8 +87,8 @@ struct ManageRoomMemberSheetViewModelTests { permissions: .init(canKick: true, canBan: true, ownPowerLevel: RoomMemberProxyMock.mockAdmin.powerLevel), roomProxy: roomProxy, userIndicatorController: UserIndicatorControllerMock(), - analyticsService: AnalyticsServiceMock.default, - mediaProvider: MediaProviderMock(configuration: .init())) + analyticsService: AnalyticsServiceMock(.init()), + mediaProvider: MediaProviderMock(.init())) let deferredAction = deferFulfillment(viewModel.actions) { action in action == .dismiss(shouldShowDetails: true) diff --git a/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift b/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift index 1223947e5..6e64472e5 100644 --- a/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift +++ b/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift @@ -31,7 +31,7 @@ final class MediaUploadPreviewScreenViewModelTests { appSettings = AppSettings.volatile() appSettings.optimizeMediaUploads = false - userIndicatorController = UserIndicatorControllerMock.default + userIndicatorController = UserIndicatorControllerMock() } @Test diff --git a/UnitTests/Sources/NotificationContentBuilderTests.swift b/UnitTests/Sources/NotificationContentBuilderTests.swift index 17ef889c5..deebe1f1d 100644 --- a/UnitTests/Sources/NotificationContentBuilderTests.swift +++ b/UnitTests/Sources/NotificationContentBuilderTests.swift @@ -20,7 +20,7 @@ struct NotificationContentBuilderTests { notificationContent = .init() let stringBuilder = RoomMessageEventStringBuilder(attributedStringBuilder: AttributedStringBuilder(mentionBuilder: PlainMentionBuilder()), style: .plain) - mediaProvider = MediaProviderMock(configuration: .init()) + mediaProvider = MediaProviderMock(.init()) notificationContentBuilder = NotificationContentBuilder(messageEventStringBuilder: stringBuilder, notificationSoundName: UNNotificationSoundName("message.caf"), userSession: NSEUserSessionMock(.init())) diff --git a/UnitTests/Sources/PillContextTests.swift b/UnitTests/Sources/PillContextTests.swift index d412368b9..8d595c6cc 100644 --- a/UnitTests/Sources/PillContextTests.swift +++ b/UnitTests/Sources/PillContextTests.swift @@ -16,7 +16,7 @@ struct PillContextTests { @Test func user() async { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let id = "@test:matrix.org" let proxyMock = JoinedRoomProxyMock(.init(name: "Test")) @@ -27,9 +27,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -50,7 +50,7 @@ struct PillContextTests { @Test func ownUser() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let id = "@test:matrix.org" let proxyMock = JoinedRoomProxyMock(.init(name: "Test", ownUserID: id)) @@ -61,9 +61,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -75,7 +75,7 @@ struct PillContextTests { @Test func allUsers() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let avatarURL = URL(string: "https://matrix.jpg") let id = "test_room" @@ -88,9 +88,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -103,7 +103,7 @@ struct PillContextTests { @Test func roomIDMention() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -115,9 +115,9 @@ struct PillContextTests { userSession: UserSessionMock(.init(clientProxy: clientMock)), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -131,7 +131,7 @@ struct PillContextTests { @Test func roomIDMentionMissingRoom() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -141,9 +141,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -157,7 +157,7 @@ struct PillContextTests { @Test func roomAliasMention() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -171,9 +171,9 @@ struct PillContextTests { userSession: UserSessionMock(.init(clientProxy: clientMock)), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -187,7 +187,7 @@ struct PillContextTests { @Test func roomAliasMentionMissingRoom() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -197,9 +197,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -213,7 +213,7 @@ struct PillContextTests { @Test func eventOnRoomIDMention() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -225,9 +225,9 @@ struct PillContextTests { userSession: UserSessionMock(.init(clientProxy: clientMock)), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -241,7 +241,7 @@ struct PillContextTests { @Test func eventOnRoomIDMentionMissingRoom() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -251,9 +251,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -267,7 +267,7 @@ struct PillContextTests { @Test func eventOnRoomAliasMention() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -281,9 +281,9 @@ struct PillContextTests { userSession: UserSessionMock(.init(clientProxy: clientMock)), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -297,7 +297,7 @@ struct PillContextTests { @Test func eventOnRoomAliasMentionMissingRoom() { let appSettings = AppSettings.volatile() - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let proxyMock = JoinedRoomProxyMock(.init()) let mockController = MockTimelineController() @@ -307,9 +307,9 @@ struct PillContextTests { userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), userIndicatorController: userIndicatorController, - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/UnitTests/Sources/PollFormScreenViewModelTests.swift b/UnitTests/Sources/PollFormScreenViewModelTests.swift index e80acd34a..f82fd4fab 100644 --- a/UnitTests/Sources/PollFormScreenViewModelTests.swift +++ b/UnitTests/Sources/PollFormScreenViewModelTests.swift @@ -179,7 +179,7 @@ struct PollFormScreenViewModelTests { private mutating func setupViewModel(mode: PollFormMode = .new(topic: nil)) { viewModel = PollFormScreenViewModel(mode: mode, timelineController: MockTimelineController(timelineProxy: timelineProxy), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock()) } } diff --git a/UnitTests/Sources/QRCodeLoginScreenViewModelTests.swift b/UnitTests/Sources/QRCodeLoginScreenViewModelTests.swift index e4e43ef3a..b385b8f34 100644 --- a/UnitTests/Sources/QRCodeLoginScreenViewModelTests.swift +++ b/UnitTests/Sources/QRCodeLoginScreenViewModelTests.swift @@ -242,7 +242,7 @@ struct QRCodeLoginScreenViewModelTests { screenMode = .linkMobile(linkNewDeviceService.linkMobileDevice(), clientProxy) } - appMediator = AppMediatorMock.default + appMediator = AppMediatorMock(.init()) viewModel = QRCodeLoginScreenViewModel(mode: screenMode, canSignInManually: true, appMediator: appMediator) diff --git a/UnitTests/Sources/RoomChangePermissionsScreenViewModelTests.swift b/UnitTests/Sources/RoomChangePermissionsScreenViewModelTests.swift index b3da475a6..dd93ab1da 100644 --- a/UnitTests/Sources/RoomChangePermissionsScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomChangePermissionsScreenViewModelTests.swift @@ -125,6 +125,6 @@ struct RoomChangePermissionsScreenViewModelTests { ownPowerLevel: ownPowerLevel, roomProxy: roomProxy, userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) } } diff --git a/UnitTests/Sources/RoomChangeRolesScreenViewModelTests.swift b/UnitTests/Sources/RoomChangeRolesScreenViewModelTests.swift index 03e4c2cf9..69abbd5ef 100644 --- a/UnitTests/Sources/RoomChangeRolesScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomChangeRolesScreenViewModelTests.swift @@ -195,8 +195,8 @@ struct RoomChangeRolesScreenViewModelTests { roomProxy = JoinedRoomProxyMock(.init(members: .allMembersAsAdmin)) viewModel = RoomChangeRolesScreenViewModel(mode: mode, roomProxy: roomProxy, - mediaProvider: MediaProviderMock(configuration: .init()), + mediaProvider: MediaProviderMock(.init()), userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) } } diff --git a/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift b/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift index b9d049aaf..86c41ea19 100644 --- a/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift @@ -164,7 +164,7 @@ struct RoomDetailsEditScreenViewModelTests { // MARK: - Private private mutating func setupViewModel(roomProxyConfiguration: JoinedRoomProxyMockConfiguration) { - userIndicatorController = UserIndicatorControllerMock.default + userIndicatorController = UserIndicatorControllerMock() viewModel = .init(roomProxy: JoinedRoomProxyMock(roomProxyConfiguration), userSession: UserSessionMock(.init()), mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: .volatile()), diff --git a/UnitTests/Sources/RoomDetailsScreenViewModelTests.swift b/UnitTests/Sources/RoomDetailsScreenViewModelTests.swift index b662fb868..83afcc144 100644 --- a/UnitTests/Sources/RoomDetailsScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomDetailsScreenViewModelTests.swift @@ -30,8 +30,8 @@ struct RoomDetailsScreenViewModelTests { notificationSettingsProxyMock = NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -43,8 +43,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", members: mockedMembers, joinRule: .public)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -63,8 +63,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -84,8 +84,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -142,8 +142,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -163,8 +163,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -194,8 +194,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init(clientProxy: clientProxy)), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -224,8 +224,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -255,8 +255,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init(clientProxy: clientProxy)), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -287,8 +287,8 @@ struct RoomDetailsScreenViewModelTests { powerLevelsConfiguration: .init(canUserInvite: false))) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -304,8 +304,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", members: mockedMembers, joinRule: .public)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -341,7 +341,7 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(configuration) - let powerLevelsProxyMock = RoomPowerLevelsProxyMock(configuration: .init()) + let powerLevelsProxyMock = RoomPowerLevelsProxyMock(.init()) powerLevelsProxyMock.canUserUserIDSendStateEventClosure = { _, event in .success(event == .roomAvatar) } @@ -356,8 +356,8 @@ struct RoomDetailsScreenViewModelTests { viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -380,7 +380,7 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(configuration) - let powerLevelsProxyMock = RoomPowerLevelsProxyMock(configuration: .init()) + let powerLevelsProxyMock = RoomPowerLevelsProxyMock(.init()) powerLevelsProxyMock.canUserUserIDSendStateEventClosure = { _, event in .success(event == .roomName) } @@ -395,8 +395,8 @@ struct RoomDetailsScreenViewModelTests { viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -419,7 +419,7 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(configuration) - let powerLevelsProxyMock = RoomPowerLevelsProxyMock(configuration: .init()) + let powerLevelsProxyMock = RoomPowerLevelsProxyMock(.init()) powerLevelsProxyMock.canUserUserIDSendStateEventClosure = { _, event in .success(event == .roomTopic) } @@ -434,8 +434,8 @@ struct RoomDetailsScreenViewModelTests { viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -454,8 +454,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: false, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -474,8 +474,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, members: mockedMembers)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -492,8 +492,8 @@ struct RoomDetailsScreenViewModelTests { notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError = NotificationSettingsError.Generic(msg: "error") viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -700,8 +700,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: false, knockRequestsState: .loaded(mockedRequests), joinRule: .knock)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -721,8 +721,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: false, knockRequestsState: .loading, joinRule: .knock)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -744,8 +744,8 @@ struct RoomDetailsScreenViewModelTests { powerLevelsConfiguration: .init(canUserInvite: false))) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -767,8 +767,8 @@ struct RoomDetailsScreenViewModelTests { roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, members: mockedMembers, knockRequestsState: .loaded(mockedRequests), joinRule: .knock)) viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) @@ -794,8 +794,8 @@ struct RoomDetailsScreenViewModelTests { viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock, userSession: UserSessionMock(.init()), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), appSettings: .volatile()) diff --git a/UnitTests/Sources/RoomFlowCoordinatorTests.swift b/UnitTests/Sources/RoomFlowCoordinatorTests.swift index 2fab28f4e..c4177382e 100644 --- a/UnitTests/Sources/RoomFlowCoordinatorTests.swift +++ b/UnitTests/Sources/RoomFlowCoordinatorTests.swift @@ -483,11 +483,11 @@ final class RoomFlowCoordinatorTests { timelineControllerFactory: timelineControllerFactory, emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), - analytics: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default, + analytics: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock(), notificationManager: NotificationManagerMock(), stateMachineFactory: StateMachineFactory()) diff --git a/UnitTests/Sources/RoomMemberDetailsViewModelTests.swift b/UnitTests/Sources/RoomMemberDetailsViewModelTests.swift index 7fb7bee31..86bed04fa 100644 --- a/UnitTests/Sources/RoomMemberDetailsViewModelTests.swift +++ b/UnitTests/Sources/RoomMemberDetailsViewModelTests.swift @@ -164,7 +164,7 @@ struct RoomMemberDetailsViewModelTests { try await waitForMemberToLoad.fulfill() clientProxy.directRoomForUserIDReturnValue = .success(nil) - clientProxy.userIdentityForFallBackToServerReturnValue = .success(UserIdentityProxyMock(configuration: .init(verificationState: .notVerified))) + clientProxy.userIdentityForFallBackToServerReturnValue = .success(UserIdentityProxyMock(.init(verificationState: .notVerified))) // The user identity becomes known, i.e. not unknown. let deferred = deferFulfillment(viewModel.context.$viewState.compactMap(\.bindings.inviteConfirmationUser)) { @@ -211,8 +211,8 @@ struct RoomMemberDetailsViewModelTests { viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID, roomProxy: roomProxyMock, userSession: userSession, - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default, + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init()), appSettings: .volatile()) } } diff --git a/UnitTests/Sources/RoomMembersFlowCoordinatorTests.swift b/UnitTests/Sources/RoomMembersFlowCoordinatorTests.swift index 7aef41b2b..08dd059ed 100644 --- a/UnitTests/Sources/RoomMembersFlowCoordinatorTests.swift +++ b/UnitTests/Sources/RoomMembersFlowCoordinatorTests.swift @@ -59,10 +59,10 @@ struct RoomMembersFlowCoordinatorTests { timelineControllerFactory: TimelineControllerFactoryMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), - appMediator: AppMediatorMock.default, + appMediator: AppMediatorMock(.init()), appSettings: appSettings, appHooks: AppHooks(), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), notificationManager: NotificationManagerMock(), stateMachineFactory: stateMachineFactory) diff --git a/UnitTests/Sources/RoomMembersListScreenViewModelTests.swift b/UnitTests/Sources/RoomMembersListScreenViewModelTests.swift index f42d70e45..108516fd2 100644 --- a/UnitTests/Sources/RoomMembersListScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomMembersListScreenViewModelTests.swift @@ -277,8 +277,8 @@ struct RoomMembersListScreenViewModelTests { viewModel = RoomMembersListScreenViewModel(userSession: UserSessionMock(.init()), roomProxy: roomProxy, - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default) + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init())) let context = viewModel.context @@ -297,7 +297,7 @@ struct RoomMembersListScreenViewModelTests { roomProxy = JoinedRoomProxyMock(.init(name: "test", members: members)) viewModel = RoomMembersListScreenViewModel(userSession: UserSessionMock(.init()), roomProxy: roomProxy, - userIndicatorController: UserIndicatorControllerMock.default, - analytics: AnalyticsServiceMock.default) + userIndicatorController: UserIndicatorControllerMock(), + analytics: AnalyticsServiceMock(.init())) } } diff --git a/UnitTests/Sources/RoomRolesAndPermissionsScreenViewModelTests.swift b/UnitTests/Sources/RoomRolesAndPermissionsScreenViewModelTests.swift index 48547ba7f..f1ed812f8 100644 --- a/UnitTests/Sources/RoomRolesAndPermissionsScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomRolesAndPermissionsScreenViewModelTests.swift @@ -84,6 +84,6 @@ struct RoomRolesAndPermissionsScreenViewModelTests { roomProxy = JoinedRoomProxyMock(.init(members: members)) viewModel = RoomRolesAndPermissionsScreenViewModel(roomProxy: roomProxy, userIndicatorController: UserIndicatorControllerMock(), - analytics: AnalyticsServiceMock.default) + analytics: AnalyticsServiceMock(.init())) } } diff --git a/UnitTests/Sources/RoomScreenViewModelTests.swift b/UnitTests/Sources/RoomScreenViewModelTests.swift index efe67087b..420480c03 100644 --- a/UnitTests/Sources/RoomScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomScreenViewModelTests.swift @@ -45,8 +45,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel // check if in the default state is not showing but is indeed loading @@ -126,8 +126,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel // check if the banner is now in a loaded state and is showing the counter @@ -187,8 +187,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel // check if the banner is now in a loaded state and is showing the counter @@ -229,7 +229,7 @@ final class RoomScreenViewModelTests { var configuration = JoinedRoomProxyMockConfiguration(id: "TestID", name: "StartingName", avatarURL: nil, hasOngoingCall: false) let roomProxyMock = JoinedRoomProxyMock(configuration) - let powerLevelsMock = RoomPowerLevelsProxyMock(configuration: .init()) + let powerLevelsMock = RoomPowerLevelsProxyMock(.init()) powerLevelsMock.canUserJoinCallUserIDReturnValue = .success(false) powerLevelsMock.canOwnUserJoinCallReturnValue = false roomProxyMock.powerLevelsReturnValue = .success(powerLevelsMock) @@ -246,8 +246,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel #expect(viewModel.state.roomTitle == "StartingName") @@ -283,8 +283,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: ongoingCallRoomIDSubject.asCurrentValuePublisher(), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel #expect(viewModel.state.shouldShowCallButton) @@ -328,8 +328,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel viewModel.stop() } @@ -349,8 +349,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel var deferred = deferFulfillment(viewModel.context.$viewState) { state in @@ -383,8 +383,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel var deferred = deferFulfillment(viewModel.context.$viewState) { state in @@ -412,8 +412,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel // Loading state just does not appear at all @@ -432,8 +432,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel let deferred = deferFulfillment(viewModel.context.$viewState) { state in @@ -459,8 +459,8 @@ final class RoomScreenViewModelTests { ongoingCallRoomIDPublisher: .init(.init(nil)), appSettings: appSettings, appHooks: AppHooks(), - analyticsService: AnalyticsServiceMock.default, - userIndicatorController: UserIndicatorControllerMock.default) + analyticsService: AnalyticsServiceMock(.init()), + userIndicatorController: UserIndicatorControllerMock()) self.viewModel = viewModel let deferredInvisible = deferFailure(viewModel.context.$viewState, diff --git a/UnitTests/Sources/ServerConfirmationScreenViewModelTests.swift b/UnitTests/Sources/ServerConfirmationScreenViewModelTests.swift index 275176352..fc8fd4f05 100644 --- a/UnitTests/Sources/ServerConfirmationScreenViewModelTests.swift +++ b/UnitTests/Sources/ServerConfirmationScreenViewModelTests.swift @@ -344,14 +344,14 @@ final class ServerConfirmationScreenViewModelTests { } // Manually create a configuration as the default homeserver address setting is immutable. - client = ClientSDKMock(configuration: .init(oAuthLoginURL: supportsOAuth ? "https://account.matrix.org/authorize" : nil, - supportsOAuthCreatePrompt: supportsOAuthCreatePrompt, - supportsPasswordLogin: supportsPasswordLogin, - elementWellKnown: requiresElementPro ? "{\"version\":1,\"enforce_element_pro\":true}" : nil)) + client = ClientSDKMock(.init(oAuthLoginURL: supportsOAuth ? "https://account.matrix.org/authorize" : nil, + supportsOAuthCreatePrompt: supportsOAuthCreatePrompt, + supportsPasswordLogin: supportsPasswordLogin, + elementWellKnown: requiresElementPro ? "{\"version\":1,\"enforce_element_pro\":true}" : nil)) let configuration = AuthenticationClientFactoryMock.Configuration(homeserverClients: ["matrix.org": client]) - clientFactory = AuthenticationClientFactoryMock(configuration: configuration) - service = AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()), + clientFactory = AuthenticationClientFactoryMock(configuration) + service = AuthenticationService(userSessionStore: UserSessionStoreMock(.init()), encryptionKeyProvider: EncryptionKeyProvider(), classicAppManager: nil, clientFactory: clientFactory, diff --git a/UnitTests/Sources/ServerSelectionScreenViewModelTests.swift b/UnitTests/Sources/ServerSelectionScreenViewModelTests.swift index 8d188f73b..f93a32950 100644 --- a/UnitTests/Sources/ServerSelectionScreenViewModelTests.swift +++ b/UnitTests/Sources/ServerSelectionScreenViewModelTests.swift @@ -150,8 +150,8 @@ struct ServerSelectionScreenViewModelTests { private mutating func setup(authenticationFlow: AuthenticationFlow) { let appSettings = AppSettings.volatile() - clientFactory = AuthenticationClientFactoryMock(configuration: .init()) - service = AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()), + clientFactory = AuthenticationClientFactoryMock(.init()) + service = AuthenticationService(userSessionStore: UserSessionStoreMock(.init()), encryptionKeyProvider: EncryptionKeyProvider(), classicAppManager: nil, clientFactory: clientFactory, diff --git a/UnitTests/Sources/SessionVerificationViewModelTests.swift b/UnitTests/Sources/SessionVerificationViewModelTests.swift index c3e3a4d42..12cd118b4 100644 --- a/UnitTests/Sources/SessionVerificationViewModelTests.swift +++ b/UnitTests/Sources/SessionVerificationViewModelTests.swift @@ -22,7 +22,7 @@ struct SessionVerificationViewModelTests { viewModel = SessionVerificationScreenViewModel(sessionVerificationControllerProxy: sessionVerificationController, flow: .deviceInitiator, appSettings: .volatile(), - mediaProvider: MediaProviderMock(configuration: .init())) + mediaProvider: MediaProviderMock(.init())) context = viewModel.context } diff --git a/UnitTests/Sources/StartChatViewModelTests.swift b/UnitTests/Sources/StartChatViewModelTests.swift index d2a27bdcb..990c79633 100644 --- a/UnitTests/Sources/StartChatViewModelTests.swift +++ b/UnitTests/Sources/StartChatViewModelTests.swift @@ -27,7 +27,7 @@ struct StartChatScreenViewModelTests { userDiscoveryService.searchProfilesWithReturnValue = .success([]) let userSession = UserSessionMock(.init(clientProxy: clientProxy)) viewModel = StartChatScreenViewModel(userSession: userSession, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: UserIndicatorControllerMock(), userDiscoveryService: userDiscoveryService, appSettings: appSettings) @@ -92,7 +92,7 @@ struct StartChatScreenViewModelTests { @Test func inviteConfirmationFetchesIdentity() async throws { clientProxy.directRoomForUserIDReturnValue = .success(nil) - clientProxy.userIdentityForFallBackToServerReturnValue = .success(UserIdentityProxyMock(configuration: .init(verificationState: .notVerified))) + clientProxy.userIdentityForFallBackToServerReturnValue = .success(UserIdentityProxyMock(.init(verificationState: .notVerified))) // User identity becomes known, i.e. not unknown let deferred = deferFulfillment(viewModel.context.$viewState.compactMap(\.bindings.selectedUserToInvite)) { diff --git a/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift b/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift index 1c55d4533..56ccbefc1 100644 --- a/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift +++ b/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift @@ -295,7 +295,7 @@ struct TimelineMediaPreviewViewModelTests { timelineController = MockTimelineController(timelineKind: .media(.mediaFilesScreen)) timelineController.timelineItems = initialItems - mediaProvider = MediaProviderMock(configuration: .init()) + mediaProvider = MediaProviderMock(.init()) photoLibraryManager = PhotoLibraryManagerMock(.init(authorizationDenied: photoLibraryAuthorizationDenied)) viewModel = TimelineMediaPreviewViewModel(initialItem: initialItems[initialItemIndex], diff --git a/UnitTests/Sources/TimelineViewModelTests.swift b/UnitTests/Sources/TimelineViewModelTests.swift index eda641a75..f97ecf208 100644 --- a/UnitTests/Sources/TimelineViewModelTests.swift +++ b/UnitTests/Sources/TimelineViewModelTests.swift @@ -312,10 +312,10 @@ final class TimelineViewModelTests { timelineController: timelineController, userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -341,10 +341,10 @@ final class TimelineViewModelTests { timelineController: timelineController, userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -368,10 +368,10 @@ final class TimelineViewModelTests { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -407,10 +407,10 @@ final class TimelineViewModelTests { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -446,10 +446,10 @@ final class TimelineViewModelTests { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -491,10 +491,10 @@ final class TimelineViewModelTests { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -522,10 +522,10 @@ final class TimelineViewModelTests { timelineController: MockTimelineController(), userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) @@ -535,7 +535,7 @@ final class TimelineViewModelTests { } try await deferred.fulfill() - let powerLevelsProxyMock = RoomPowerLevelsProxyMock(configuration: .init()) + let powerLevelsProxyMock = RoomPowerLevelsProxyMock(.init()) powerLevelsProxyMock.canUserPinOrUnpinUserIDReturnValue = .success(false) powerLevelsProxyMock.canOwnUserPinOrUnpinReturnValue = false roomProxyMock.powerLevelsReturnValue = .success(powerLevelsProxyMock) @@ -594,10 +594,10 @@ final class TimelineViewModelTests { timelineController: timelineController, userSession: UserSessionMock(.init()), mediaPlayerProvider: MediaPlayerProviderMock(), - userIndicatorController: UserIndicatorControllerMock.default, - appMediator: AppMediatorMock.default, + userIndicatorController: UserIndicatorControllerMock(), + appMediator: AppMediatorMock(.init()), appSettings: appSettings, - analyticsService: AnalyticsServiceMock.default, + analyticsService: AnalyticsServiceMock(.init()), emojiProvider: EmojiProvider(appSettings: appSettings), linkMetadataProvider: LinkMetadataProvider(), timelineControllerFactory: TimelineControllerFactoryMock(.init())) diff --git a/UnitTests/Sources/UserDetailsEditScreenViewModelTests.swift b/UnitTests/Sources/UserDetailsEditScreenViewModelTests.swift index f07b5425c..6b6558e3d 100644 --- a/UnitTests/Sources/UserDetailsEditScreenViewModelTests.swift +++ b/UnitTests/Sources/UserDetailsEditScreenViewModelTests.swift @@ -21,7 +21,7 @@ struct UserDetailsEditScreenViewModelTests { init() { viewModel = .init(userSession: UserSessionMock(.init()), mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: .volatile()), - userIndicatorController: UserIndicatorControllerMock.default) + userIndicatorController: UserIndicatorControllerMock()) } @Test diff --git a/UnitTests/Sources/UserProfileScreenViewModelTests.swift b/UnitTests/Sources/UserProfileScreenViewModelTests.swift index e484cd12e..c0e7466cf 100644 --- a/UnitTests/Sources/UserProfileScreenViewModelTests.swift +++ b/UnitTests/Sources/UserProfileScreenViewModelTests.swift @@ -13,7 +13,7 @@ import Testing struct UserProfileScreenViewModelTests { @Test func initialState() async throws { - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let profile = UserProfileProxy(userID: "@alice:matrix.org", displayName: "Alice", avatarURL: .mockMXCAvatar) let clientProxy = ClientProxyMock(.init()) @@ -23,7 +23,7 @@ struct UserProfileScreenViewModelTests { isPresentedModally: false, userSession: UserSessionMock(.init(clientProxy: clientProxy)), userIndicatorController: userIndicatorController, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), appSettings: .volatile()) let context = viewModel.context @@ -37,7 +37,7 @@ struct UserProfileScreenViewModelTests { @Test func initialStateAccountOwner() async throws { - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let profile = UserProfileProxy(userID: RoomMemberProxyMock.mockMe.userID, displayName: "Me", avatarURL: .mockMXCAvatar) let clientProxy = ClientProxyMock(.init()) @@ -47,7 +47,7 @@ struct UserProfileScreenViewModelTests { isPresentedModally: false, userSession: UserSessionMock(.init(clientProxy: clientProxy)), userIndicatorController: userIndicatorController, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), appSettings: .volatile()) let context = viewModel.context @@ -61,7 +61,7 @@ struct UserProfileScreenViewModelTests { @Test func startingDmWithUnknownUserFetchesIdentity() async throws { - let userIndicatorController = UserIndicatorControllerMock.default + let userIndicatorController = UserIndicatorControllerMock() let profile = UserProfileProxy.mockAlice @@ -73,7 +73,7 @@ struct UserProfileScreenViewModelTests { isPresentedModally: false, userSession: UserSessionMock(.init(clientProxy: clientProxy)), userIndicatorController: userIndicatorController, - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), appSettings: .volatile()) let context = viewModel.context diff --git a/UnitTests/Sources/UserSessionFlowCoordinatorTests.swift b/UnitTests/Sources/UserSessionFlowCoordinatorTests.swift index 5a060018a..95c0a357d 100644 --- a/UnitTests/Sources/UserSessionFlowCoordinatorTests.swift +++ b/UnitTests/Sources/UserSessionFlowCoordinatorTests.swift @@ -44,12 +44,12 @@ struct UserSessionFlowCoordinatorTests { let clientProxy = ClientProxyMock(.init(userID: "hi@bob", roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))))) clientProxy.homeserverReachabilityPublisher = homeserverReachabilitySubject.asCurrentValuePublisher() - let networkMonitor = NetworkMonitorMock.default + let networkMonitor = NetworkMonitorMock(.init()) networkMonitor.reachabilityPublisher = networkReachabilitySubject.asCurrentValuePublisher() - let appMediator = AppMediatorMock.default + let appMediator = AppMediatorMock(.init()) appMediator.networkMonitor = networkMonitor - userIndicatorController = UserIndicatorControllerMock.default + userIndicatorController = UserIndicatorControllerMock() let appSettings = AppSettings.volatile() let flowParameters = CommonFlowParameters(userSession: UserSessionMock(.init(clientProxy: clientProxy)), @@ -61,7 +61,7 @@ struct UserSessionFlowCoordinatorTests { appMediator: appMediator, appSettings: appSettings, appHooks: AppHooks(), - analytics: AnalyticsServiceMock.default, + analytics: AnalyticsServiceMock(.init()), userIndicatorController: userIndicatorController, notificationManager: NotificationManagerMock(), stateMachineFactory: stateMachineFactory) diff --git a/UnitTests/Sources/VoiceMessageMediaManagerTests.swift b/UnitTests/Sources/VoiceMessageMediaManagerTests.swift index 2c75cdfdb..1bd6cab36 100644 --- a/UnitTests/Sources/VoiceMessageMediaManagerTests.swift +++ b/UnitTests/Sources/VoiceMessageMediaManagerTests.swift @@ -22,7 +22,7 @@ struct VoiceMessageMediaManagerTests { init() { voiceMessageCache = VoiceMessageCacheMock() - mediaProvider = MediaProviderMock(configuration: .init()) + mediaProvider = MediaProviderMock(.init()) mediaProvider.loadFileFromSourceFilenameClosure = nil mediaProvider.loadFileFromSourceFilenameReturnValue = .failure(.failedRetrievingFile) voiceMessageMediaManager = VoiceMessageMediaManager(mediaProvider: mediaProvider,