mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
UX: cook message before sending edit (#21303)
This allows for instant feedback in the UI.
This commit is contained in:
@ -138,6 +138,18 @@ RSpec.describe "Chat composer", type: :system, js: true do
|
||||
expect(find(".chat-composer__input").value).to eq(message_2.message)
|
||||
end
|
||||
|
||||
it "updates the message instantly" do
|
||||
chat.visit_channel(channel_1)
|
||||
page.driver.browser.network_conditions = { offline: true }
|
||||
|
||||
channel.edit_message(message_2)
|
||||
find(".chat-composer__input").send_keys("instant")
|
||||
channel.click_send_message
|
||||
|
||||
expect(channel).to have_message(text: message_2.message + "instant")
|
||||
page.driver.browser.network_conditions = { offline: false }
|
||||
end
|
||||
|
||||
context "when pressing escape" do
|
||||
it "cancels editing" do
|
||||
chat.visit_channel(channel_1)
|
||||
|
Reference in New Issue
Block a user