mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 01:04:30 +08:00
spec fixes
This commit is contained in:
parent
47d503dbf6
commit
e4be0eee70
@ -84,6 +84,10 @@ export default {
|
||||
return htmlSafe(emojiUnescape(this.channel.escapedTitle));
|
||||
}
|
||||
|
||||
get prefixType() {
|
||||
return "icon";
|
||||
}
|
||||
|
||||
get prefixValue() {
|
||||
return "d-chat";
|
||||
}
|
||||
@ -102,18 +106,6 @@ export default {
|
||||
return this.channel.chatable.read_restricted ? "lock" : "";
|
||||
}
|
||||
|
||||
get prefixCSSClass() {
|
||||
const activeUsers = this.chatService.presenceChannel.users;
|
||||
const user = this.channel.chatable.users[0];
|
||||
if (
|
||||
!!activeUsers?.findBy("id", user?.id) ||
|
||||
!!activeUsers?.findBy("username", user?.username)
|
||||
) {
|
||||
return "active";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
get suffixType() {
|
||||
return "icon";
|
||||
}
|
||||
@ -304,7 +296,6 @@ export default {
|
||||
|
||||
get prefixCSSClass() {
|
||||
const activeUsers = this.chatService.presenceChannel.users;
|
||||
console.log(this.channel.chatable);
|
||||
const user = getFirstUser(
|
||||
this.channel.chatable.users,
|
||||
this.currentUser
|
||||
|
@ -159,6 +159,8 @@ RSpec.describe "Channel - Info - Settings page", type: :system do
|
||||
context "as staff" do
|
||||
fab!(:current_user) { Fabricate(:admin) }
|
||||
|
||||
before { channel_1.add(current_user) }
|
||||
|
||||
it "can edit name" do
|
||||
chat_page.visit_channel_settings(channel_1)
|
||||
|
||||
@ -170,7 +172,7 @@ RSpec.describe "Channel - Info - Settings page", type: :system do
|
||||
|
||||
edit_modal.fill_and_save_name(name)
|
||||
|
||||
expect(channel_settings_page).to have_name(name)
|
||||
expect(page).to have_content(name)
|
||||
end
|
||||
|
||||
it "can edit description" do
|
||||
@ -191,6 +193,7 @@ RSpec.describe "Channel - Info - Settings page", type: :system do
|
||||
|
||||
it "can edit slug" do
|
||||
chat_page.visit_channel_settings(channel_1)
|
||||
|
||||
edit_modal = channel_settings_page.open_edit_modal
|
||||
|
||||
slug = "gonzo-slug"
|
||||
@ -199,7 +202,7 @@ RSpec.describe "Channel - Info - Settings page", type: :system do
|
||||
|
||||
edit_modal.fill_and_save_slug(slug)
|
||||
|
||||
expect(channel_settings_page).to have_slug(slug)
|
||||
expect(page).to have_current_path("/chat/c/gonzo-slug/#{channel_1.id}")
|
||||
end
|
||||
|
||||
it "can clear the slug to use the autogenerated version based on the name" do
|
||||
@ -213,7 +216,7 @@ RSpec.describe "Channel - Info - Settings page", type: :system do
|
||||
edit_modal.wait_for_auto_generated_slug
|
||||
edit_modal.save_changes
|
||||
|
||||
expect(channel_settings_page).to have_slug("test-channel")
|
||||
expect(page).to have_current_path("/chat/c/test-channel/#{channel_1.id}")
|
||||
end
|
||||
|
||||
it "shows settings page" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user