DEV: simplify restore message spec (#30490)

This spec was flaky, by not using a second session and rely on services instead, I hope to make it more stable and faster.
This commit is contained in:
Joffrey JAFFEUX 2024-12-28 15:27:12 +01:00 committed by GitHub
parent cf9709ef16
commit e9d4afec53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,24 +181,12 @@ describe "Thread list in side panel | full page", type: :system do
end
it "shows the thread in the list when another user restores the original message" do
# This is necessary because normal users can't see deleted messages
other_user.update!(admin: true)
current_user.update!(admin: true)
thread_1.original_message.trash!
trash_message!(thread_1.original_message)
chat_page.visit_threads_list(channel)
expect(thread_list_page).to have_no_thread(thread_1)
using_session(:tab_2) do
sign_in(other_user)
chat_page.visit_channel(channel)
expect(channel_page).to have_no_loading_skeleton
channel_page.expand_deleted_message(thread_1.original_message)
channel_page.message_thread_indicator(thread_1.original_message).click
expect(side_panel_page).to have_open_thread(thread_1)
thread_page.messages.restore(thread_1.original_message)
end
restore_message!(thread_1.original_message, user: other_user)
expect(thread_list_page).to have_thread(thread_1)
end