Skip to content

Commit

Permalink
Prevent other tests from breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmrj committed Jan 8, 2025
1 parent 4addfef commit 102d6cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/blocks/global-navigation/gnav-promo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Promo', () => {
it('is available if set up correctly', async () => {
const promoMeta = toFragment`<meta name="gnav-promo-source" content="http://localhost:2000/fragments/correct-promo-fragment">`;
document.head.append(promoMeta);
const nav = await createFullGlobalNavigation({ hasPromo: true });
const nav = await createFullGlobalNavigation({ hasPromo: true, imsInitialized: true });
expect(nav.block.classList.contains('has-promo')).to.be.true;
const asideElem = nav.block.querySelector('.aside.promobar');
expect(asideElem).to.exist;
Expand Down
3 changes: 2 additions & 1 deletion test/blocks/global-navigation/test-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const createFullGlobalNavigation = async ({
hasPromo,
hasBreadcrumbs = true,
unavContent = null,
imsInitialized = false,
} = {}) => {
const clock = sinon.useFakeTimers({ shouldAdvanceTime: true });
setConfig({ ...config, ...customConfig });
Expand All @@ -195,7 +196,7 @@ export const createFullGlobalNavigation = async ({
return null;
});
window.adobeIMS = {
initialized: true,
initialized: imsInitialized,
isSignedInUser: stub().returns(signedIn),
getAccessToken: stub().returns('mock-access-token'),
getProfile: stub().returns(
Expand Down

0 comments on commit 102d6cf

Please sign in to comment.