Skip to content

Commit

Permalink
UT fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Deva309 authored and bandana147 committed Jan 14, 2025
1 parent 3026b3f commit 170d0f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/blocks/global-navigation/global-navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ describe('global navigation', () => {
const localNavTitle = document.querySelector(selectors.localNavTitle);
localNavTitle.click();
const localNav = document.querySelector(selectors.localNav);
expect(localNav.classList.contains('active')).to.be.true;
expect(localNav.classList.contains('feds-localnav--active')).to.be.true;
});

it('should remove is-sticky class to localnav on scroll less than localnav placement', async () => {
Expand Down Expand Up @@ -762,7 +762,7 @@ describe('global navigation', () => {
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
document.activeElement.click();
expect(document.activeElement.parentElement.classList.contains('feds-dropdown--active')).to.be.true;
expect(document.activeElement.getAttribute('aria-expanded')).to.equal('true');
const headline = document.activeElement.parentElement.querySelector('.feds-menu-headline');
headline.click();
expect(headline.parentElement.classList.contains('feds-dropdown--active')).to.be.true;
Expand Down
8 changes: 7 additions & 1 deletion test/blocks/global-navigation/keyboard/keyboard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ describe('keyboard navigation', () => {
keyboardNavigation.mainNav.popup.desktop = { matches: false };
});

it('Should open the section on Tab', async () => {
it('Should open the section on Space', async () => {
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
Expand All @@ -1142,6 +1142,12 @@ describe('keyboard navigation', () => {
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Tab' });
const localnavTitle = document.querySelector('.feds-localnav-title');
expect(document.activeElement).to.equal(localnavTitle);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@
</nav>

</div></header>
<div class="feds-localnav active"><button class="feds-navLink--hoverCaret feds-localnav-title" aria-haspopup="true" aria-expanded="true">Adobe Express</button><div class="feds-localnav-curtain"></div><div class="feds-localnav-items"><div class="feds-navItem">
<div class="feds-localnav feds-localnav--active"><button class="feds-navLink--hoverCaret feds-localnav-title" aria-haspopup="true" aria-expanded="true">Adobe Express</button><div class="feds-localnav-curtain"></div><div class="feds-localnav-items"><div class="feds-navItem">
<a href="https://www.adobe.com/express" class="feds-navLink" daa-ll="Adobe Express-2">Overview</a>
</div><div class="feds-navItem feds-dropdown--active">
</div><div class="feds-navItem">
<button class="feds-navLink feds-navLink--hoverCaret" aria-expanded="true" aria-haspopup="true" daa-ll="Create-3" daa-lh="header|Open">
Create
</button>
<div class="feds-popup">
<div class="feds-menu-container">
<div class="feds-menu-content"><div class="feds-menu-column"><div class="feds-menu-section"><div class="feds-menu-headline" role="button" tabindex="0" aria-haspopup="true" aria-expanded="false" daa-ll="Shop for-1">
<div class="feds-menu-content"><div class="feds-menu-column"><div class="feds-menu-section feds-dropdown--active"><div class="feds-menu-headline" role="button" tabindex="0" aria-haspopup="true" aria-expanded="true" daa-ll="Shop for-1">
Shop for
</div><div class="feds-menu-items" daa-lh="Shop for"><a href="https://www.adobe.com/creativecloud.html" class="feds-navLink" daa-ll="What is Creative Cloud-1">
<div class="feds-navLink-image"><picture><img loading="lazy" src="https://main--federal--adobecom.aem.page/federal/assets/svgs/creative-cloud-40.svg" alt="Adobe Creative Cloud"></picture></div>
Expand Down

0 comments on commit 170d0f7

Please sign in to comment.