mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:58:09 +08:00
FIX: Better handling of deleted thread original messages (#22402)
This commit includes several fixes and improvements to thread original message handling: 1. When a thread's original message is deleted, the thread no longer counts as unread for a user 2. When a thread original message is deleted and the user is looking at the thread list, it will be removed from the list 3. When a thread original message is restored and the user is looking at the thread list, it will be added back to the list if it was previously loaded
This commit is contained in:
@ -58,6 +58,10 @@ module PageObjects
|
||||
has_css?(".chat-selection-management")
|
||||
end
|
||||
|
||||
def expand_deleted_message(message)
|
||||
message_by_id(message.id).find(".chat-message-expand").click
|
||||
end
|
||||
|
||||
def expand_message_actions(message)
|
||||
hover_message(message)
|
||||
click_more_button
|
||||
|
@ -132,10 +132,29 @@ module PageObjects
|
||||
end
|
||||
end
|
||||
|
||||
def expand_deleted_message(message)
|
||||
message_by_id(message.id).find(".chat-message-expand").click
|
||||
end
|
||||
|
||||
def copy_link(message)
|
||||
expand_message_actions(message)
|
||||
find("[data-value='copyLink']").click
|
||||
end
|
||||
|
||||
def delete_message(message)
|
||||
expand_message_actions(message)
|
||||
find("[data-value='delete']").click
|
||||
end
|
||||
|
||||
def restore_message(message)
|
||||
expand_deleted_message(message)
|
||||
expand_message_actions(message)
|
||||
find("[data-value='restore']").click
|
||||
end
|
||||
|
||||
def expand_message_actions(message)
|
||||
hover_message(message)
|
||||
click_more_button
|
||||
find("[data-value='copyLink']").click
|
||||
end
|
||||
|
||||
def click_more_button
|
||||
|
@ -23,6 +23,10 @@ module PageObjects
|
||||
item_by_id(thread.id)
|
||||
end
|
||||
|
||||
def has_no_thread?(thread)
|
||||
component.has_no_css?(item_by_id_selector(thread.id))
|
||||
end
|
||||
|
||||
def item_by_id(id)
|
||||
component.find(item_by_id_selector(id))
|
||||
end
|
||||
|
Reference in New Issue
Block a user