diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 3eb9c024..45f65921 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -14,7 +14,7 @@ concurrency: env: HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI - IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (17.0)" + IOS_SIMULATOR_DEVICE: "iPhone 14 Pro" jobs: automated-code-review: diff --git a/CHANGELOG.md b/CHANGELOG.md index 95896654..c33a13b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Config for composer text input paddings - Config for left alignment of messages -### 🐞 Fixed +### 🔄 Changed - Made some `ChannelList` and `MessageListView` parameters optional # [4.39.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.39.0) diff --git a/Package.swift b/Package.swift index 9f414544..531eebc8 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.39.0"), + .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.40.0"), ], targets: [ .target( diff --git a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift index 42a4386a..6acbac77 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift @@ -58,7 +58,7 @@ public struct MessageBubbleModifier: ViewModifier { if utils.messageListConfig.messageListAlignment == .leftAligned { self.forceLeftToRight = true } else { - self.forceLeftToRight = forceLeftToRight + self.forceLeftToRight = forceLeftToRight } self.topPadding = topPadding self.bottomPadding = bottomPadding diff --git a/StreamChatSwiftUI.podspec b/StreamChatSwiftUI.podspec index 0da20d05..4318e481 100644 --- a/StreamChatSwiftUI.podspec +++ b/StreamChatSwiftUI.podspec @@ -19,6 +19,6 @@ Pod::Spec.new do |spec| spec.framework = "Foundation", "UIKit", "SwiftUI" - spec.dependency "StreamChat", "~> 4.39.0" + spec.dependency "StreamChat", "~> 4.40.0" end diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 50414bfe..12420e4d 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */; }; + 8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */; }; 820A61A029D6D78E002257FB /* QuotedReply_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */; }; 825AADF4283CCDB000237498 /* ThreadPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 825AADF3283CCDB000237498 /* ThreadPage.swift */; }; 827352FD290BE91100A87385 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; }; @@ -306,7 +308,6 @@ 847CEFEE27C38ABE00606257 /* MessageCachingUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847CEFED27C38ABE00606257 /* MessageCachingUtils.swift */; }; 847F7949282A91AD0009F74C /* ChatChannelView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847F7948282A91AD0009F74C /* ChatChannelView_Tests.swift */; }; 8482094E2ACFFCD900EF3261 /* Throttler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8482094D2ACFFCD900EF3261 /* Throttler.swift */; }; - 848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 848399E9275FB3E9003075E4 /* SnapshotTesting */; }; 848399EC275FB41B003075E4 /* ChatChannelListView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848399EB275FB41B003075E4 /* ChatChannelListView_Tests.swift */; }; 848399F227601231003075E4 /* ReactionsOverlayView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848399F127601231003075E4 /* ReactionsOverlayView_Tests.swift */; }; 8492974B27ABDDCB00A8EEB0 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; }; @@ -963,6 +964,7 @@ files = ( A3571603283E9D9F0014E3B0 /* Swifter in Frameworks */, 846AD4D2284F89B10074A0DD /* StreamChatTestTools in Frameworks */, + 8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */, 846AD4D0284F89B10074A0DD /* StreamChatTestMockServer in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -991,8 +993,8 @@ buildActionMask = 2147483647; files = ( 8465FBBE2746873A00AF091E /* StreamChatSwiftUI.framework in Frameworks */, + 8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */, 84E95A7D284A491000699FD3 /* StreamChatTestTools in Frameworks */, - 848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2016,6 +2018,7 @@ A3571602283E9D9F0014E3B0 /* Swifter */, 846AD4CF284F89B10074A0DD /* StreamChatTestMockServer */, 846AD4D1284F89B10074A0DD /* StreamChatTestTools */, + 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */, ); productName = StreamChatSwiftUITestsAppTests; productReference = 8400A351282E6BE30067D3A0 /* StreamChatSwiftUITestsAppTests.xctest */; @@ -2083,8 +2086,8 @@ ); name = StreamChatSwiftUITests; packageProductDependencies = ( - 848399E9275FB3E9003075E4 /* SnapshotTesting */, 84E95A7C284A491000699FD3 /* StreamChatTestTools */, + 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */, ); productName = StreamChatSwiftUITests; productReference = 8465FBBD2746873A00AF091E /* StreamChatSwiftUITests.xctest */; @@ -2153,12 +2156,12 @@ ); mainGroup = 8465FBAB2746873A00AF091E; packageReferences = ( - 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */, 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */, A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */, 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */, 842ADEA228EADC6600F2BE36 /* XCRemoteSwiftPackageReference "Nuke" */, + 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */, ); productRefGroup = 8465FBB62746873A00AF091E /* Products */; projectDirPath = ""; @@ -3221,6 +3224,14 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ + 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/GetStream/stream-chat-swift-test-helpers.git"; + requirement = { + kind = exactVersion; + version = 0.3.1; + }; + }; 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs.git"; @@ -3245,20 +3256,12 @@ version = 4.10.1; }; }; - 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing.git"; - requirement = { - kind = exactVersion; - version = 1.11.0; - }; - }; 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/GetStream/stream-chat-swift.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 4.39.0; + minimumVersion = 4.40.0; }; }; A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */ = { @@ -3280,6 +3283,16 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */ = { + isa = XCSwiftPackageProductDependency; + package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; + productName = StreamSwiftTestHelpers; + }; + 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */ = { + isa = XCSwiftPackageProductDependency; + package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; + productName = StreamSwiftTestHelpers; + }; 8400A34B282C081E0067D3A0 /* OHHTTPStubs */ = { isa = XCSwiftPackageProductDependency; package = 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; @@ -3310,11 +3323,6 @@ package = 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */; productName = StreamChatTestTools; }; - 848399E9275FB3E9003075E4 /* SnapshotTesting */ = { - isa = XCSwiftPackageProductDependency; - package = 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; - productName = SnapshotTesting; - }; 84B87F222861C0C900959CBE /* StreamChat */ = { isa = XCSwiftPackageProductDependency; package = 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */; diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift index 5412218e..fc3b0dee 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -25,6 +26,6 @@ class AddUsersView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift index 725e6366..f23cfbba 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -26,7 +27,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_directChannelOnlineSnapshot() { @@ -46,7 +47,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_directChannelMutedSnapshot() { @@ -66,7 +67,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_groupCollapsedSnapshot() { @@ -89,7 +90,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_smallGroupSnapshot() { @@ -112,7 +113,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_groupExpandedSnapshot() { @@ -137,7 +138,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_navBarSnapshot() { @@ -166,7 +167,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_addUsersShownSnapshot() { @@ -191,6 +192,6 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift index 9ceb4472..9185ead6 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -25,7 +26,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_fileAttachmentsView_emptySnapshot() { @@ -40,7 +41,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_fileAttachmentsView_loadingSnapshot() { @@ -55,7 +56,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_fileAttachmentsPickerView_snapshot() { @@ -64,6 +65,6 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift index 2ed3173a..c34149c7 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -28,7 +29,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_mediaAttachmentsView_emptySnapshot() { @@ -41,7 +42,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_mediaAttachmentsView_loading() { @@ -54,6 +55,6 @@ class MediaAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift index 2c71dac9..23fa6b91 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -27,7 +28,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_pinnedMessagesView_emptySnapshot() { @@ -39,7 +40,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift index 1caf1e74..0119dc04 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -23,7 +24,7 @@ class ChatChannelHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelHeader_snapshot() { @@ -41,7 +42,7 @@ class ChatChannelHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelTitleView_snapshot() { @@ -53,6 +54,6 @@ class ChatChannelHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift index d4004923..2c825e92 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -62,6 +63,6 @@ class ChatChannelViewDateOverlay_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift index 1314f725..d7554f1a 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -51,7 +52,7 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelView_snapshotEmpty() { @@ -82,7 +83,7 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelView_snapshotLoading() { @@ -107,7 +108,7 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_defaultChannelHeader_snapshot() { @@ -126,6 +127,6 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift index ea933730..3ed10215 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ class GalleryView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_galleryHeader_snapshot() { @@ -43,7 +44,7 @@ class GalleryView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 44) // Then - assertSnapshot(matching: header, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: header, as: .image(perceptualPrecision: precision)) } func test_gridView_snapshotLoading() { @@ -55,6 +56,6 @@ class GalleryView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift index 0de0d519..d8bc7ef2 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -17,7 +18,7 @@ final class LazyImageExtensions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: precision)) } func test_imageURL_nonEmpty() { @@ -28,7 +29,7 @@ final class LazyImageExtensions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: precision)) } func test_imageRequest_emptyURL() { @@ -39,6 +40,6 @@ final class LazyImageExtensions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift index b692f4c6..3449253b 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift @@ -6,6 +6,7 @@ import Photos import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -36,7 +37,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 100) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_slowMode() { @@ -60,7 +61,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 100) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_trailingComposerView_snapshot() { @@ -76,7 +77,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: 40, height: 40) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_trailingComposerView_slowMode() { @@ -92,7 +93,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: 40, height: 40) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_inputTextView() { @@ -106,7 +107,7 @@ class MessageComposerView_Tests: StreamChatTestCase { view.selectedRange.location = 3 // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_composerInputTextView() { @@ -122,7 +123,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 50) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_rangeSelection() { @@ -187,7 +188,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 36) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_snapshot() { @@ -210,7 +211,7 @@ class MessageComposerView_Tests: StreamChatTestCase { coordinator.updateHeight(inputView, shouldAnimate: false) // Then - assertSnapshot(matching: viewWithSize, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: viewWithSize, as: .image(perceptualPrecision: precision)) XCTAssert(coordinator.textInput.height == 100) } @@ -243,7 +244,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .background(.black) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_videoDurationIndicatorView_snapshot() { @@ -253,7 +254,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .background(.black) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_photosPickerView_snapshot() { @@ -266,6 +267,6 @@ class MessageComposerView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift index 5674da41..b51e716d 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ class MessageContainerView_Tests: StreamChatTestCase { let view = testMessageViewContainer(message: message) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageContainerViewSentOtherUser_snapshot() { @@ -46,7 +47,7 @@ class MessageContainerView_Tests: StreamChatTestCase { let view = testMessageViewContainer(message: message) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageContainerViewPinned_snapshot() { @@ -67,7 +68,7 @@ class MessageContainerView_Tests: StreamChatTestCase { let view = testMessageViewContainer(message: message) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_videoAttachment_snapshotNoText() { @@ -89,7 +90,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_videoAttachment_snapshotText() { @@ -113,7 +114,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .padding() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_imageAttachments_snapshot() { @@ -137,7 +138,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .frame(width: 200) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_imageAttachments_snapshotFiveImages() { @@ -163,7 +164,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .frame(width: 200) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift index 88ecd295..388b070d 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class MessageListViewAvatars_Tests: StreamChatTestCase { @@ -18,7 +19,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageListView_defaultGroupsChannel() { @@ -30,7 +31,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageListView_dmChannelAvatarsOff() { @@ -42,7 +43,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageListView_groupsChannelAvatarsOff() { @@ -54,7 +55,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } private func setupConfig(showAvatars: Bool, showAvatarsInGroups: Bool?) { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift index f61aec81..cf1c0251 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -58,7 +59,7 @@ class MessageListViewLastGroupHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift index 3687479b..5b3f94b3 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListViewNewMessages_moreMessages() { @@ -48,7 +49,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListViewNewMessages_moreMessagesInBetween() { @@ -66,7 +67,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListViewNewMessages_noMessages() { @@ -84,7 +85,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift index 50eac8d2..b6ea9358 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -17,7 +18,7 @@ class MessageListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListView_noReactions() { @@ -27,7 +28,7 @@ class MessageListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_scrollToBottomButton_snapshotUnreadCount() { @@ -35,7 +36,7 @@ class MessageListView_Tests: StreamChatTestCase { let button = ScrollToBottomButton(unreadCount: 3, onScrollToBottom: {}) // Then - assertSnapshot(matching: button, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: button, as: .image(perceptualPrecision: precision)) } func test_scrollToBottomButton_snapshotEmptyCount() { @@ -43,7 +44,7 @@ class MessageListView_Tests: StreamChatTestCase { let button = ScrollToBottomButton(unreadCount: 0, onScrollToBottom: {}) // Then - assertSnapshot(matching: button, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: button, as: .image(perceptualPrecision: precision)) } func test_messageListView_typingIndicator() { @@ -57,7 +58,7 @@ class MessageListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListView_snapshotFallback() { @@ -72,7 +73,7 @@ class MessageListView_Tests: StreamChatTestCase { let view = Image(uiImage: snapshot) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift index e9f06bf2..f26fdfa3 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class MessageReadIndicatorView_Tests: StreamChatTestCase { @@ -18,7 +19,7 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageReadIndicatorView_snapshotMessageReadDirect() { @@ -30,7 +31,7 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageReadIndicatorView_snapshotMessageReadGroup() { @@ -42,7 +43,7 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageReadIndicatorView_snapshotPendingSend() { @@ -55,6 +56,6 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift index b69ba2d0..6c566e1a 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -60,7 +61,7 @@ final class MessageViewMultiRowReactions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift index 9ccd775a..56744f77 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshot() { @@ -54,7 +55,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshot2Images() { @@ -81,7 +82,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshot3Images() { @@ -109,7 +110,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshotQuoted() { @@ -140,7 +141,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewGiphy_snapshot() { @@ -164,7 +165,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewVideo_snapshot() { @@ -188,7 +189,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewFile_snapshot() { @@ -212,7 +213,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewFileText_snapshot() { @@ -236,7 +237,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewJumboEmoji_snapshot() { @@ -259,7 +260,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_linkAttachmentView_snapshot() { @@ -282,7 +283,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_deletedMessageView_snapshot() { @@ -299,7 +300,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_deletedMessageViewContainer_snapshot() { @@ -322,7 +323,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageRepliesView_snapshot() { @@ -345,7 +346,7 @@ class MessageView_Tests: StreamChatTestCase { .frame(width: 300, height: 60) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_topLeftView_snapshot() { @@ -359,6 +360,6 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // When - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift index 58c54852..d9b2eda1 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -28,7 +29,7 @@ class QuotedMessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_quotedMessageView_snapshot() { @@ -42,6 +43,6 @@ class QuotedMessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift index 3b728af4..4f459433 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -45,7 +46,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlayView_noReactions() { @@ -64,7 +65,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlayView_usersReactions() { @@ -107,7 +108,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlay_veryLongMessage() { @@ -143,7 +144,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionAnimatableView_snapshot() { @@ -162,7 +163,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { .frame(width: 24, height: 24) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlayContainer_snapshot() { @@ -177,7 +178,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { ) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsAnimatableView_snapshot() { @@ -193,7 +194,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { ) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatMessage_reactionOffsetCurrentUser() { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift index 02bd814e..a51828a0 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -34,7 +35,7 @@ class ReactionsUsersView_Tests: StreamChatTestCase { .frame(width: 250) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsUsersView_snapshotTwoRows() { @@ -66,6 +67,6 @@ class ReactionsUsersView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 320) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift index eb73fd2f..80f3c3d1 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class InstantCommandsView_Tests: StreamChatTestCase { @@ -23,7 +24,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 100) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_instantCommandsContainerViewEmpty_snapshot() { @@ -35,7 +36,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_instantCommandsContainerView_snapshot() { @@ -47,7 +48,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_instantCommandsContainerMaxSize_snapshot() { @@ -62,7 +63,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } private func defaultCommands(suffix: String = "") -> [CommandHandler] { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift index e1932c97..db90acab 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift @@ -4,6 +4,7 @@ import SnapshotTesting @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class TypingIndicatorView_Tests: StreamChatTestCase { @@ -14,6 +15,6 @@ class TypingIndicatorView_Tests: StreamChatTestCase { .frame(width: 20, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift index e7510eba..6136da5e 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class WebView_Tests: StreamChatTestCase { @@ -27,6 +28,6 @@ class WebView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: webView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: webView, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift index ca785665..976a3caa 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift @@ -6,6 +6,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI @testable import StreamChatTestTools +@testable import StreamSwiftTestHelpers import XCTest final class ChatChannelListItemView_Tests: StreamChatTestCase { @@ -26,7 +27,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_imageMessage() throws { @@ -45,7 +46,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_videoMessage() throws { @@ -64,7 +65,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_fileMessage() throws { @@ -83,7 +84,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_giphyMessage() throws { @@ -102,7 +103,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift index 5132466d..a2684e16 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -19,7 +20,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelListView_snapshot() { @@ -34,7 +35,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelListViewSansNavigation_snapshot() { @@ -52,7 +53,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_trailingSwipeActionsView_snapshot() { @@ -67,7 +68,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } private func makeChannelListController() -> ChatChannelListController_Mock { diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift index 7e9e7ac7..774d4ef9 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class LoadingView_Tests: StreamChatTestCase { @@ -18,7 +19,7 @@ class LoadingView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_loadingView_snapshot() { @@ -27,6 +28,6 @@ class LoadingView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift index 7fbfde51..1ad98bf9 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class MoreChannelActionsView_Tests: StreamChatTestCase { @@ -29,6 +30,6 @@ class MoreChannelActionsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift index 3c6e36fc..793ba562 100644 --- a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift +++ b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift @@ -4,15 +4,14 @@ @testable import StreamChat @testable import StreamChatSwiftUI -@_exported import StreamChatTestHelpers @_exported import StreamChatTestTools +@_exported import StreamSwiftTestHelpers import XCTest /// Base class that sets up the `StreamChat` object. open class StreamChatTestCase: XCTestCase { public static var currentUserId: String = .unique - public let snapshotPrecision: Float = 0.95 public var chatClient: ChatClient = { let client = ChatClient.mock(isLocalStorageEnabled: false) diff --git a/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift b/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift index a6b8c219..81a25c35 100644 --- a/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift +++ b/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift @@ -2,8 +2,8 @@ // Copyright © 2023 Stream.io Inc. All rights reserved. // -@_exported import StreamChatTestHelpers @_exported import StreamChatTestMockServer +@_exported import StreamSwiftTestHelpers import Foundation final class StreamChatSwiftUITests {} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d9ac0242..682c8d36 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -22,7 +22,7 @@ before_all do |lane| setup_ci ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '180' ENV['FASTLANE_XCODEBUILD_SETTINGS_RETRIES'] = '10' - xcversion(version: xcode_version) unless [:publish_release, :allure_launch].include?(lane) + xcversion(version: xcode_version) unless [:publish_release, :allure_launch, :pod_lint].include?(lane) end end