mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:51:09 +08:00
UX: enhances chat copy features (#23770)
- Allows to copy quotes from mobile - Allows to copy text of a message from mobile - Allows to select messages by clicking on it when selection has started Note this commit is also now using toasts to show a confirmation of copy, and refactors system specs helpers concerning secondary actions. <!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
This commit is contained in:
@ -20,7 +20,9 @@ RSpec.describe "Quoting chat message transcripts", type: :system do
|
||||
messages = Array.wrap(messages)
|
||||
messages.each { |message| channel_page.messages.select(message) }
|
||||
channel_page.selection_management.copy
|
||||
expect(page).to have_css(".chat-selection-management[data-last-copy-successful]")
|
||||
expect(PageObjects::Components::Toasts.new).to have_success(
|
||||
I18n.t("js.chat.quote.copy_success"),
|
||||
)
|
||||
clip_text = cdp.read_clipboard
|
||||
expect(clip_text.chomp).to eq(generate_transcript(messages, current_user))
|
||||
clip_text
|
||||
|
Reference in New Issue
Block a user