mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 10:24:39 +08:00
FIX: correctly closes panel when exiting chat (#23201)
We don't use activate/deactivate as it would cause: close/open in short succession when going from threads to thread for example.
This commit is contained in:
@ -352,5 +352,29 @@ RSpec.describe "Navigation", type: :system do
|
||||
expect(sidebar_component).to have_no_section_link(category_channel.name, active: true)
|
||||
end
|
||||
end
|
||||
|
||||
context "when exiting a thread for homepage" do
|
||||
fab!(:thread) { Fabricate(:chat_thread, channel: category_channel) }
|
||||
|
||||
before do
|
||||
current_user.user_option.update(
|
||||
chat_separate_sidebar_mode: UserOption.chat_separate_sidebar_modes[:always],
|
||||
)
|
||||
chat_page.prefers_full_page
|
||||
category_channel.update!(threading_enabled: true)
|
||||
thread.add(current_user)
|
||||
end
|
||||
|
||||
it "correctly closes the panel" do
|
||||
chat_page.visit_thread(thread)
|
||||
|
||||
expect(side_panel_page).to have_open_thread(thread)
|
||||
|
||||
find("#site-logo").click
|
||||
sidebar_component.switch_to_chat
|
||||
|
||||
expect(page).to have_no_css(".chat-side-panel")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user