mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: show too long message error on client (#27794)
Prior to this fix we would show the message after a round trip to the server. If you had a too long message error, at this point your input would be empty and we would show an error in chat. It's important to have this server side safety net, but we can have a better UX by showing an error on the frontend before sending the message, that way you can correct your message before sending it and not lose it.
This commit is contained in:
@ -35,7 +35,9 @@ module PageObjects
|
||||
end
|
||||
|
||||
def click_composer
|
||||
find(".chat-channel .chat-composer__input").click # ensures autocomplete is closed and not masking anything
|
||||
if has_no_css?(".dialog-overlay", wait: 0) # we can't click composer if a dialog is open, in case of error for exampel
|
||||
find(".chat-channel .chat-composer__input").click # ensures autocomplete is closed and not masking anything
|
||||
end
|
||||
end
|
||||
|
||||
def click_send_message
|
||||
|
@ -94,7 +94,9 @@ module PageObjects
|
||||
end
|
||||
|
||||
def click_composer
|
||||
find(".chat-thread .chat-composer__input").click # ensures autocomplete is closed and not masking anything
|
||||
if has_no_css?(".dialog-overlay", wait: 0) # we can't click composer if a dialog is open, in case of error for exampel
|
||||
find(".chat-thread .chat-composer__input").click # ensures autocomplete is closed and not masking anything
|
||||
end
|
||||
end
|
||||
|
||||
def send_message(text = nil)
|
||||
|
@ -48,6 +48,10 @@ module PageObjects
|
||||
input.value
|
||||
end
|
||||
|
||||
def has_value?(expected)
|
||||
value == expected
|
||||
end
|
||||
|
||||
def reply_to_last_message_shortcut
|
||||
input.click
|
||||
input.send_keys(%i[shift arrow_up])
|
||||
|
Reference in New Issue
Block a user