diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index fc87543d06..46ca3fafe0 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -90,6 +90,7 @@ export const CONFIG = { error: (e) => lanaLog({ message: 'Profile Menu error', e, tags: 'errorType=error,module=universalnav' }), }, }, + ...getConfig().unav?.profile?.config, }, }, callbacks: { @@ -1083,7 +1084,7 @@ export default async function init(block) { content, block, }); - gnav.init(); + await gnav.init(); block.setAttribute('daa-im', 'true'); const mepMartech = mep?.martech || ''; block.setAttribute('daa-lh', `gnav|${getExperienceName()}${mepMartech}`); diff --git a/test/blocks/global-navigation/test-utilities.js b/test/blocks/global-navigation/test-utilities.js index fab0999332..6f7df369be 100644 --- a/test/blocks/global-navigation/test-utilities.js +++ b/test/blocks/global-navigation/test-utilities.js @@ -215,9 +215,12 @@ export const createFullGlobalNavigation = async ({ ), ]); - const instance = await initGnav(document.body.querySelector('header')); - instance.imsReady(); - await clock.runAllAsync(); + const instancePromise = initGnav(document.body.querySelector('header')); + + await clock.runToLastAsync(); + const instance = await instancePromise; + const imsPromise = instance.imsReady(); + await clock.runToLastAsync(); // We restore the clock here, because waitForElement uses setTimeout clock.restore(); @@ -242,6 +245,7 @@ export const createFullGlobalNavigation = async ({ waitForElements.push(waitForElement(selectors.breadcrumbsWrapper, document.body)); } await Promise.all(waitForElements); + await imsPromise; window.fetch = ogFetch; window.adobeIMS = undefined;