mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FIX: correctly show unread and presence (#22441)
- Presence needs to be explicitly set on the component now - We were not checking and testing correctly the presence of the unread indicator in the menu
This commit is contained in:
@ -4,6 +4,7 @@ RSpec.describe "User presence", type: :system do
|
||||
fab!(:channel_1) { Fabricate(:chat_channel) }
|
||||
fab!(:current_user) { Fabricate(:user) }
|
||||
|
||||
let(:chat_page) { PageObjects::Pages::Chat.new }
|
||||
let(:channel) { PageObjects::Pages::ChatChannel.new }
|
||||
|
||||
before do
|
||||
@ -13,20 +14,20 @@ RSpec.describe "User presence", type: :system do
|
||||
|
||||
it "shows presence indicator" do
|
||||
sign_in(current_user)
|
||||
chat.visit_channel(channel_1)
|
||||
chat_page.visit_channel(channel_1)
|
||||
channel.send_message("Am I present?")
|
||||
|
||||
expect(page).to have_selector(".chat-user-avatar.is-online")
|
||||
expect(page).to have_css(".chat-message .chat-user-avatar.is-online")
|
||||
end
|
||||
|
||||
context "when user hides presence" do
|
||||
it "hides the presence indicator" do
|
||||
current_user.user_option.update!(hide_profile_and_presence: true)
|
||||
sign_in(current_user)
|
||||
chat.visit_channel(channel_1)
|
||||
chat_page.visit_channel(channel_1)
|
||||
channel.send_message("Am I present?")
|
||||
|
||||
expect(page).to have_no_selector(".chat-user-avatar.is-online")
|
||||
expect(page).to have_no_css(".chat-user-avatar.is-online")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user