Skip to content

Commit e83d8ac

Browse files
Update StreamSwiftTestHelpers (#376)
1 parent ca75e5c commit e83d8ac

38 files changed

+177
-141
lines changed

.github/workflows/smoke-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414

1515
env:
1616
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
17-
IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (17.0)"
17+
IOS_SIMULATOR_DEVICE: "iPhone 14 Pro"
1818

1919
jobs:
2020
automated-code-review:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
- Config for composer text input paddings
1414
- Config for left alignment of messages
1515

16-
### 🐞 Fixed
16+
### 🔄 Changed
1717
- Made some `ChannelList` and `MessageListView` parameters optional
1818

1919
# [4.39.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.39.0)

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
)
1818
],
1919
dependencies: [
20-
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.39.0"),
20+
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.40.0"),
2121
],
2222
targets: [
2323
.target(

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public struct MessageBubbleModifier: ViewModifier {
5858
if utils.messageListConfig.messageListAlignment == .leftAligned {
5959
self.forceLeftToRight = true
6060
} else {
61-
self.forceLeftToRight = forceLeftToRight
61+
self.forceLeftToRight = forceLeftToRight
6262
}
6363
self.topPadding = topPadding
6464
self.bottomPadding = bottomPadding

StreamChatSwiftUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ Pod::Spec.new do |spec|
1919

2020
spec.framework = "Foundation", "UIKit", "SwiftUI"
2121

22-
spec.dependency "StreamChat", "~> 4.39.0"
22+
spec.dependency "StreamChat", "~> 4.40.0"
2323
end
2424

StreamChatSwiftUI.xcodeproj/project.pbxproj

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */; };
11+
8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */; };
1012
820A61A029D6D78E002257FB /* QuotedReply_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */; };
1113
825AADF4283CCDB000237498 /* ThreadPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 825AADF3283CCDB000237498 /* ThreadPage.swift */; };
1214
827352FD290BE91100A87385 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; };
@@ -306,7 +308,6 @@
306308
847CEFEE27C38ABE00606257 /* MessageCachingUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847CEFED27C38ABE00606257 /* MessageCachingUtils.swift */; };
307309
847F7949282A91AD0009F74C /* ChatChannelView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847F7948282A91AD0009F74C /* ChatChannelView_Tests.swift */; };
308310
8482094E2ACFFCD900EF3261 /* Throttler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8482094D2ACFFCD900EF3261 /* Throttler.swift */; };
309-
848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 848399E9275FB3E9003075E4 /* SnapshotTesting */; };
310311
848399EC275FB41B003075E4 /* ChatChannelListView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848399EB275FB41B003075E4 /* ChatChannelListView_Tests.swift */; };
311312
848399F227601231003075E4 /* ReactionsOverlayView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848399F127601231003075E4 /* ReactionsOverlayView_Tests.swift */; };
312313
8492974B27ABDDCB00A8EEB0 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; };
@@ -963,6 +964,7 @@
963964
files = (
964965
A3571603283E9D9F0014E3B0 /* Swifter in Frameworks */,
965966
846AD4D2284F89B10074A0DD /* StreamChatTestTools in Frameworks */,
967+
8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */,
966968
846AD4D0284F89B10074A0DD /* StreamChatTestMockServer in Frameworks */,
967969
);
968970
runOnlyForDeploymentPostprocessing = 0;
@@ -991,8 +993,8 @@
991993
buildActionMask = 2147483647;
992994
files = (
993995
8465FBBE2746873A00AF091E /* StreamChatSwiftUI.framework in Frameworks */,
996+
8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */,
994997
84E95A7D284A491000699FD3 /* StreamChatTestTools in Frameworks */,
995-
848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */,
996998
);
997999
runOnlyForDeploymentPostprocessing = 0;
9981000
};
@@ -2016,6 +2018,7 @@
20162018
A3571602283E9D9F0014E3B0 /* Swifter */,
20172019
846AD4CF284F89B10074A0DD /* StreamChatTestMockServer */,
20182020
846AD4D1284F89B10074A0DD /* StreamChatTestTools */,
2021+
8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */,
20192022
);
20202023
productName = StreamChatSwiftUITestsAppTests;
20212024
productReference = 8400A351282E6BE30067D3A0 /* StreamChatSwiftUITestsAppTests.xctest */;
@@ -2083,8 +2086,8 @@
20832086
);
20842087
name = StreamChatSwiftUITests;
20852088
packageProductDependencies = (
2086-
848399E9275FB3E9003075E4 /* SnapshotTesting */,
20872089
84E95A7C284A491000699FD3 /* StreamChatTestTools */,
2090+
8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */,
20882091
);
20892092
productName = StreamChatSwiftUITests;
20902093
productReference = 8465FBBD2746873A00AF091E /* StreamChatSwiftUITests.xctest */;
@@ -2153,12 +2156,12 @@
21532156
);
21542157
mainGroup = 8465FBAB2746873A00AF091E;
21552158
packageReferences = (
2156-
848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */,
21572159
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
21582160
8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */,
21592161
A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */,
21602162
84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */,
21612163
842ADEA228EADC6600F2BE36 /* XCRemoteSwiftPackageReference "Nuke" */,
2164+
82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */,
21622165
);
21632166
productRefGroup = 8465FBB62746873A00AF091E /* Products */;
21642167
projectDirPath = "";
@@ -3221,6 +3224,14 @@
32213224
/* End XCConfigurationList section */
32223225

32233226
/* Begin XCRemoteSwiftPackageReference section */
3227+
82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */ = {
3228+
isa = XCRemoteSwiftPackageReference;
3229+
repositoryURL = "https://github.com/GetStream/stream-chat-swift-test-helpers.git";
3230+
requirement = {
3231+
kind = exactVersion;
3232+
version = 0.3.1;
3233+
};
3234+
};
32243235
8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = {
32253236
isa = XCRemoteSwiftPackageReference;
32263237
repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs.git";
@@ -3245,20 +3256,12 @@
32453256
version = 4.10.1;
32463257
};
32473258
};
3248-
848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = {
3249-
isa = XCRemoteSwiftPackageReference;
3250-
repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing.git";
3251-
requirement = {
3252-
kind = exactVersion;
3253-
version = 1.11.0;
3254-
};
3255-
};
32563259
84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */ = {
32573260
isa = XCRemoteSwiftPackageReference;
32583261
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
32593262
requirement = {
32603263
kind = upToNextMajorVersion;
3261-
minimumVersion = 4.39.0;
3264+
minimumVersion = 4.40.0;
32623265
};
32633266
};
32643267
A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */ = {
@@ -3280,6 +3283,16 @@
32803283
/* End XCRemoteSwiftPackageReference section */
32813284

32823285
/* Begin XCSwiftPackageProductDependency section */
3286+
8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */ = {
3287+
isa = XCSwiftPackageProductDependency;
3288+
package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */;
3289+
productName = StreamSwiftTestHelpers;
3290+
};
3291+
8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */ = {
3292+
isa = XCSwiftPackageProductDependency;
3293+
package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */;
3294+
productName = StreamSwiftTestHelpers;
3295+
};
32833296
8400A34B282C081E0067D3A0 /* OHHTTPStubs */ = {
32843297
isa = XCSwiftPackageProductDependency;
32853298
package = 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */;
@@ -3310,11 +3323,6 @@
33103323
package = 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */;
33113324
productName = StreamChatTestTools;
33123325
};
3313-
848399E9275FB3E9003075E4 /* SnapshotTesting */ = {
3314-
isa = XCSwiftPackageProductDependency;
3315-
package = 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
3316-
productName = SnapshotTesting;
3317-
};
33183326
84B87F222861C0C900959CBE /* StreamChat */ = {
33193327
isa = XCSwiftPackageProductDependency;
33203328
package = 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */;

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@testable import SnapshotTesting
66
@testable import StreamChat
77
@testable import StreamChatSwiftUI
8+
@testable import StreamSwiftTestHelpers
89
import SwiftUI
910
import XCTest
1011

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

2728
// Then
28-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
29+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
2930
}
3031
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@testable import SnapshotTesting
66
@testable import StreamChat
77
@testable import StreamChatSwiftUI
8+
@testable import StreamSwiftTestHelpers
89
import SwiftUI
910
import XCTest
1011

@@ -26,7 +27,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
2627
.applyDefaultSize()
2728

2829
// Then
29-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
30+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
3031
}
3132

3233
func test_chatChannelInfoView_directChannelOnlineSnapshot() {
@@ -46,7 +47,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
4647
.applyDefaultSize()
4748

4849
// Then
49-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
50+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
5051
}
5152

5253
func test_chatChannelInfoView_directChannelMutedSnapshot() {
@@ -66,7 +67,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
6667
.applyDefaultSize()
6768

6869
// Then
69-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
70+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
7071
}
7172

7273
func test_chatChannelInfoView_groupCollapsedSnapshot() {
@@ -89,7 +90,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
8990
.applyDefaultSize()
9091

9192
// Then
92-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
93+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
9394
}
9495

9596
func test_chatChannelInfoView_smallGroupSnapshot() {
@@ -112,7 +113,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
112113
.applyDefaultSize()
113114

114115
// Then
115-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
116+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
116117
}
117118

118119
func test_chatChannelInfoView_groupExpandedSnapshot() {
@@ -137,7 +138,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
137138
.applyDefaultSize()
138139

139140
// Then
140-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
141+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
141142
}
142143

143144
func test_chatChannelInfoView_navBarSnapshot() {
@@ -166,7 +167,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
166167
.applyDefaultSize()
167168

168169
// Then
169-
assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: snapshotPrecision))
170+
assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: precision))
170171
}
171172

172173
func test_chatChannelInfoView_addUsersShownSnapshot() {
@@ -191,6 +192,6 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
191192
.applyDefaultSize()
192193

193194
// Then
194-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
195+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
195196
}
196197
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@testable import SnapshotTesting
66
@testable import StreamChat
77
@testable import StreamChatSwiftUI
8+
@testable import StreamSwiftTestHelpers
89
import SwiftUI
910
import XCTest
1011

@@ -25,7 +26,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
2526
.applyDefaultSize()
2627

2728
// Then
28-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
29+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
2930
}
3031

3132
func test_fileAttachmentsView_emptySnapshot() {
@@ -40,7 +41,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
4041
.applyDefaultSize()
4142

4243
// Then
43-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
44+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
4445
}
4546

4647
func test_fileAttachmentsView_loadingSnapshot() {
@@ -55,7 +56,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
5556
.applyDefaultSize()
5657

5758
// Then
58-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
59+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
5960
}
6061

6162
func test_fileAttachmentsPickerView_snapshot() {
@@ -64,6 +65,6 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
6465
.applyDefaultSize()
6566

6667
// Then
67-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
68+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
6869
}
6970
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@testable import SnapshotTesting
66
@testable import StreamChat
77
@testable import StreamChatSwiftUI
8+
@testable import StreamSwiftTestHelpers
89
import SwiftUI
910
import XCTest
1011

@@ -28,7 +29,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
2829
.applyDefaultSize()
2930

3031
// Then
31-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
32+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
3233
}
3334

3435
func test_mediaAttachmentsView_emptySnapshot() {
@@ -41,7 +42,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
4142
.applyDefaultSize()
4243

4344
// Then
44-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
45+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
4546
}
4647

4748
func test_mediaAttachmentsView_loading() {
@@ -54,6 +55,6 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
5455
.applyDefaultSize()
5556

5657
// Then
57-
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
58+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
5859
}
5960
}

0 commit comments

Comments
 (0)