Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix replacing an image while editing a message not showing the new image in the message list [#956](https://github.com/GetStream/stream-chat-swiftui/pull/956)
- Improve precision when scrolling to the newest message with long text [#958](https://github.com/GetStream/stream-chat-swiftui/pull/958)
- Fix draft attachments being sent with local file urls to the server [#964](https://github.com/GetStream/stream-chat-swiftui/pull/964)
- Fix race condition when clearing text in a regular TextField [#955](https://github.com/GetStream/stream-chat-swiftui/pull/955)
### 🔄 Changed
- Change the gallery header view to show the message timestamp instead of online status [#962](https://github.com/GetStream/stream-chat-swiftui/pull/962)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ open class MessageComposerViewModel: ObservableObject {
}

private func clearInputData() {
text = ""
addedAssets = []
addedFileURLs = []
addedVoiceRecordings = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,12 @@ class MessageComposerViewModel_Tests: StreamChatTestCase {
viewModel.sendMessage(quotedMessage: nil, editedMessage: nil) {}

// Then
// Sending a message will clear the input, deleting the draft message.
XCTAssertEqual(channelController.deleteDraftMessage_callCount, 1)
let expectation = XCTestExpectation(description: "Text cleared")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
XCTAssertEqual(channelController.deleteDraftMessage_callCount, 1)
expectation.fulfill()
}
wait(for: [expectation], timeout: 1.0)
}

func test_messageComposerVM_whenMessagePublished_deleteDraftReply() {
Expand All @@ -1020,7 +1024,12 @@ class MessageComposerViewModel_Tests: StreamChatTestCase {
viewModel.sendMessage(quotedMessage: nil, editedMessage: nil) {}

// Then
XCTAssertEqual(messageController.deleteDraftReply_callCount, 1)
let expectation = XCTestExpectation(description: "Text cleared")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
XCTAssertEqual(messageController.deleteDraftReply_callCount, 1)
expectation.fulfill()
}
wait(for: [expectation], timeout: 1.0)
}

func test_messageComposerVM_draftMessageUpdatedEvent() throws {
Expand Down
Loading