Skip to content

Commit

Permalink
Update StreamSwiftTestHelpers (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple authored Oct 26, 2023
1 parent ca75e5c commit e83d8ac
Show file tree
Hide file tree
Showing 38 changed files with 177 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion StreamChatSwiftUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

44 changes: 26 additions & 18 deletions StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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 */; };
Expand Down Expand Up @@ -963,6 +964,7 @@
files = (
A3571603283E9D9F0014E3B0 /* Swifter in Frameworks */,
846AD4D2284F89B10074A0DD /* StreamChatTestTools in Frameworks */,
8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */,
846AD4D0284F89B10074A0DD /* StreamChatTestMockServer in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -2016,6 +2018,7 @@
A3571602283E9D9F0014E3B0 /* Swifter */,
846AD4CF284F89B10074A0DD /* StreamChatTestMockServer */,
846AD4D1284F89B10074A0DD /* StreamChatTestTools */,
8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */,
);
productName = StreamChatSwiftUITestsAppTests;
productReference = 8400A351282E6BE30067D3A0 /* StreamChatSwiftUITestsAppTests.xctest */;
Expand Down Expand Up @@ -2083,8 +2086,8 @@
);
name = StreamChatSwiftUITests;
packageProductDependencies = (
848399E9275FB3E9003075E4 /* SnapshotTesting */,
84E95A7C284A491000699FD3 /* StreamChatTestTools */,
8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */,
);
productName = StreamChatSwiftUITests;
productReference = 8465FBBD2746873A00AF091E /* StreamChatSwiftUITests.xctest */;
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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";
Expand All @@ -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" */ = {
Expand All @@ -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" */;
Expand Down Expand Up @@ -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" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -25,6 +26,6 @@ class AddUsersView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down Expand Up @@ -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() {
Expand All @@ -191,6 +192,6 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -64,6 +65,6 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -54,6 +55,6 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -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() {
Expand All @@ -39,7 +40,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}
}

Expand Down
Loading

0 comments on commit e83d8ac

Please sign in to comment.