From fbacade0d2112767804a8fdfa190690d66b28518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Bu=CC=88nz?= Date: Sun, 6 Oct 2024 13:38:16 +0200 Subject: [PATCH] update tests add feedbackgenerator --- .../Tests/AppFeatureTests/AppFeatureCoreTests.swift | 7 ++++++- .../SettingsFeatureTests/AppearanceSettingsCoreTests.swift | 5 ++++- .../SettingsFeatureTests/RideEventSettingsCoreTests.swift | 5 ++++- .../SettingsFeatureTests/SettingsFeatureCoreTests.swift | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift b/CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift index d83c9fd7..1964102e 100644 --- a/CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift +++ b/CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift @@ -146,6 +146,8 @@ final class AppFeatureTests: XCTestCase { [.mock1] } $0.userDefaultsClient.setBool = { _, _ in } + $0.feedbackGenerator.prepare = {} + $0.feedbackGenerator.selectionChanged = {} } ) store.exhaustivity = .off @@ -200,7 +202,8 @@ final class AppFeatureTests: XCTestCase { $0.continuousClock = testClock $0.nextRideService.nextRide = { _, _, _ in [] } $0.userDefaultsClient.setString = { _, _ in } - $0.observationModeStore.setObservationModeState = { _ in } + $0.observationModeStore.setObservationModeState = { @Sendable _ in } + $0.feedbackGenerator.prepare = { @Sendable in } } ) store.exhaustivity = .off @@ -398,6 +401,7 @@ final class AppFeatureTests: XCTestCase { } $0.continuousClock = TestClock() $0.userDefaultsClient.setBool = { _, _ in } + $0.feedbackGenerator.selectionChanged = {} } ) store.exhaustivity = .off @@ -514,6 +518,7 @@ final class AppFeatureTests: XCTestCase { reducer: { AppFeature() }, withDependencies: { $0.continuousClock = TestClock() + $0.feedbackGenerator.selectionChanged = {} } ) store.exhaustivity = .off diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/AppearanceSettingsCoreTests.swift b/CriticalMapsKit/Tests/SettingsFeatureTests/AppearanceSettingsCoreTests.swift index 9457e7e8..0516542b 100644 --- a/CriticalMapsKit/Tests/SettingsFeatureTests/AppearanceSettingsCoreTests.swift +++ b/CriticalMapsKit/Tests/SettingsFeatureTests/AppearanceSettingsCoreTests.swift @@ -11,7 +11,10 @@ final class AppearanceSettingsCoreTests: XCTestCase { let overriddenIconName = LockIsolated(nil) let store = TestStore( initialState: AppearanceSettings(), - reducer: { AppearanceSettingsFeature() } + reducer: { AppearanceSettingsFeature() }, + withDependencies: { + $0.feedbackGenerator.selectionChanged = {} + } ) store.dependencies.uiApplicationClient.setAlternateIconName = { newValue in overriddenIconName.setValue(newValue) diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/RideEventSettingsCoreTests.swift b/CriticalMapsKit/Tests/SettingsFeatureTests/RideEventSettingsCoreTests.swift index b15adf09..bb150f5c 100644 --- a/CriticalMapsKit/Tests/SettingsFeatureTests/RideEventSettingsCoreTests.swift +++ b/CriticalMapsKit/Tests/SettingsFeatureTests/RideEventSettingsCoreTests.swift @@ -55,7 +55,10 @@ final class RideEventSettingsCoreTests: XCTestCase { eventDistance: .close ) ), - reducer: { RideEventsSettingsFeature() } + reducer: { RideEventsSettingsFeature() }, + withDependencies: { + $0.feedbackGenerator.selectionChanged = {} + } ) await store.send(.set(\.$eventSearchRadius, .near)) { diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsFeatureCoreTests.swift b/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsFeatureCoreTests.swift index d9c684e8..5a69717f 100644 --- a/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsFeatureCoreTests.swift +++ b/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsFeatureCoreTests.swift @@ -163,7 +163,8 @@ final class SettingsFeatureCoreTests: XCTestCase { $0.fileClient.save = { @Sendable _, _ in didSaveUserSettings.setValue(true) } - $0.observationModeStore.setObservationModeState = { _ in } + $0.observationModeStore.setObservationModeState = { @Sendable _ in } + $0.feedbackGenerator.selectionChanged = {} } )