Expose draft updates to iOS bridge

This commit is contained in:
Mikhail Kilin
2026-05-21 00:33:05 +03:00
parent 892582df67
commit 3e67e0d1b8
6 changed files with 48 additions and 0 deletions

View File

@@ -100,6 +100,16 @@ struct TeleTuiIOSSmokeTests {
await viewModel.copyPayload(for: viewModel.messages[0])
precondition(viewModel.copiedPayload == "Edited text")
viewModel.composeText = "Draft text"
await viewModel.saveDraft()
let draftEvents = try await bridge.pollEvents()
precondition(draftEvents.contains { event in
if case let .draftChanged(draft) = event {
return draft.chatId == chat.id && draft.text == "Draft text"
}
return false
})
let photo = try await bridge.downloadPhoto(fileId: 100)
let voice = try await bridge.downloadVoice(fileId: 200)
precondition(photo.path == "/tmp/fake-photo-100.jpg")