FIX: chat channel row indicator should only show urgent count (#25458)

Correctly shows the number of urgent notifications in channel list, rather than showing all new notifications as urgent.
This commit is contained in:
David Battersby
2024-01-31 16:47:54 +08:00
committed by GitHub
parent a695d85cbd
commit e944468162
2 changed files with 22 additions and 9 deletions

View File

@ -104,6 +104,26 @@ RSpec.describe "Message notifications - mobile", type: :system, mobile: true do
expect(page).to have_css(".chat-header-icon .chat-channel-unread-indicator")
expect(channel_index_page).to have_unread_channel(channel_1, count: 1)
end
it "shows correct count when there are multiple messages but only 1 is urgent" do
Jobs.run_immediately!
visit("/chat/channels")
create_message(
channel_1,
user: user_1,
text: "Are you busy @#{current_user.username}?",
)
3.times { create_message(channel_1, user: user_1) }
expect(page).to have_css(
".chat-header-icon .chat-channel-unread-indicator",
text: "1",
)
expect(channel_index_page).to have_unread_channel(channel_1, count: 1)
end
end
end
end