DEV: Ensure sidebar sections are collapsable in mobile view (#31383)

This commit is contained in:
Sérgio Saquetim
2025-02-19 16:05:43 -03:00
committed by GitHub
parent 3e22fc8ba2
commit 0abc33c5a2
2 changed files with 24 additions and 6 deletions

View File

@ -33,13 +33,10 @@ export default class SidebarHamburgerDropdown extends Component {
}
get collapsableSections() {
if (
this.siteSettings.navigation_menu === "header dropdown" &&
!this.args.collapsableSections
) {
return this.site.mobileView || this.site.narrowDesktopView;
if (this.site.mobileView || this.site.narrowDesktopView) {
return true;
} else {
this.args.collapsableSections;
return this.args.collapsableSections;
}
}

View File

@ -77,6 +77,27 @@ acceptance(
}
);
acceptance(
"Sidebar - Logged on user - Mobile view - Sidebar enabled",
function (needs) {
needs.user();
needs.mobileView();
needs.settings({
navigation_menu: "sidebar",
});
test("sections are collapsable", async function (assert) {
await visit("/");
await click("#toggle-hamburger-menu");
assert
.dom(".sidebar-section-header.sidebar-section-header-collapsable")
.exists("sections are collapsable");
});
}
);
acceptance(
"Sidebar - Experimental sidebar and hamburger setting enabled - Sidebar enabled",
function (needs) {