spec fixes

This commit is contained in:
Joffrey JAFFEUX 2023-11-08 19:32:24 +01:00
parent 47d503dbf6
commit e4be0eee70
2 changed files with 10 additions and 16 deletions

View File

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

View File

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