From 289fb8f29c4fae7307b0827dd7432e92fa316f95 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 30 May 2023 13:44:19 +0900 Subject: [PATCH] DEV: Remove unnecessary wait for chat transcript system test (#21819) What is this change required? In the `chat/spec/system/transcript_spec.rb` test, there is a helper method that uses `page.has_css?` in a conditional but it do not specify a wait time and hence the default Capybara default max wait time is used. However, there is no need for us to be waiting here so we specify the `wait: 0` option. --- plugins/chat/spec/system/transcript_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/chat/spec/system/transcript_spec.rb b/plugins/chat/spec/system/transcript_spec.rb index 9c116ae7a59..e0ff76d3f7d 100644 --- a/plugins/chat/spec/system/transcript_spec.rb +++ b/plugins/chat/spec/system/transcript_spec.rb @@ -2,6 +2,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do fab!(:current_user) { Fabricate(:user) } + fab!(:admin) { Fabricate(:admin) } fab!(:chat_channel_1) { Fabricate(:chat_channel) } let(:cdp) { PageObjects::CDP.new } @@ -10,13 +11,13 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do let(:topic_page) { PageObjects::Pages::Topic.new } before do - chat_system_bootstrap(Fabricate(:admin), [chat_channel_1]) + chat_system_bootstrap(admin, [chat_channel_1]) chat_channel_1.add(current_user) sign_in(current_user) end def select_message_desktop(message) - if page.has_css?(".chat-message-container.selecting-messages") + if page.has_css?(".chat-message-container.selecting-messages", wait: 0) chat_channel_page.message_by_id(message.id).find(".chat-message-selector").click else chat_channel_page.message_by_id(message.id).hover