mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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:
@@ -18,7 +18,6 @@ final class CreateRoomScreenViewModelTests {
|
||||
var userSession: UserSessionMock!
|
||||
|
||||
private let appSettings: AppSettings
|
||||
private let analytics: AnalyticsService
|
||||
|
||||
private let usersSubject = CurrentValueSubject<[UserProfileProxy], Never>([])
|
||||
|
||||
@@ -28,7 +27,6 @@ final class CreateRoomScreenViewModelTests {
|
||||
|
||||
init() {
|
||||
appSettings = AppSettings()
|
||||
analytics = .mock(settings: appSettings)
|
||||
}
|
||||
|
||||
deinit {
|
||||
@@ -95,7 +93,7 @@ final class CreateRoomScreenViewModelTests {
|
||||
spaceSelectionMode: .none,
|
||||
shouldShowCancelButton: false,
|
||||
userSession: userSession,
|
||||
analytics: analytics,
|
||||
analytics: AnalyticsServiceMock.default(),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appSettings: appSettings)
|
||||
self.viewModel = viewModel
|
||||
@@ -345,7 +343,7 @@ final class CreateRoomScreenViewModelTests {
|
||||
spaceSelectionMode: spacesSelectionMode,
|
||||
shouldShowCancelButton: false,
|
||||
userSession: userSession,
|
||||
analytics: analytics,
|
||||
analytics: AnalyticsServiceMock.default(),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appSettings: appSettings)
|
||||
self.viewModel = viewModel
|
||||
|
||||
Reference in New Issue
Block a user