mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 03:48:27 +00:00
Make AnalyticsService mockable via `AnalyticsServiceProtocol (#5599)
* Create AnalyticsServiceProtocol and conform AnalyticsService * Replace AnalyticsService properties and arguments with AnalyticsServiceProtocol * Inline AnalyticsServiceMock replacing old mock * handle more complex AnalyticsServiceMock callsites * move documentation from AnalyticsService to AnalyticsServiceProtocol
This commit is contained in:
@@ -21,16 +21,12 @@ final class HomeScreenViewModelTests {
|
||||
var roomSummaryProvider: RoomSummaryProviderMock!
|
||||
var notificationManager: NotificationManagerMock!
|
||||
private let appSettings: AppSettings
|
||||
private let analytics: AnalyticsService
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
|
||||
var cancellables = Set<AnyCancellable>()
|
||||
|
||||
init() {
|
||||
AppSettings.resetAllSettings()
|
||||
appSettings = AppSettings()
|
||||
analytics = .mock(settings: appSettings)
|
||||
userIndicatorController = UserIndicatorControllerMock.default
|
||||
}
|
||||
|
||||
deinit {
|
||||
@@ -444,9 +440,9 @@ final class HomeScreenViewModelTests {
|
||||
viewModel = HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: appSettings,
|
||||
analyticsService: analytics,
|
||||
analyticsService: AnalyticsServiceMock.default(),
|
||||
notificationManager: notificationManager,
|
||||
userIndicatorController: userIndicatorController)
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user