-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into dev/build
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
e2e-tests/fixtures/customizer/hfg/hfg-secondary-menu-component.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
19 changes: 19 additions & 0 deletions
19
e2e-tests/specs/customizer/hfg/hgf-secondary-menu-component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Custom navwalker for secondary menu. | ||
* | ||
* Author: Soare Robert <[email protected]> | ||
* Created on: 25/04/2024 | ||
* | ||
* @package Neve\Views | ||
*/ | ||
|
||
namespace Neve\Views; | ||
|
||
/** | ||
* Class Secondary_Nav_Walker | ||
* | ||
* @package Neve\Views | ||
*/ | ||
class Secondary_Nav_Walker extends Nav_Walker { | ||
|
||
/** | ||
* Secondary_Nav_Walker constructor. | ||
*/ | ||
public function __construct() { | ||
add_action( 'neve_after_header_wrapper_hook', [ $this, 'inline_style_for_sidebar' ], 9 ); | ||
} | ||
} |