Files
discourse/plugins/chat/spec/system/page_objects/sidebar/sidebar.rb
Joffrey JAFFEUX c996e5502f FEATURE: enable_public_channels site setting (#22565)
`SiteSetting.enable_public_channels` allows site admin to decide if public channels are available at all. There's no distinction between admins or not as we expect admins to create private category channels if they want to limit usage.
2023-07-13 10:00:25 +02:00

40 lines
1.0 KiB
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class Sidebar < PageObjects::Pages::Base
PUBLIC_CHANNELS_SECTION_SELECTOR = ".sidebar-section[data-section-name='chat-channels']"
DM_CHANNELS_SECTION_SELECTOR = ".sidebar-section[data-section-name='chat-dms']"
def has_no_public_channels_section?
has_no_css?(PUBLIC_CHANNELS_SECTION_SELECTOR)
end
def channels_section
find(PUBLIC_CHANNELS_SECTION_SELECTOR)
end
def channels_section
find(PUBLIC_CHANNELS_SECTION_SELECTOR)
end
def dms_section
find(DM_CHANNELS_SECTION_SELECTOR)
end
def open_browse
channels_section.find(".sidebar-section-header-button", visible: false).click
end
def open_channel(channel)
find(".sidebar-section-link[href='/chat/c/#{channel.slug}/#{channel.id}']").click
end
def find_channel(channel)
find(".sidebar-section-link[href='/chat/c/#{channel.slug}/#{channel.id}']")
self
end
end
end
end