Skip to content

A platform for community discussion. Free, open, simple.

FIX: correctly open channel info (#20297)

Joffrey JAFFEUX714e903e8137
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.hbs
index c8188e9586d..3aad57058b3 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.hbs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/channel-title.hbs
@@ -1,5 +1,5 @@
{{#if @channel}}
- {{#if @this.chatStateManager.isDrawerExpanded}}
+ {{#if this.chatStateManager.isDrawerExpanded}}
<LinkTo
@route={{if
@channel.isDirectMessageChannel
diff --git a/plugins/chat/spec/system/drawer_spec.rb b/plugins/chat/spec/system/drawer_spec.rb
index da3f2325e7c..3726160ff80 100644
--- a/plugins/chat/spec/system/drawer_spec.rb
+++ b/plugins/chat/spec/system/drawer_spec.rb
@@ -10,6 +10,24 @@ RSpec.describe "Drawer", type: :system, js: true do
sign_in(current_user)
end
+ context "when on channel" do
+ fab!(:channel) { Fabricate(:chat_channel) }
+ fab!(:membership) do
+ Fabricate(:user_chat_channel_membership, user: current_user, chat_channel: channel)
+ end
+
+ context "when clicking channel title" do
+ it "opens channel info page" do
+ visit("/")
+ chat_page.open_from_header
+ drawer.open_channel(channel)
+ page.find(".chat-channel-title").click
+
+ expect(page).to have_current_path("/chat/c/#{channel.slug}/#{channel.id}/info/about")
+ end
+ end
+ end
+
context "when opening" do
it "uses stored size" do
visit("/") # we need to visit the page first to set the local storage