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:
Joffrey JAFFEUX
2023-08-24 18:21:28 +02:00
committed by GitHub
parent 70f1cc5552
commit 46c7e47f50
4 changed files with 38 additions and 1 deletions

View File

@ -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