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:
Martin Brennan
2023-07-06 09:47:34 +10:00
committed by GitHub
parent 478c4b1a74
commit 37a8036b2d
10 changed files with 184 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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