FEATURE: Use rich user status tooltip everywhere (#21125)

- Inline mentions on posts
- Inline mentions on chat messages
- The user autocomplete for the composer
- The user autocomplete for chat
- The chat section of the sidebar
This commit is contained in:
Jan Cernik
2023-07-03 11:09:41 -03:00
committed by GitHub
parent 5034eda386
commit 585a2e4e77
23 changed files with 398 additions and 134 deletions

View File

@ -181,10 +181,10 @@ RSpec.describe "Chat channel", type: :system do
chat.visit_channel(channel_1)
expect(page).to have_selector(
".mention .user-status[title='#{current_user.user_status.description}']",
".mention .user-status-message img[alt='#{current_user.user_status.emoji}']",
)
expect(page).to have_selector(
".mention .user-status[title='#{other_user.user_status.description}']",
".mention .user-status-message img[alt='#{other_user.user_status.emoji}']",
)
end
end

View File

@ -146,7 +146,7 @@ RSpec.describe "Sidebar navigation menu", type: :system do
visit("/")
expect(sidebar_page.dms_section.find("a.sidebar-section-link:nth-child(1)")).to have_css(
".user-status",
".user-status-message",
)
end
end

View File

@ -20,8 +20,8 @@ RSpec.describe "User status | sidebar", type: :system do
visit("/")
expect(find(".user-status .emoji")["title"]).to eq("online")
expect(find(".user-status .emoji")["src"]).to include("heart")
expect(find(".user-status-message .emoji")["alt"]).to eq("heart")
expect(find(".user-status-message .emoji")["src"]).to include("heart")
end
context "when changing status" do
@ -31,8 +31,8 @@ RSpec.describe "User status | sidebar", type: :system do
visit("/")
current_user.set_status!("offline", "tooth")
expect(page).to have_css('.user-status .emoji[title="offline"]')
expect(find(".user-status .emoji")["src"]).to include("tooth")
expect(page).to have_css('.user-status-message .emoji[alt="tooth"]')
expect(find(".user-status-message .emoji")["src"]).to include("tooth")
end
end
@ -43,7 +43,7 @@ RSpec.describe "User status | sidebar", type: :system do
visit("/")
current_user.clear_status!
expect(page).to have_no_css(".user-status")
expect(page).to have_no_css(".user-status-message")
end
end
end