diff --git a/Sources/StreamChatSwiftUI/CommonViews/NavigationBarThemeViewModifier.swift b/Sources/StreamChatSwiftUI/CommonViews/NavigationBarThemeViewModifier.swift index 90eb6673a..a7cfc60bd 100644 --- a/Sources/StreamChatSwiftUI/CommonViews/NavigationBarThemeViewModifier.swift +++ b/Sources/StreamChatSwiftUI/CommonViews/NavigationBarThemeViewModifier.swift @@ -11,11 +11,30 @@ extension View { } private struct NavigationBarThemeViewModifier: ViewModifier { + @Environment(\.streamLiquidGlassEffectsEnabled) private var glassEffectsEnabled @Injected(\.colors) var colors let toolbarContent: () -> T func body(content: Content) -> some View { + #if compiler(>=6.2) + if #available(iOS 26.0, *), !glassEffectsEnabled { + content + .accentColor(Color(colors.accentPrimary)) + .modifier(NavigationBarBackgroundViewModifier()) + .toolbar { + toolbarContent() + .sharedBackgroundVisibility(.hidden) + } + } else { + themedContent(content) + } + #else + themedContent(content) + #endif + } + + private func themedContent(_ content: Content) -> some View { content .accentColor(Color(colors.accentPrimary)) .modifier(NavigationBarBackgroundViewModifier()) diff --git a/Sources/StreamChatSwiftUI/Utils/LiquidGlassEnvironment.swift b/Sources/StreamChatSwiftUI/Utils/LiquidGlassEnvironment.swift new file mode 100644 index 000000000..5498519fb --- /dev/null +++ b/Sources/StreamChatSwiftUI/Utils/LiquidGlassEnvironment.swift @@ -0,0 +1,16 @@ +// +// Copyright © 2026 Stream.io Inc. All rights reserved. +// + +import SwiftUI + +private struct StreamLiquidGlassEffectsEnabledKey: EnvironmentKey { + static let defaultValue = true +} + +extension EnvironmentValues { + var streamLiquidGlassEffectsEnabled: Bool { + get { self[StreamLiquidGlassEffectsEnabledKey.self] } + set { self[StreamLiquidGlassEffectsEnabledKey.self] = newValue } + } +} diff --git a/Sources/StreamChatSwiftUI/Utils/LiquidGlassModifiers.swift b/Sources/StreamChatSwiftUI/Utils/LiquidGlassModifiers.swift index 974a7907d..65105ad1d 100644 --- a/Sources/StreamChatSwiftUI/Utils/LiquidGlassModifiers.swift +++ b/Sources/StreamChatSwiftUI/Utils/LiquidGlassModifiers.swift @@ -5,6 +5,8 @@ import SwiftUI public struct LiquidGlassModifier: ViewModifier { + @Environment(\.streamLiquidGlassEffectsEnabled) private var glassEffectsEnabled + var shape: BackgroundShape var isInteractive: Bool @@ -18,7 +20,7 @@ public struct LiquidGlassModifier: ViewModifier { public func body(content: Content) -> some View { #if swift(>=6.2) - if #available(iOS 26.0, *) { + if #available(iOS 26.0, *), glassEffectsEnabled { content .contentShape(shape) .modifier(BorderModifier(shape: shape)) @@ -33,6 +35,8 @@ public struct LiquidGlassModifier: ViewModifier { } public struct LiquidGlassBorderlessModifier: ViewModifier { + @Environment(\.streamLiquidGlassEffectsEnabled) private var glassEffectsEnabled + var shape: BackgroundShape var isInteractive: Bool @@ -46,7 +50,7 @@ public struct LiquidGlassBorderlessModifier: ViewModifie public func body(content: Content) -> some View { #if swift(>=6.2) - if #available(iOS 26.0, *) { + if #available(iOS 26.0, *), glassEffectsEnabled { content .contentShape(shape) .clipShape(shape) diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 5ff694e28..52ec764a3 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -908,7 +908,7 @@ INFOPLIST_FILE = Sources/StreamChatSwiftUI/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_GENERATE_MAP_FILE = YES; LD_MAP_FILE_PATH = "linkmaps/$(PRODUCT_NAME)-$(CURRENT_ARCH)-LinkMap.txt"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1007,7 +1007,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1028,7 +1028,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.getstream.iOS.StreamChatSwiftUITestsAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1047,7 +1047,7 @@ DEVELOPMENT_TEAM = EHV7XZLAHA; GCC_OPTIMIZATION_LEVEL = s; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.getstream.iOS.StreamChatSwiftUITestsAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1066,7 +1066,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = io.getstream.iOS.StreamChatSwiftUITestsAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1099,7 +1099,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1135,7 +1135,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1286,7 +1286,7 @@ INFOPLIST_FILE = Sources/StreamChatSwiftUI/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_GENERATE_MAP_FILE = YES; LD_MAP_FILE_PATH = "linkmaps/$(PRODUCT_NAME)-$(CURRENT_ARCH)-LinkMap.txt"; LD_RUNPATH_SEARCH_PATHS = ( @@ -1323,7 +1323,7 @@ INFOPLIST_FILE = Sources/StreamChatSwiftUI/Info.plist; INFOPLIST_KEY_NSHumanReadableCopyright = ""; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_GENERATE_MAP_FILE = YES; LD_MAP_FILE_PATH = "linkmaps/$(PRODUCT_NAME)-$(CURRENT_ARCH)-LinkMap.txt"; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift index e59d6aab4..cc0bc77e0 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift @@ -33,7 +33,7 @@ import XCTest }.applyDefaultSize() // Then - AssertSnapshot(view) + assertSnapshotWithoutVisualEffects(view) } func test_chatChannelInfoView_rtlSnapshot() { @@ -59,7 +59,7 @@ import XCTest .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: precision), named: "rtl") + assertSnapshotWithoutVisualEffects(view, named: "rtl") } func test_chatChannelInfoView_directChannelOfflineSnapshot() { @@ -315,7 +315,7 @@ import XCTest .applyDefaultSize() // Then - assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: precision)) + assertSnapshotWithoutVisualEffects(navigationView, named: nil) } func test_chatChannelInfoView_addUsersShownSnapshot() { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/EditGroupView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/EditGroupView_Tests.swift index 68c8848f5..e0e11bbdd 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/EditGroupView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/EditGroupView_Tests.swift @@ -22,7 +22,7 @@ import XCTest .applyDefaultSize() // Then - AssertSnapshot(view) + assertSnapshotWithoutVisualEffects(view) } func test_editGroupView_uploadingSnapshot() { @@ -47,7 +47,7 @@ import XCTest .applyDefaultSize() // Then - AssertSnapshot(view, variants: [.rightToLeftLayout]) + assertSnapshotWithoutVisualEffects(view, variants: [.rightToLeftLayout]) } // MARK: - GroupAvatarPickerSheetView snapshots diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberAddView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberAddView_Tests.swift index 6af939a07..2a3bc12e4 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberAddView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberAddView_Tests.swift @@ -26,7 +26,7 @@ import XCTest .applyDefaultSize() // Then - AssertSnapshot(view) + assertSnapshotWithoutVisualEffects(view) } func test_memberAddView_selectedUsersSnapshot() { @@ -46,7 +46,7 @@ import XCTest .applyDefaultSize() // Then - AssertSnapshot(view) + assertSnapshotWithoutVisualEffects(view) } func test_memberAddView_alreadyMemberSnapshot() { @@ -65,6 +65,6 @@ import XCTest .applyDefaultSize() // Then - AssertSnapshot(view) + assertSnapshotWithoutVisualEffects(view) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberListView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberListView_Tests.swift index fbd3b9abc..382a1f16b 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberListView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MemberListView_Tests.swift @@ -32,7 +32,7 @@ import XCTest .applyDefaultSize() // Then - AssertSnapshot(view) + assertSnapshotWithoutVisualEffects(view) } func test_memberListView_withMutedMemberSnapshot() { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png index b269b0cfa..f178922b8 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_rtlSnapshot.rtl.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_rtlSnapshot.rtl.png index 3f0c03c07..7f316e822 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_rtlSnapshot.rtl.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_rtlSnapshot.rtl.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_filledNameRightToLeft_snapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_filledNameRightToLeft_snapshot.rightToLeftLayout-default.png index a3561971c..510972e3d 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_filledNameRightToLeft_snapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_filledNameRightToLeft_snapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.default-light.png index ef0283f51..5c71a7445 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.extraExtraExtraLarge-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.extraExtraExtraLarge-light.png index c813c5e3b..3d6189953 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.extraExtraExtraLarge-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.extraExtraExtraLarge-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.rightToLeftLayout-default.png index 1ec4c046a..167c1959a 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.small-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.small-dark.png index db7e4f7ba..3e8d4c498 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.small-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/EditGroupView_Tests/test_editGroupView_snapshot.small-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.default-light.png index f373fb802..f8198204f 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.extraExtraExtraLarge-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.extraExtraExtraLarge-light.png index 31e436eb1..dcbc5cf6e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.extraExtraExtraLarge-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.extraExtraExtraLarge-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.rightToLeftLayout-default.png index cb9e13e88..dbf386b05 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.small-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.small-dark.png index 1afa546dd..0f433147b 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.small-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_alreadyMemberSnapshot.small-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.default-light.png index 051aecdca..59444bd5b 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.extraExtraExtraLarge-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.extraExtraExtraLarge-light.png index 5ffac081a..7459f600e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.extraExtraExtraLarge-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.extraExtraExtraLarge-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.rightToLeftLayout-default.png index 667233b94..ff5e98630 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.small-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.small-dark.png index 9848fc5bf..c2cb7e958 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.small-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_selectedUsersSnapshot.small-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.default-light.png index ca8e1cd13..c4ee3031f 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.extraExtraExtraLarge-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.extraExtraExtraLarge-light.png index 8e13f9754..5a6c337c1 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.extraExtraExtraLarge-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.extraExtraExtraLarge-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.rightToLeftLayout-default.png index 86fdd6c52..3ef82237f 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.small-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.small-dark.png index b2796eb45..dc7906604 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.small-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberAddView_Tests/test_memberAddView_snapshot.small-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.default-light.png index 6487562d0..8e8d8b3e7 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.extraExtraExtraLarge-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.extraExtraExtraLarge-light.png index 01d9dfff6..314e4afdd 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.extraExtraExtraLarge-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.extraExtraExtraLarge-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.rightToLeftLayout-default.png index 5dc091f88..0e91657b2 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.small-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.small-dark.png index 7de18e925..62695ccd9 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.small-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MemberListView_Tests/test_memberListView_withAddButtonSnapshot.small-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/CreatePollView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/CreatePollView_Tests.swift index f1f6ffb75..5e0160368 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/CreatePollView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/CreatePollView_Tests.swift @@ -13,7 +13,7 @@ final class CreatePollView_Tests: StreamChatTestCase { func test_createPollView_snapshot() { let view = makeCreatePollView().applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } func test_createPollView_allOptionsDisabledSnapshot() { @@ -26,7 +26,7 @@ final class CreatePollView_Tests: StreamChatTestCase { maxVotesPerPerson: hidden ) let view = makeCreatePollView().applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } func test_createPollView_allOptionsEnabledSnapshot() { @@ -39,7 +39,7 @@ final class CreatePollView_Tests: StreamChatTestCase { maxVotesPerPerson: enabled ) let view = makeCreatePollView().applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } func test_createPollView_multipleVotesWithoutMaxVotesSnapshot() { @@ -53,7 +53,7 @@ final class CreatePollView_Tests: StreamChatTestCase { maxVotesPerPerson: hidden ) let view = makeCreatePollView().applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } func test_createPollView_mixedOptionsSnapshot() { @@ -68,7 +68,7 @@ final class CreatePollView_Tests: StreamChatTestCase { maxVotesPerPerson: enabled ) let view = makeCreatePollView().applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } // MARK: - Filled State @@ -78,7 +78,7 @@ final class CreatePollView_Tests: StreamChatTestCase { question: "What's your favorite color?", options: ["Red", "Blue", "Green", ""] ).applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } func test_createPollView_duplicateOptionsSnapshot() { @@ -86,7 +86,7 @@ final class CreatePollView_Tests: StreamChatTestCase { question: "Pick a number", options: ["One", "Two", "One", ""] ).applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } func test_createPollView_manyOptionsSnapshot() { @@ -94,7 +94,7 @@ final class CreatePollView_Tests: StreamChatTestCase { question: "Best programming language?", options: ["Swift", "Kotlin", "TypeScript", "Rust", "Go", ""] ).applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } // MARK: - RTL @@ -104,7 +104,7 @@ final class CreatePollView_Tests: StreamChatTestCase { question: "ما هي مدينتك المفضلة؟", options: ["برشلونة", "لشبونة", "أمستردام"] ).applyDefaultSize() - AssertSnapshot(view, variants: [.rightToLeftLayout]) + assertSnapshotWithoutVisualEffects(view, variants: [.rightToLeftLayout]) } func test_createPollView_duplicateOptionsRightToLeft_snapshot() { @@ -112,7 +112,7 @@ final class CreatePollView_Tests: StreamChatTestCase { question: "اختر رقماً", options: ["واحد", "اثنان", "واحد"] ).applyDefaultSize() - AssertSnapshot(view, variants: [.rightToLeftLayout]) + assertSnapshotWithoutVisualEffects(view, variants: [.rightToLeftLayout]) } // MARK: - Helpers diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/PollCommentsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/PollCommentsView_Tests.swift index f1350f3b3..8637f6f84 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/PollCommentsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/PollCommentsView_Tests.swift @@ -220,7 +220,7 @@ import XCTest ) .applyDefaultSize() - AssertSnapshot(view, variants: .onlyUserInterfaceStyles) + assertSnapshotWithoutVisualEffects(view, variants: .onlyUserInterfaceStyles) } // MARK: - RTL diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-dark.png index 198beab67..1a8188b96 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-light.png index 4c68a8ed5..c1bdae955 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsDisabledSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-dark.png index 9aef68b8b..c0b319f4c 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-light.png index bc8c24bf6..d3e7e0e0e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_allOptionsEnabledSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsRightToLeft_snapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsRightToLeft_snapshot.rightToLeftLayout-default.png index f4e51b4df..12526712e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsRightToLeft_snapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsRightToLeft_snapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-dark.png index c9db10ced..d356e9b9b 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-light.png index dbc31dc7c..b14df4aec 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_duplicateOptionsSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledOptionsRightToLeft_snapshot.rightToLeftLayout-default.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledOptionsRightToLeft_snapshot.rightToLeftLayout-default.png index a1fadb282..3c4a10f03 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledOptionsRightToLeft_snapshot.rightToLeftLayout-default.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledOptionsRightToLeft_snapshot.rightToLeftLayout-default.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-dark.png index 537fe5df4..c81f5c246 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-light.png index bcf35460a..af31fd57f 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_filledQuestionAndOptionsSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-dark.png index 616970d87..c1f0cd28d 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-light.png index 318d861f3..062460553 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_manyOptionsSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-dark.png index f00b6dece..adef2a031 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-light.png index 70616bbc9..85292ba27 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_mixedOptionsSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-dark.png index c3a247023..9916de485 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-light.png index b0e0e5d43..151431b41 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_multipleVotesWithoutMaxVotesSnapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-dark.png index 0c14a7343..f73830c12 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-light.png index e0f110747..9ffb3bc46 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/CreatePollView_Tests/test_createPollView_snapshot.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-dark.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-dark.png index 3c2a6b66a..51c26938a 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-dark.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-dark.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-light.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-light.png index ed70a21a4..bb720b735 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-light.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/PollCommentsView_Tests/test_pollCommentsView_addCommentButtonVisible.default-light.png differ diff --git a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift index 2b81d17a6..bbfe880bf 100644 --- a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift +++ b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift @@ -2,6 +2,7 @@ // Copyright © 2026 Stream.io Inc. All rights reserved. // +import SnapshotTesting @testable import StreamChat @testable import StreamChatCommonUI @testable import StreamChatSwiftUI @@ -87,6 +88,150 @@ import XCTest } } +extension StreamChatTestCase { + func assertSnapshotWithoutVisualEffects( + _ view: View, + variants: [SnapshotVariant] = SnapshotVariant.all, + device: ViewImageConfig = .iPhoneX, + size: CGSize? = nil, + suffix: String? = nil, + record: Bool = false, + line: UInt = #line, + file: StaticString = #filePath, + function: String = #function + ) { + variants.forEach { variant in + let snapshotSize = size ?? device.size ?? defaultScreenSize + let traits = UITraitCollection(traitsFrom: [device.traits, variant.traits]) + let image = renderedSnapshot( + of: view.environment(\.streamLiquidGlassEffectsEnabled, false), + size: snapshotSize, + safeAreaInsets: device.safeArea, + traits: traits + ) + assertSnapshot( + matching: image, + as: .image(perceptualPrecision: precision), + named: variant.snapshotName + (suffix.map { "." + $0 } ?? ""), + record: overrideRecording ?? record, + file: file, + testName: function, + line: line + ) + } + } + + func assertSnapshotWithoutVisualEffects( + _ view: View, + named name: String?, + record: Bool = false, + line: UInt = #line, + file: StaticString = #filePath, + function: String = #function + ) { + let displayScale = UIApplication.shared.connectedScenes + .compactMap { ($0 as? UIWindowScene)?.screen.scale } + .first ?? 1 + let traits = UITraitCollection(displayScale: displayScale) + let image = renderedSnapshot( + of: view.environment(\.streamLiquidGlassEffectsEnabled, false), + size: defaultScreenSize, + safeAreaInsets: .zero, + traits: traits + ) + assertSnapshot( + matching: image, + as: .image(perceptualPrecision: precision), + named: name, + record: overrideRecording ?? record, + file: file, + testName: function, + line: line + ) + } + + private func renderedSnapshot( + of view: View, + size: CGSize, + safeAreaInsets: UIEdgeInsets, + traits: UITraitCollection + ) -> UIImage { + testWindow?.isHidden = true + testWindow = nil + + let frame = CGRect(origin: .zero, size: size) + let window: SnapshotWindow + if let windowScene = UIApplication.shared.connectedScenes + .compactMap({ $0 as? UIWindowScene }) + .first(where: { $0.activationState == .foregroundActive }) { + window = SnapshotWindow(windowScene: windowScene, frame: frame, safeAreaInsets: safeAreaInsets) + } else { + window = SnapshotWindow(frame: frame, safeAreaInsets: safeAreaInsets) + } + defer { + window.isHidden = true + testWindow = nil + } + + let hostingController = UIHostingController(rootView: view) + let container = UIViewController() + container.view.backgroundColor = .clear + container.view.frame = frame + container.addChild(hostingController) + hostingController.view.frame = container.view.bounds + hostingController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] + container.view.addSubview(hostingController.view) + container.setOverrideTraitCollection(traits, forChild: hostingController) + hostingController.didMove(toParent: container) + + window.rootViewController = container + window.makeKeyAndVisible() + testWindow = window + + container.beginAppearanceTransition(true, animated: false) + container.endAppearanceTransition() + container.view.setNeedsLayout() + container.view.layoutIfNeeded() + hostingController.view.setNeedsLayout() + hostingController.view.layoutIfNeeded() + RunLoop.main.run(until: Date(timeIntervalSinceNow: 0.01)) + container.view.layoutIfNeeded() + hostingController.view.layoutIfNeeded() + + let format = UIGraphicsImageRendererFormat(for: traits) + let renderer = UIGraphicsImageRenderer(bounds: frame, format: format) + return renderer.image { context in + if !window.drawHierarchy(in: frame, afterScreenUpdates: false) { + window.layer.render(in: context.cgContext) + } + } + } +} + +private final class SnapshotWindow: UIWindow { + private let configuredSafeAreaInsets: UIEdgeInsets + + init(frame: CGRect, safeAreaInsets: UIEdgeInsets) { + configuredSafeAreaInsets = safeAreaInsets + super.init(frame: frame) + } + + init(windowScene: UIWindowScene, frame: CGRect, safeAreaInsets: UIEdgeInsets) { + configuredSafeAreaInsets = safeAreaInsets + super.init(windowScene: windowScene) + self.frame = frame + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override var safeAreaInsets: UIEdgeInsets { + configuredSafeAreaInsets + } +} + // Forces the solid primary button style regardless of platform, /// preventing Liquid Glass from appearing in snapshot tests. struct RegularToolbarConfirmActionModifier: ViewModifier {