From ae4a4b7d00ec4606fd12568d4b612fb861c0885b Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 23 Dec 2024 13:54:13 +0100 Subject: [PATCH] DEV: waits for mark_read! to be applied (#30444) --- .../chat/spec/system/list_channels/drawer_spec.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/chat/spec/system/list_channels/drawer_spec.rb b/plugins/chat/spec/system/list_channels/drawer_spec.rb index 62defaf8706..169bf964acc 100644 --- a/plugins/chat/spec/system/list_channels/drawer_spec.rb +++ b/plugins/chat/spec/system/list_channels/drawer_spec.rb @@ -137,12 +137,13 @@ RSpec.describe "List channels | Drawer", type: :system do Fabricate(:chat_message, chat_channel: dm_channel_4, user: user_3, use_service: true) dm_channel_4.membership_for(current_user).mark_read!(message.id) - expect(drawer_page).to have_channel_at_position(dm_channel_2, 1) - expect(drawer_page).to have_urgent_channel(dm_channel_2) - - expect(drawer_page).to have_channel_at_position(dm_channel_4, 2) - expect(drawer_page).to have_channel_at_position(dm_channel_1, 3) - expect(drawer_page).to have_channel_at_position(dm_channel_3, 4) + try_until_success do + expect(drawer_page).to have_channel_at_position(dm_channel_2, 1) + expect(drawer_page).to have_urgent_channel(dm_channel_2) + expect(drawer_page).to have_channel_at_position(dm_channel_4, 2) + expect(drawer_page).to have_channel_at_position(dm_channel_1, 3) + expect(drawer_page).to have_channel_at_position(dm_channel_3, 4) + end end context "with unread threads" do