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:
Krzysztof Kotlarek
2023-05-24 08:59:19 +10:00
committed by GitHub
parent 5dd89e0b70
commit 2aa5fc927e
4 changed files with 27 additions and 10 deletions

View File

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