Skip to content

Commit 1a3c98b

Browse files
committed
Fix tests
1 parent 18c2bf7 commit 1a3c98b

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

DemoApp/Shared/StreamChatWrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ extension StreamChatWrapper {
138138
}
139139
}
140140

141-
func logOut(completion: @escaping () -> Void) {
141+
func logOut(completion: @escaping @MainActor @Sendable() -> Void) {
142142
guard let client = self.client else {
143143
logClientNotInstantiated()
144144
return

Sources/StreamChatUI/ChatMessageList/Attachments/Gallery/ChatMessageImageGallery+ImagePreview.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ extension ChatMessageGalleryView {
9595
from: attachment?.payload,
9696
maxResolutionInPixels: components.imageAttachmentMaxPixels
9797
) { [weak self] _ in
98-
Task { @MainActor in
99-
self?.loadingIndicator.isVisible = false
100-
self?.imageTask = nil
101-
}
98+
self?.loadingIndicator.isVisible = false
99+
self?.imageTask = nil
102100
}
103101

104102
uploadingOverlay.content = content?.uploadingState

TestTools/StreamChatTestTools/Mocks/StreamChat/Controllers/PollController_Mock.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ final class PollController_Mock: PollController, @unchecked Sendable {
3737
var synchronize_completion: (@MainActor @Sendable(Error?) -> Void)?
3838
override func synchronize(_ completion: (@MainActor @Sendable(Error?) -> Void)? = nil) {
3939
synchronize_callCount += 1
40+
synchronize_called = true
4041
synchronize_completion = completion
4142
}
4243

@@ -61,6 +62,7 @@ final class PollController_Mock: PollController, @unchecked Sendable {
6162
var closePoll_completion: (@MainActor @Sendable(Error?) -> Void)?
6263
override func closePoll(completion: (@MainActor @Sendable(Error?) -> Void)? = nil) {
6364
closePoll_callCount += 1
65+
closePoll_called = true
6466
closePoll_completion = completion
6567
}
6668

Tests/StreamChatTests/Controllers/SearchControllers/UserListController/UserListController_Tests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ final class UserListController_Tests: XCTestCase {
297297
// Simulate `loadNextUsers` call and catch the completion
298298
nonisolated(unsafe) var completionError: Error?
299299
controller.loadNextUsers { error in
300-
XCTAssertNil(error)
301300
completionError = error
302301
}
303302

Tests/StreamChatUITests/Mocks/ChatMessageList/ChatMessageListVCDelegate_Mock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ChatMessageListVCDelegate_Mock: ChatMessageListVCDelegate {
2222
var shouldLoadPageAroundMessageCallCount = 0
2323
var shouldLoadPageAroundMessageResult: Error?
2424

25-
func chatMessageListVC(_ vc: ChatMessageListVC, shouldLoadPageAroundMessageId messageId: MessageId, _ completion: @escaping ((Error?) -> Void)) {
25+
func chatMessageListVC(_ vc: ChatMessageListVC, shouldLoadPageAroundMessageId messageId: MessageId, _ completion: @escaping @MainActor @Sendable(Error?) -> Void) {
2626
shouldLoadPageAroundMessageCallCount += 1
2727
if let result = shouldLoadPageAroundMessageResult {
2828
completion(result)

0 commit comments

Comments
 (0)