diff --git a/e2e-tests/fixtures/customizer/hfg/hfg-secondary-menu-component.json b/e2e-tests/fixtures/customizer/hfg/hfg-secondary-menu-component.json new file mode 100644 index 0000000000..735da0c0e2 --- /dev/null +++ b/e2e-tests/fixtures/customizer/hfg/hfg-secondary-menu-component.json @@ -0,0 +1,12 @@ +{ + "neve_ran_builder_migration": true, + "neve_migrated_builders": true, + "neve_ran_migrations": true, + "neve_had_old_skin": true, + "neve_migrated_hfg_colors": true, + "nav_menu_locations": { + "primary": 176 + }, + "hfg_header_layout_v2": "{\"desktop\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[{\"id\":\"secondary-menu\"}]},\"main\":{\"left\":[{\"id\":\"logo\"}],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]}},\"mobile\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"main\":{\"left\":[{\"id\":\"logo\"}],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[{\"id\":\"nav-icon\"}]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"sidebar\":[{\"id\":\"secondary-menu\"}]}}\";}", + "neve_new_skin": "new" +} diff --git a/e2e-tests/specs/customizer/hfg/hgf-secondary-menu-component.spec.ts b/e2e-tests/specs/customizer/hfg/hgf-secondary-menu-component.spec.ts new file mode 100644 index 0000000000..ed3adace73 --- /dev/null +++ b/e2e-tests/specs/customizer/hfg/hgf-secondary-menu-component.spec.ts @@ -0,0 +1,19 @@ +import { test, expect } from '@playwright/test'; +import { setCustomizeSettings } from '../../../utils'; +import secondaryMenuSetup from '../../../fixtures/customizer/hfg/hfg-secondary-menu-component.json'; + +test.describe('Secondary Nav', async () => { + test('Mobile Sidebar Opening', async ({ page, request, baseURL }) => { + await setCustomizeSettings('hfgSearchFormIcon', secondaryMenuSetup, { + request, + baseURL, + }); + await page.goto('/?test_name=hfgSecondaryNav'); + + await page.setViewportSize({ width: 375, height: 812 }); // Mobile Mode. + + await page.getByRole('button', { name: 'Navigation Menu' }).click(); + + await expect(page.locator('#header-menu-sidebar-inner')).toBeVisible(); // Secondary_Nav_Walker enqueues the necessary JS to make the menu work. + }); +}); diff --git a/header-footer-grid/templates/components/component-nav-secondary.php b/header-footer-grid/templates/components/component-nav-secondary.php index 5a1853221b..051e38b84d 100644 --- a/header-footer-grid/templates/components/component-nav-secondary.php +++ b/header-footer-grid/templates/components/component-nav-secondary.php @@ -34,6 +34,7 @@ 'fallback_cb' => '__return_false', 'before' => '