Skip to content

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

DEV: correctly uses link to message endpoint in spec (#24652)

Joffrey JAFFEUXa7a7d8e41eaa
diff --git a/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js b/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js
index 350f9649e07..e724d8f830b 100644
--- a/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js
+++ b/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js
@@ -279,7 +279,7 @@ export default {
});
} else {
return I18n.t("chat.placeholder_users", {
- commaSeparatedNames: this.channel.chatable.users[0].username,
+ commaSeparatedNames: this.channel.escapedTitle,
});
}
}
diff --git a/plugins/chat/spec/system/chat_channel_spec.rb b/plugins/chat/spec/system/chat_channel_spec.rb
index 50729243847..52b581bf7d7 100644
--- a/plugins/chat/spec/system/chat_channel_spec.rb
+++ b/plugins/chat/spec/system/chat_channel_spec.rb
@@ -136,7 +136,7 @@ RSpec.describe "Chat channel", type: :system do
it "jumps to the bottom of the channel" do
unloaded_message = Fabricate(:chat_message, chat_channel: channel_1)
- visit("/chat/message/#{message_1.id}")
+ visit("/chat/c/-/#{channel_1.id}/#{message_1.id}")
expect(channel_page).to have_no_loading_skeleton
expect(page).to have_no_css("[data-id='#{unloaded_message.id}']")
@@ -168,7 +168,7 @@ RSpec.describe "Chat channel", type: :system do
end
xit "doesn’t scroll the pane" do
- visit("/chat/message/#{message_1.id}")
+ visit("/chat/c/-/#{channel_1.id}/#{message_1.id}")
new_message = Fabricate(:chat_message, chat_channel: channel_1)
diff --git a/plugins/chat/spec/system/sidebar_navigation_menu_spec.rb b/plugins/chat/spec/system/sidebar_navigation_menu_spec.rb
index a6cb8329d8e..93d473d2ffd 100644
--- a/plugins/chat/spec/system/sidebar_navigation_menu_spec.rb
+++ b/plugins/chat/spec/system/sidebar_navigation_menu_spec.rb
@@ -182,7 +182,7 @@ RSpec.describe "Sidebar navigation menu", type: :system do
visit("/")
expect(sidebar_page.dms_section.find(".channel-#{dm_channel_1.id}")["title"]).to eq(
- "Chat in @<script>alert('hello')</script>",
+ "Chat with @<script>alert('hello')</script>",
)
end
end