A platform for community discussion. Free, open, simple.
DEV: Fix flaky thread navigation spec (#22323)
Martin Brennanccdc0822a8de
diff --git a/plugins/chat/spec/system/navigation_spec.rb b/plugins/chat/spec/system/navigation_spec.rbindex 943ced3dcbe..6244938602a 100644--- a/plugins/chat/spec/system/navigation_spec.rb+++ b/plugins/chat/spec/system/navigation_spec.rb@@ -137,7 +137,7 @@ RSpec.describe "Navigation", type: :system dobefore doSiteSetting.enable_experimental_chat_threaded_discussions = truecategory_channel.update!(threading_enabled: true)- Fabricate(:chat_message, thread: thread)+ Fabricate(:chat_message, thread: thread, chat_channel: thread.channel)thread.add(current_user)enddiff --git a/plugins/chat/spec/system/page_objects/chat/chat_side_panel.rb b/plugins/chat/spec/system/page_objects/chat/chat_side_panel.rbindex 405ca6b84be..b71c59afa61 100644--- a/plugins/chat/spec/system/page_objects/chat/chat_side_panel.rb+++ b/plugins/chat/spec/system/page_objects/chat/chat_side_panel.rb@@ -13,6 +13,7 @@ module PageObjectselsehas_css?(".chat-side-panel .chat-thread")end+ PageObjects::Pages::ChatThread.new.has_no_loading_skeleton?enddef has_no_open_thread?diff --git a/spec/rails_helper.rb b/spec/rails_helper.rbindex becb2974646..b9cc331a93d 100644--- a/spec/rails_helper.rb+++ b/spec/rails_helper.rb@@ -433,7 +433,18 @@ RSpec.configure do |config|if logs.empty?lines << "(no logs)"else- logs.each { |log| lines << log.message }+ logs.each do |log|+ # System specs are full of image load errors that are just noise, no need+ # to log this.+ if (+ log.message.include?("Failed to load resource: net::ERR_CONNECTION_REFUSED") &&+ (log.message.include?("uploads") || log.message.include?("images"))+ ) || log.message.include?("favicon.ico")+ next+ end++ lines << log.message+ endendlines << "~~~~~ END JS LOGS ~~~~~"end