Skip to content

A platform for community discussion. Free, open, simple.

DEV: ensures thread list has finished loading (#21855)

Joffrey JAFFEUXf189c20578ac
diff --git a/plugins/chat/spec/system/page_objects/chat/chat_channel.rb b/plugins/chat/spec/system/page_objects/chat/chat_channel.rb
index 79f5b229b80..5a9834cb01d 100644
--- a/plugins/chat/spec/system/page_objects/chat/chat_channel.rb
+++ b/plugins/chat/spec/system/page_objects/chat/chat_channel.rb
@@ -225,6 +225,7 @@ module PageObjects
def open_thread_list
find(thread_list_button_selector).click
+ PageObjects::Components::Chat::ThreadList.new.has_loaded?
end
def has_unread_thread_indicator?(count:)
diff --git a/plugins/chat/spec/system/page_objects/chat/components/thread_list.rb b/plugins/chat/spec/system/page_objects/chat/components/thread_list.rb
new file mode 100644
index 00000000000..270aa789112
--- /dev/null
+++ b/plugins/chat/spec/system/page_objects/chat/components/thread_list.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module PageObjects
+ module Components
+ module Chat
+ class ThreadList < PageObjects::Components::Base
+ SELECTOR = ".chat-thread-list"
+
+ def component
+ find(SELECTOR)
+ end
+
+ def has_loaded?
+ component.has_css?(".spinner", wait: 0)
+ component.has_no_css?(".spinner")
+ end
+ end
+ end
+ end
+end