mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
MockMediaProvider → MediaProviderMock.
This commit is contained in:
@@ -17,7 +17,7 @@ class BlockedUsersScreenViewModelTests: XCTestCase {
|
||||
|
||||
let viewModel = BlockedUsersScreenViewModel(hideProfiles: true,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
|
||||
let deferred = deferFailure(viewModel.context.$viewState, timeout: 1) { $0.blockedUsers.contains(where: { $0.displayName != nil }) }
|
||||
@@ -32,7 +32,7 @@ class BlockedUsersScreenViewModelTests: XCTestCase {
|
||||
|
||||
let viewModel = BlockedUsersScreenViewModel(hideProfiles: false,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
|
||||
let deferred = deferFulfillment(viewModel.context.$viewState) { $0.blockedUsers.contains(where: { $0.displayName != nil }) }
|
||||
|
||||
@@ -28,7 +28,7 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
||||
draftServiceMock = ComposerDraftServiceMock()
|
||||
viewModel = ComposerToolbarViewModel(wysiwygViewModel: wysiwygViewModel,
|
||||
completionSuggestionService: completionSuggestionServiceMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mentionDisplayHelper: ComposerMentionDisplayHelper.mock,
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
composerDraftService: draftServiceMock)
|
||||
@@ -105,7 +105,7 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
||||
let mockCompletionSuggestionService = CompletionSuggestionServiceMock(configuration: .init(suggestions: suggestions))
|
||||
viewModel = ComposerToolbarViewModel(wysiwygViewModel: wysiwygViewModel,
|
||||
completionSuggestionService: mockCompletionSuggestionService,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mentionDisplayHelper: ComposerMentionDisplayHelper.mock,
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
composerDraftService: draftServiceMock)
|
||||
|
||||
@@ -19,7 +19,7 @@ class GlobalSearchScreenViewModelTests: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
cancellables.removeAll()
|
||||
viewModel = GlobalSearchScreenViewModel(roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))),
|
||||
mediaProvider: MockMediaProvider())
|
||||
mediaProvider: MediaProviderMock(configuration: .init()))
|
||||
context = viewModel.context
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class InviteUsersScreenViewModelTests: XCTestCase {
|
||||
let viewModel = InviteUsersScreenViewModel(clientProxy: ClientProxyMock(.init()),
|
||||
selectedUsers: usersSubject.asCurrentValuePublisher(),
|
||||
roomType: roomType,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userDiscoveryService: userDiscoveryService,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
viewModel.state.usersSection = .init(type: .suggestions, users: [.mockAlice, .mockBob, .mockCharlie])
|
||||
|
||||
@@ -63,7 +63,7 @@ class JoinRoomScreenViewModelTests: XCTestCase {
|
||||
viewModel = JoinRoomScreenViewModel(roomID: "1",
|
||||
via: [],
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class MessageForwardingScreenViewModelTests: XCTestCase {
|
||||
clientProxy: clientProxy,
|
||||
roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
mediaProvider: MockMediaProvider())
|
||||
mediaProvider: MediaProviderMock(configuration: .init()))
|
||||
context = viewModel.context
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class PillContextTests: XCTestCase {
|
||||
proxyMock.membersPublisher = subject.asCurrentValuePublisher()
|
||||
let mock = TimelineViewModel(roomProxy: proxyMock,
|
||||
timelineController: MockRoomTimelineController(),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
@@ -47,7 +47,7 @@ class PillContextTests: XCTestCase {
|
||||
proxyMock.membersPublisher = subject.asCurrentValuePublisher()
|
||||
let mock = TimelineViewModel(roomProxy: proxyMock,
|
||||
timelineController: MockRoomTimelineController(),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
@@ -68,7 +68,7 @@ class PillContextTests: XCTestCase {
|
||||
mockController.roomProxy = proxyMock
|
||||
let mock = TimelineViewModel(roomProxy: proxyMock,
|
||||
timelineController: mockController,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
|
||||
@@ -196,7 +196,7 @@ class RoomChangeRolesScreenViewModelTests: XCTestCase {
|
||||
roomProxy = JoinedRoomProxyMock(.init(members: .allMembersAsAdmin))
|
||||
viewModel = RoomChangeRolesScreenViewModel(mode: mode,
|
||||
roomProxy: roomProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class RoomDetailsEditScreenViewModelTests: XCTestCase {
|
||||
private func setupViewModel(roomProxyConfiguration: JoinedRoomProxyMockConfiguration) {
|
||||
userIndicatorController = UserIndicatorControllerMock.default
|
||||
viewModel = .init(roomProxy: JoinedRoomProxyMock(roomProxyConfiguration),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: userIndicatorController)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
notificationSettingsProxyMock = NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration())
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: notificationSettingsProxyMock,
|
||||
@@ -42,7 +42,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isPublic: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -65,7 +65,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isPublic: false, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -89,7 +89,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isPublic: false, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -143,7 +143,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -167,7 +167,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -202,7 +202,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -236,7 +236,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -271,7 +271,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isEncrypted: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -307,7 +307,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
canUserInvite: false))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -325,7 +325,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isPublic: true, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -362,7 +362,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
}
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -386,7 +386,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
}
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -410,7 +410,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
}
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -431,7 +431,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: false, isPublic: false, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -452,7 +452,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock = JoinedRoomProxyMock(.init(name: "Test", isDirect: true, isPublic: false, members: mockedMembers))
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
@@ -471,7 +471,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError = NotificationSettingsError.Generic(msg: "error")
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: notificationSettingsProxyMock,
|
||||
|
||||
@@ -29,7 +29,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -46,7 +46,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -84,7 +84,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -121,7 +121,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -157,7 +157,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -193,7 +193,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -210,7 +210,7 @@ class RoomMemberDetailsViewModelTests: XCTestCase {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: roomMemberProxyMock.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ class RoomMembersListScreenViewModelTests: XCTestCase {
|
||||
private func setup(with members: [RoomMemberProxyMock]) {
|
||||
roomProxy = JoinedRoomProxyMock(.init(name: "test", members: members))
|
||||
viewModel = .init(roomProxy: roomProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock.underlyingActionsPublisher = updateSubject.eraseToAnyPublisher()
|
||||
let viewModel = RoomScreenViewModel(roomProxy: roomProxyMock,
|
||||
initialSelectedPinnedEventID: nil,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock.default,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
@@ -113,7 +113,7 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock.underlyingPinnedEventsTimeline = pinnedTimelineMock
|
||||
let viewModel = RoomScreenViewModel(roomProxy: roomProxyMock,
|
||||
initialSelectedPinnedEventID: "test1",
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock.default,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
@@ -160,7 +160,7 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
roomProxyMock.underlyingActionsPublisher = updateSubject.eraseToAnyPublisher()
|
||||
let viewModel = RoomScreenViewModel(roomProxy: roomProxyMock,
|
||||
initialSelectedPinnedEventID: nil,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock.default,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
@@ -197,7 +197,7 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
let roomProxyMock = JoinedRoomProxyMock(.init(id: "MyRoomID"))
|
||||
let viewModel = RoomScreenViewModel(roomProxy: roomProxyMock,
|
||||
initialSelectedPinnedEventID: nil,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: ongoingCallRoomIDSubject.asCurrentValuePublisher(),
|
||||
appMediator: AppMediatorMock.default,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
|
||||
@@ -303,7 +303,7 @@ class TimelineViewModelTests: XCTestCase {
|
||||
|
||||
let viewModel = TimelineViewModel(roomProxy: roomProxy,
|
||||
timelineController: timelineController,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: userIndicatorControllerMock,
|
||||
@@ -327,7 +327,7 @@ class TimelineViewModelTests: XCTestCase {
|
||||
timelineController.timelineItems = [message]
|
||||
let viewModel = TimelineViewModel(roomProxy: JoinedRoomProxyMock(.init(name: "", members: [RoomMemberProxyMock.mockAlice, RoomMemberProxyMock.mockCharlie])),
|
||||
timelineController: timelineController,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: userIndicatorControllerMock,
|
||||
@@ -353,7 +353,7 @@ class TimelineViewModelTests: XCTestCase {
|
||||
|
||||
let viewModel = TimelineViewModel(roomProxy: roomProxyMock,
|
||||
timelineController: MockRoomTimelineController(),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: userIndicatorControllerMock,
|
||||
@@ -381,7 +381,7 @@ class TimelineViewModelTests: XCTestCase {
|
||||
|
||||
let viewModel = TimelineViewModel(roomProxy: roomProxyMock,
|
||||
timelineController: MockRoomTimelineController(),
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: userIndicatorControllerMock,
|
||||
@@ -410,7 +410,7 @@ class TimelineViewModelTests: XCTestCase {
|
||||
TimelineViewModel(roomProxy: roomProxy ?? JoinedRoomProxyMock(.init(name: "")),
|
||||
focussedEventID: focussedEventID,
|
||||
timelineController: timelineController,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
userIndicatorController: userIndicatorControllerMock,
|
||||
|
||||
@@ -22,7 +22,7 @@ class UserProfileScreenViewModelTests: XCTestCase {
|
||||
viewModel = UserProfileScreenViewModel(userID: profile.userID,
|
||||
isPresentedModally: false,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
@@ -42,7 +42,7 @@ class UserProfileScreenViewModelTests: XCTestCase {
|
||||
viewModel = UserProfileScreenViewModel(userID: profile.userID,
|
||||
isPresentedModally: false,
|
||||
clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaProvider: MediaProviderMock(configuration: .init()),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
analytics: ServiceLocator.shared.analytics)
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@ import XCTest
|
||||
class VoiceMessageMediaManagerTests: XCTestCase {
|
||||
private var voiceMessageMediaManager: VoiceMessageMediaManager!
|
||||
private var voiceMessageCache: VoiceMessageCacheMock!
|
||||
private var mediaProvider: MockMediaProvider!
|
||||
private var mediaProvider: MediaProviderMock!
|
||||
|
||||
private let someURL = URL("/some/url")
|
||||
private let audioOGGMimeType = "audio/ogg"
|
||||
|
||||
override func setUp() async throws {
|
||||
voiceMessageCache = VoiceMessageCacheMock()
|
||||
mediaProvider = MockMediaProvider()
|
||||
mediaProvider = MediaProviderMock(configuration: .init())
|
||||
voiceMessageMediaManager = VoiceMessageMediaManager(mediaProvider: mediaProvider,
|
||||
voiceMessageCache: voiceMessageCache)
|
||||
}
|
||||
@@ -50,7 +50,7 @@ class VoiceMessageMediaManagerTests: XCTestCase {
|
||||
|
||||
voiceMessageCache.fileURLForReturnValue = nil
|
||||
let mediaSource = MediaSourceProxy(url: someURL, mimeType: "audio/ogg; codecs=opus")
|
||||
mediaProvider.loadFileFromSourceReturnValue = MediaFileHandleProxy.unmanaged(url: loadedFile)
|
||||
mediaProvider.loadFileFromSourceBodyReturnValue = .success(MediaFileHandleProxy.unmanaged(url: loadedFile))
|
||||
voiceMessageCache.cacheMediaSourceUsingMoveReturnValue = .success(cachedConvertedFileURL)
|
||||
|
||||
voiceMessageMediaManager = VoiceMessageMediaManager(mediaProvider: mediaProvider,
|
||||
@@ -103,7 +103,7 @@ class VoiceMessageMediaManagerTests: XCTestCase {
|
||||
// Check if the file is not already present in cache
|
||||
voiceMessageCache.fileURLForReturnValue = nil
|
||||
let mediaSource = MediaSourceProxy(url: someURL, mimeType: audioOGGMimeType)
|
||||
mediaProvider.loadFileFromSourceReturnValue = MediaFileHandleProxy.unmanaged(url: loadedFile)
|
||||
mediaProvider.loadFileFromSourceBodyReturnValue = .success(MediaFileHandleProxy.unmanaged(url: loadedFile))
|
||||
let audioConverter = AudioConverterMock()
|
||||
voiceMessageCache.cacheMediaSourceUsingMoveReturnValue = .success(cachedConvertedFileURL)
|
||||
voiceMessageMediaManager = VoiceMessageMediaManager(mediaProvider: mediaProvider,
|
||||
@@ -139,7 +139,7 @@ class VoiceMessageMediaManagerTests: XCTestCase {
|
||||
}
|
||||
|
||||
let audioConverter = AudioConverterMock()
|
||||
mediaProvider.loadFileFromSourceReturnValue = MediaFileHandleProxy.unmanaged(url: loadedFile)
|
||||
mediaProvider.loadFileFromSourceBodyReturnValue = .success(MediaFileHandleProxy.unmanaged(url: loadedFile))
|
||||
|
||||
voiceMessageMediaManager = VoiceMessageMediaManager(mediaProvider: mediaProvider,
|
||||
voiceMessageCache: voiceMessageCache,
|
||||
|
||||
Reference in New Issue
Block a user