Skip to content

Commit

Permalink
UT
Browse files Browse the repository at this point in the history
  • Loading branch information
Deva309 committed Oct 14, 2024
1 parent 68c6e93 commit 5a3d94f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ export const [hasActiveLink, setActiveLink, isActiveLink, getActiveLink] = (() =
(el) => (el.href === url || el.href.startsWith(`${url}?`) || el.href.startsWith(`${url}#`)),
(area) => {
const isCustomLinks = area.closest('.link-group')?.classList.contains('mobile-only');
const disableAED = getDisableAEDState();
if (disableAED || isCustomLinks || hasActiveLink() || !(area instanceof HTMLElement)) return null;
const disableAED = getDisableAEDState() || isCustomLinks;
if (disableAED || hasActiveLink() || !(area instanceof HTMLElement)) return null;
const activeLink = [
...area.querySelectorAll('a:not([data-modal-hash])'),
].find(isActiveLink);
Expand Down
2 changes: 1 addition & 1 deletion test/blocks/global-navigation/global-navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ describe('global navigation', () => {

describe('Custom Links for mobile hamburger menu', () => {
it('Add custom links through Link Group block in parallel to large menu\'s', async () => {
const customLinks = 'home,learn';
const customLinks = 'home,apps,learn';
await createFullGlobalNavigation({
viewport: 'mobile',
globalNavigation: navigationWithCustomLinks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default `<body><div>
<div>
<div>
<h2 id="home"><a href="https://www.google.com/#_home">Home</a></h2>
<h2 id="apps"><a href="https://www.google.com/#_apps">Apps</a></h2>
<h2 id="apps"><a href="/#_apps">Apps</a></h2>
<h2 id="learn"><a href="https://www.google.com/#_learn">Learn</a></h2>
</div>
</div>
Expand Down

0 comments on commit 5a3d94f

Please sign in to comment.