diff --git a/CriticalMapsKit/Sources/TestHelper/XCTestCase+Additions.swift b/CriticalMapsKit/Sources/TestHelper/XCTestCase+Additions.swift index 49ed9125c..db6fea156 100644 --- a/CriticalMapsKit/Sources/TestHelper/XCTestCase+Additions.swift +++ b/CriticalMapsKit/Sources/TestHelper/XCTestCase+Additions.swift @@ -7,7 +7,7 @@ private let operatingSystemVersion = ProcessInfo().operatingSystemVersion public extension XCTestCase { private func enforceSnapshotDevice() { let is2XDevice = UIScreen.main.scale >= 2 - let isMinVersion14 = operatingSystemVersion.majorVersion >= 14 + let isMinVersion14 = operatingSystemVersion.majorVersion >= 15 guard is2XDevice, isMinVersion14 else { fatalError("Screenshot test device should use @2x screen scale and iOS 14.4") @@ -26,15 +26,23 @@ public extension XCTestCase { enforceSnapshotDevice() let precision: Float = (sloppy ? XCTestCase.sloppyPrecision : 1) - assertSnapshots( - matching: view, - as: [ - .image(precision: precision, layout: .device(config: .iPhoneX)) - ], - file: file, - testName: testName, - line: line - ) + + withSnapshotTesting(diffTool: .ksdiff) { + assertSnapshots( + of: view, + as: [ + .image( + precision: precision, + perceptualPrecision: precision, + layout: .device(config: .iPhone13), + traits: .iPhone13(.portrait) + ) + ], + file: file, + testName: testName, + line: line + ) + } } func assertViewSnapshot( diff --git a/CriticalMapsKit/Tests/AppFeatureTests/AppNavigationViewSnapshotTests.swift b/CriticalMapsKit/Tests/AppFeatureTests/AppNavigationViewSnapshotTests.swift index cafc56d7f..4067c0b87 100644 --- a/CriticalMapsKit/Tests/AppFeatureTests/AppNavigationViewSnapshotTests.swift +++ b/CriticalMapsKit/Tests/AppFeatureTests/AppNavigationViewSnapshotTests.swift @@ -5,6 +5,12 @@ import TestHelper import XCTest final class AppNavigationViewSnapshotTests: XCTestCase { + + override func setUp() { + super.setUp() + + } + @MainActor func test_appNavigationView_light() { let view = AppNavigationView( @@ -14,15 +20,17 @@ final class AppNavigationViewSnapshotTests: XCTestCase { ) ) - assertSnapshots( - matching: view, - as: [ - .image(precision: 0.9, layout: .device(config: .iPhoneX)) - ], - file: #file, - testName: #function, - line: #line - ) + withSnapshotTesting(diffTool: .ksdiff) { + assertSnapshots( + matching: view, + as: [ + .image(precision: 0.9, layout: .device(config: .iPhoneX)) + ], + file: #file, + testName: #function, + line: #line + ) + } } @MainActor diff --git a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge.1.png b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge.1.png index e93b5474a..7a5f3c1a3 100644 Binary files a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge.1.png and b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge.1.png differ diff --git a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge_dark.1.png b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge_dark.1.png index 7d57f4ae1..8541610ed 100644 Binary files a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge_dark.1.png and b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_WithBadge_dark.1.png differ diff --git a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_dark.1.png b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_dark.1.png index 5a0a1a9bd..fdaaf6374 100644 Binary files a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_dark.1.png and b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_dark.1.png differ diff --git a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_light.1.png b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_light.1.png index 10d9d4a0d..0035004c9 100644 Binary files a/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_light.1.png and b/CriticalMapsKit/Tests/AppFeatureTests/__Snapshots__/AppNavigationViewSnapshotTests/test_appNavigationView_light.1.png differ diff --git a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot.1.png b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot.1.png index 0b9939edf..b172d75c4 100644 Binary files a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot.1.png and b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot.1.png differ diff --git a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot_dark.1.png b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot_dark.1.png index 65296ebec..aeed5882c 100644 Binary files a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot_dark.1.png and b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatFeatureViewSnapshot_dark.1.png differ diff --git a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_empty.1.png b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_empty.1.png index fdea29a4d..00fbfa76d 100644 Binary files a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_empty.1.png and b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_empty.1.png differ diff --git a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_nonEmpty.1.png b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_nonEmpty.1.png index c0c7c2e3e..af951963a 100644 Binary files a/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_nonEmpty.1.png and b/CriticalMapsKit/Tests/ChatFeatureTests/__Snapshots__/ChatFeatureSnapshotTests/test_chatInputViewSnapshot_nonEmpty.1.png differ diff --git a/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_follow.1.png b/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_follow.1.png index bb761c1e8..302c087e7 100644 Binary files a/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_follow.1.png and b/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_follow.1.png differ diff --git a/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_followWithHeading.1.png b/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_followWithHeading.1.png index 5c69b106f..19a0e94c5 100644 Binary files a/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_followWithHeading.1.png and b/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_followWithHeading.1.png differ diff --git a/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_none.1.png b/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_none.1.png index 51feb06f2..a64382b53 100644 Binary files a/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_none.1.png and b/CriticalMapsKit/Tests/MapFeatureTests/__Snapshots__/UserTrackingButtonSnapshotTests/test_userTracking_none.1.png differ diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsViewSnapshotTests.swift b/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsViewSnapshotTests.swift index 0931ba81e..c3ab3fdd3 100644 --- a/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsViewSnapshotTests.swift +++ b/CriticalMapsKit/Tests/SettingsFeatureTests/SettingsViewSnapshotTests.swift @@ -8,9 +8,13 @@ final class SettingsViewSnapshotTests: XCTestCase { let settingsView = SettingsView( store: .init( initialState: .init(userSettings: .init()), - reducer: { SettingsFeature() } + reducer: { SettingsFeature() }, + withDependencies: { + $0.uiApplicationClient.alternateIconName = { nil } + } ) ) + .environment(\.colorScheme, .light) assertScreenSnapshot(settingsView, sloppy: true) } diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_disabled.1.png b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_disabled.1.png index 01741cb2f..cdc044375 100644 Binary files a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_disabled.1.png and b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_disabled.1.png differ diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_light.1.png b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_light.1.png index cc641fa5b..3a2ef6c83 100644 Binary files a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_light.1.png and b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/AppearanceSettingsViewSnapshotTests/test_appearanceEventSettingsView_light.1.png differ diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_disabled.1.png b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_disabled.1.png index b251ffbd1..59da4151d 100644 Binary files a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_disabled.1.png and b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_disabled.1.png differ diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_light.1.png b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_light.1.png index da72a3fbf..59da4151d 100644 Binary files a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_light.1.png and b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/RideEventSettingsViewSnapshotTests/test_rideEventSettingsView_light.1.png differ diff --git a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/SettingsViewSnapshotTests/test_settingsView_light.1.png b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/SettingsViewSnapshotTests/test_settingsView_light.1.png index 58184afc9..4a6d9ed6f 100644 Binary files a/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/SettingsViewSnapshotTests/test_settingsView_light.1.png and b/CriticalMapsKit/Tests/SettingsFeatureTests/__Snapshots__/SettingsViewSnapshotTests/test_settingsView_light.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle.1.png index a0174af03..85664e585 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon.1.png index dc94a8543..9480a7163 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon2.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon2.1.png index 398dbd9fa..5540fd3e6 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon2.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ButtonStyleSnapshotTests/test_cmButtonStyle_withIcon2.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_dark.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_dark.1.png index f3360ba33..1504a1565 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_dark.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_dark.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_light.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_light.1.png index 247c9ec40..87316ca36 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_light.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withButton_light.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_dark.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_dark.1.png index fd47f9a7e..280073879 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_dark.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_dark.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_light.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_light.1.png index 470c6a362..ff67670ec 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_light.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/EmptyStateViewSnapshotTests/test_emptyStateView_withoutButton_light.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_dark.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_dark.1.png index 99d74a3d5..5d9be1b17 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_dark.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_dark.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_light.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_light.1.png index fe695352f..93896afb5 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_light.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withButton_light.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_dark.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_dark.1.png index 4742d60be..e40e9d37b 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_dark.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_dark.1.png differ diff --git a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_light.1.png b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_light.1.png index 4b372cf62..b59999e08 100644 Binary files a/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_light.1.png and b/CriticalMapsKit/Tests/StyleguideTests/__Snapshots__/ErrorStateViewSnapshotTests/test_ErrorStateView_withoutButton_light.1.png differ