mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:52:11 +08:00
DEV: Fix flaky thread navigation spec (#22323)
Introduced in cec68b3e2c
,
this is flaky because if you click the back button before
the route is fully transitioned to the loaded thread,
we end up going to the history _before_ the thread list,
which ends up being the channel.
We need to make sure that everything is loaded for the
thread first, meaning the skeleton is not there.
Also exclude some noise from the capybara logs (image load failures)
This commit is contained in:
parent
c4c566846d
commit
ccdc0822a8
|
@ -137,7 +137,7 @@ RSpec.describe "Navigation", type: :system do
|
|||
before do
|
||||
SiteSetting.enable_experimental_chat_threaded_discussions = true
|
||||
category_channel.update!(threading_enabled: true)
|
||||
Fabricate(:chat_message, thread: thread)
|
||||
Fabricate(:chat_message, thread: thread, chat_channel: thread.channel)
|
||||
thread.add(current_user)
|
||||
end
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ module PageObjects
|
|||
else
|
||||
has_css?(".chat-side-panel .chat-thread")
|
||||
end
|
||||
PageObjects::Pages::ChatThread.new.has_no_loading_skeleton?
|
||||
end
|
||||
|
||||
def has_no_open_thread?
|
||||
|
|
|
@ -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
|
||||
end
|
||||
end
|
||||
lines << "~~~~~ END JS LOGS ~~~~~"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user