UX: Hide hamburger dropdown when `enable_sidebar` query param is used (#20367)
This commit is contained in:
parent
f91631b625
commit
d71a82786a
|
@ -339,11 +339,7 @@ createWidget("header-icons", {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (
|
if (!attrs.sidebarEnabled || this.site.mobileView) {
|
||||||
this.siteSettings.navigation_menu === "legacy" ||
|
|
||||||
!attrs.sidebarEnabled ||
|
|
||||||
this.site.mobileView
|
|
||||||
) {
|
|
||||||
icons.push(hamburger);
|
icons.push(hamburger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,10 @@ module PageObjects
|
||||||
page.has_css?("#d-sidebar")
|
page.has_css?("#d-sidebar")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def not_visible?
|
||||||
|
page.has_no_css?("#d-sidebar")
|
||||||
|
end
|
||||||
|
|
||||||
def has_category_section_link?(category)
|
def has_category_section_link?(category)
|
||||||
page.has_link?(category.name, class: "sidebar-section-link")
|
page.has_link?(category.name, class: "sidebar-section-link")
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,22 @@ describe "Viewing sidebar", type: :system, js: true do
|
||||||
|
|
||||||
expect(sidebar).to be_visible
|
expect(sidebar).to be_visible
|
||||||
expect(sidebar).to have_category_section_link(category_sidebar_section_link.linkable)
|
expect(sidebar).to have_category_section_link(category_sidebar_section_link.linkable)
|
||||||
|
expect(page).not_to have_css(".hamburger-dropdown")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "when using the sidebar navigation menu" do
|
||||||
|
before { SiteSetting.navigation_menu = "sidebar" }
|
||||||
|
|
||||||
|
it "should not display the sidebar when `enable_sidebar` query param is '0'" do
|
||||||
|
sign_in(user)
|
||||||
|
|
||||||
|
visit("/latest?enable_sidebar=0")
|
||||||
|
|
||||||
|
sidebar = PageObjects::Components::Sidebar.new
|
||||||
|
|
||||||
|
expect(sidebar).to be_not_visible
|
||||||
|
expect(page).to have_css(".hamburger-dropdown")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue