Tidy up mock creation. (#5627)

* Use our standard XYZMock(.init()) pattern everywhere instead of XYZMock.default.

* Remove the configuration parameter label on mock convenience inits.

* Update the enterprise submodule.
This commit is contained in:
Doug
2026-05-22 17:34:35 +01:00
committed by GitHub
parent edd7130a97
commit 08d02001bf
146 changed files with 540 additions and 546 deletions
@@ -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 {
@@ -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)
}
}
@@ -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)
@@ -142,6 +142,6 @@ struct UserDetailsEditScreen_Previews: PreviewProvider, TestablePreview {
canChangeAvatar: canChangeProfile,
canChangeDisplayName: canChangeProfile)))),
mediaUploadingPreprocessor: .init(appSettings: .volatile()),
userIndicatorController: UserIndicatorControllerMock.default)
userIndicatorController: UserIndicatorControllerMock())
}
}