Skip to content

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

DEV: Restore and fix chat thread indicator specs (#39623)

Jarek Radoszf029c05c087f
diff --git a/plugins/chat/spec/system/message_thread_indicator_spec.rb b/plugins/chat/spec/system/message_thread_indicator_spec.rb
index 0d9de38cb67..0ff7008b0d6 100644
--- a/plugins/chat/spec/system/message_thread_indicator_spec.rb
+++ b/plugins/chat/spec/system/message_thread_indicator_spec.rb
@@ -89,7 +89,7 @@ describe "Thread indicator for chat messages" do
expect(page).not_to have_css(channel_page.message_by_id_selector(new_thread.replies.first))
end
- xit "increments the indicator when a new reply is sent in the thread" do
+ it "increments the indicator when a new reply is sent in the thread" do
chat_page.visit_channel(channel)
expect(channel_page.message_thread_indicator(thread_1.original_message)).to have_reply_count(
diff --git a/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb b/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb
index a2e74511ff6..b2bd47ae1e1 100644
--- a/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb
+++ b/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb
@@ -97,11 +97,11 @@ module PageObjects
end
def has_unread_user_threads?
- has_css?(".chat-channel-row.--threads .c-unread-indicator")
+ has_css?("#c-footer-threads .c-unread-indicator")
end
def has_no_unread_user_threads?
- has_no_css?(".chat-channel-row.--threads .c-unread-indicator")
+ has_no_css?("#c-footer-threads .c-unread-indicator")
end
def click_channels
diff --git a/plugins/chat/spec/system/page_objects/sidebar/chat_sidebar.rb b/plugins/chat/spec/system/page_objects/sidebar/chat_sidebar.rb
index 1ef03d2e2a5..8fbd7a7b690 100644
--- a/plugins/chat/spec/system/page_objects/sidebar/chat_sidebar.rb
+++ b/plugins/chat/spec/system/page_objects/sidebar/chat_sidebar.rb
@@ -101,13 +101,13 @@ module PageObjects
def has_unread_user_threads?
has_css?(
- ".sidebar-section-link[data-link-name='user-threads'] .sidebar-section-link-content-badge.icon.unread",
+ ".sidebar-section-link[data-link-name='user-threads'] .sidebar-section-link-suffix.icon.unread",
)
end
def has_no_unread_user_threads?
has_no_css?(
- ".sidebar-section-link[data-link-name='user-threads'] .sidebar-section-link-content-badge.icon.unread",
+ ".sidebar-section-link[data-link-name='user-threads'] .sidebar-section-link-suffix.icon.unread",
)
end
diff --git a/plugins/chat/spec/system/user_threads_spec.rb b/plugins/chat/spec/system/user_threads_spec.rb
index d52be53c274..c9cab8def7a 100644
--- a/plugins/chat/spec/system/user_threads_spec.rb
+++ b/plugins/chat/spec/system/user_threads_spec.rb
@@ -42,9 +42,15 @@ RSpec.describe "User threads" do
context "when user has unreads" do
before do
chat_thread_chain_bootstrap(channel: channel_1, users: [current_user, Fabricate(:user)])
+ Fabricate(
+ :chat_message,
+ thread: channel_1.threads.last,
+ user: Fabricate(:user),
+ use_service: true,
+ )
end
- xit "has an unread indicator" do
+ it "has an unread indicator" do
visit("/")
expect(sidebar_page).to have_unread_user_threads
@@ -160,9 +166,15 @@ RSpec.describe "User threads" do
context "when user has unreads" do
before do
chat_thread_chain_bootstrap(channel: channel_1, users: [current_user, Fabricate(:user)])
+ Fabricate(
+ :chat_message,
+ thread: channel_1.threads.last,
+ user: Fabricate(:user),
+ use_service: true,
+ )
end
- xit "has an unread indicator" do
+ it "has an unread indicator" do
visit("/")
chat_page.open_from_header