mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: handles starting draft dm from sidebar (#18946)
This commit is contained in:
@ -8,6 +8,7 @@ RSpec.describe "Navigation", type: :system, js: true do
|
||||
fab!(:category_channel) { Fabricate(:category_channel) }
|
||||
fab!(:message) { Fabricate(:chat_message, chat_channel: category_channel) }
|
||||
let(:chat_page) { PageObjects::Pages::Chat.new }
|
||||
let(:sidebar_page) { PageObjects::Pages::Sidebar.new }
|
||||
|
||||
before do
|
||||
# ensures we have one valid registered admin
|
||||
@ -125,5 +126,28 @@ RSpec.describe "Navigation", type: :system, js: true do
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "when starting draft from sidebar with drawer preferred" do
|
||||
it "opens draft in drawer" do
|
||||
visit("/")
|
||||
sidebar_page.start_draft_dm
|
||||
|
||||
expect(page).to have_current_path("/")
|
||||
expect(page).to have_css(".topic-chat-container.expanded.visible")
|
||||
end
|
||||
end
|
||||
|
||||
context "when starting draft from sidebar with full page preferred" do
|
||||
it "opens draft in full page" do
|
||||
visit("/")
|
||||
chat_page.open_from_header
|
||||
chat_page.maximize_drawer
|
||||
visit("/")
|
||||
sidebar_page.start_draft_dm
|
||||
|
||||
expect(page).to have_current_path("/chat/draft-channel")
|
||||
expect(page).not_to have_css(".topic-chat-container.expanded.visible")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user