mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
FIX: allow published pages to be added to sidebar (#21687)
Custom sidebar sections should accept publish pages with URL `/pub/*`. Similarly to `/my/activity` links.
This commit is contained in:

committed by
GitHub

parent
5dd89e0b70
commit
2aa5fc927e
@ -33,23 +33,29 @@ describe "Custom sidebar sections", type: :system, js: true do
|
||||
it "allows the user to create custom section with /my link" do
|
||||
sign_in user
|
||||
visit("/latest")
|
||||
|
||||
sidebar.click_add_section_button
|
||||
|
||||
expect(section_modal).to be_visible
|
||||
expect(section_modal).to have_disabled_save
|
||||
expect(sidebar.custom_section_modal_title).to have_content("Add custom section")
|
||||
|
||||
section_modal.fill_name("My section")
|
||||
|
||||
section_modal.fill_link("My preferences", "/my/preferences")
|
||||
expect(section_modal).to have_enabled_save
|
||||
|
||||
section_modal.save
|
||||
|
||||
expect(sidebar).to have_section("My section")
|
||||
expect(sidebar).to have_section_link("My preferences")
|
||||
end
|
||||
|
||||
it "allows the user to create custom section with /pub link" do
|
||||
sign_in user
|
||||
visit("/latest")
|
||||
|
||||
sidebar.click_add_section_button
|
||||
section_modal.fill_name("My section")
|
||||
section_modal.fill_link("Published Page", "/pub/test")
|
||||
section_modal.save
|
||||
|
||||
expect(sidebar).to have_section("My section")
|
||||
expect(sidebar).to have_section_link("Published Page")
|
||||
end
|
||||
|
||||
it "allows the user to create custom section with external link" do
|
||||
sign_in user
|
||||
visit("/latest")
|
||||
|
Reference in New Issue
Block a user