mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Display new DM button when public channels are disabled (#28306)
This commit is contained in:
committed by
GitHub
parent
1d6e54e54c
commit
79f871b558
@@ -123,4 +123,25 @@ RSpec.describe "List channels | no sidebar", type: :system do
|
||||
expect(page).to have_no_css(".direct-message-channels-section")
|
||||
end
|
||||
end
|
||||
|
||||
context "when public channels are disabled" do
|
||||
before { SiteSetting.enable_public_channels = false }
|
||||
|
||||
it "shows the create direct message button" do
|
||||
visit("/chat")
|
||||
|
||||
expect(chat).to have_direct_message_channels_section
|
||||
end
|
||||
|
||||
context "with drawer prefered" do
|
||||
before { chat.prefers_drawer }
|
||||
|
||||
it "shows the create direct message button in the drawer" do
|
||||
visit("/")
|
||||
chat.open_from_header
|
||||
|
||||
expect(PageObjects::Pages::ChatDrawer.new).to have_direct_message_channels_section
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -134,6 +134,10 @@ module PageObjects
|
||||
have_selector(".channel-list-empty-message")
|
||||
end
|
||||
|
||||
def has_direct_message_channels_section?
|
||||
has_css?(".direct-message-channels-section")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def drawer?(expectation:, channel_id: nil, expanded: true)
|
||||
|
||||
@@ -145,6 +145,10 @@ module PageObjects
|
||||
has_no_css?("#{thread_list_button_selector}.has-unreads")
|
||||
end
|
||||
|
||||
def has_direct_message_channels_section?
|
||||
has_css?(".direct-message-channels-section")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def mouseout
|
||||
|
||||
Reference in New Issue
Block a user