From 0b030534d0709670848ec7062ed62fd2e464d761 Mon Sep 17 00:00:00 2001 From: Lauri Eskola <lauri.eskola@acquia.com> Date: Wed, 9 Nov 2022 15:04:59 +0200 Subject: [PATCH] Issue #3319325 by mherchel, nod_, alexpott: Olivero: Mobile menu does not work when authenticated and BigPipe enabled(D10 only) --- .../Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js | 9 +++++++++ core/themes/olivero/js/navigation.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js index 926f7eb9c6f0..d623b6f1acb0 100644 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js +++ b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js @@ -172,4 +172,13 @@ module.exports = { .click('[href="#footer"]') .waitForElementNotVisible(headerNavSelector); }, + 'Verify mobile menu works when Big Pipe when authenticated': (browser) => { + browser.drupalInstallModule('big_pipe').drupalLoginAsAdmin(() => { + browser + .drupalRelativeURL('/') + .assert.not.visible(headerNavSelector) + .click(mobileNavButtonSelector) + .waitForElementVisible(headerNavSelector); + }); + }, }; diff --git a/core/themes/olivero/js/navigation.js b/core/themes/olivero/js/navigation.js index 641f8c28e760..6fd179e535d7 100644 --- a/core/themes/olivero/js/navigation.js +++ b/core/themes/olivero/js/navigation.js @@ -140,7 +140,7 @@ const navButton = context.querySelector( '[data-drupal-selector="mobile-nav-button"]', ); - const body = context.querySelector('body'); + const body = document.body; const overlay = context.querySelector( '[data-drupal-selector="header-nav-overlay"]', ); -- GitLab