mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 04:13:53 +08:00
FIX: prevents setPanel to also set separated mode (#23227)
This could happen after you had already change the separation mode and would cause unexpected bugs. This PR also adds more tests around using switch buttons with chat.
This commit is contained in:
@ -124,19 +124,27 @@ RSpec.describe "Separate sidebar mode", type: :system do
|
||||
|
||||
expect(sidebar_component).to have_switch_button("chat")
|
||||
expect(header_component).to have_open_chat_button
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
expect(sidebar_component).to have_no_section("chat-channels")
|
||||
|
||||
chat_page.open_from_header
|
||||
|
||||
expect(sidebar_component).to have_no_switch_button
|
||||
expect(header_component).to have_open_chat_button
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
expect(sidebar_component).to have_no_section("chat-channels")
|
||||
|
||||
chat_drawer_page.close
|
||||
|
||||
expect(sidebar_component).to have_switch_button("chat")
|
||||
expect(header_component).to have_open_chat_button
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
expect(sidebar_component).to have_no_section("chat-channels")
|
||||
|
||||
sidebar_component.switch_to_chat
|
||||
|
||||
expect(sidebar_component).to have_no_section("chat-channels")
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
end
|
||||
end
|
||||
|
||||
@ -164,6 +172,16 @@ RSpec.describe "Separate sidebar mode", type: :system do
|
||||
expect(header_component).to have_open_chat_button
|
||||
expect(sidebar_component).to have_no_section("chat-channels")
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
|
||||
sidebar_component.switch_to_chat
|
||||
|
||||
expect(sidebar_component).to have_section("chat-channels")
|
||||
expect(sidebar_component).to have_no_section("Categories")
|
||||
|
||||
sidebar_component.switch_to_main
|
||||
|
||||
expect(sidebar_component).to have_no_section("chat-channels")
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -199,6 +217,11 @@ RSpec.describe "Separate sidebar mode", type: :system do
|
||||
expect(header_component).to have_open_chat_button
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
expect(sidebar_component).to have_section("chat-channels")
|
||||
|
||||
sidebar_component.switch_to_chat
|
||||
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
expect(sidebar_component).to have_section("chat-channels")
|
||||
end
|
||||
end
|
||||
|
||||
@ -226,6 +249,16 @@ RSpec.describe "Separate sidebar mode", type: :system do
|
||||
expect(header_component).to have_open_chat_button
|
||||
expect(sidebar_component).to have_section("chat-channels")
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
|
||||
sidebar_component.switch_to_chat
|
||||
|
||||
expect(sidebar_component).to have_section("chat-channels")
|
||||
expect(sidebar_component).to have_no_section("Categories")
|
||||
|
||||
sidebar_component.switch_to_main
|
||||
|
||||
expect(sidebar_component).to have_section("chat-channels")
|
||||
expect(sidebar_component).to have_section("Categories")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user