diff --git a/test/blocks/global-navigation/global-navigation.test.js b/test/blocks/global-navigation/global-navigation.test.js index 721fb734ae..a120644397 100644 --- a/test/blocks/global-navigation/global-navigation.test.js +++ b/test/blocks/global-navigation/global-navigation.test.js @@ -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 () => { @@ -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; diff --git a/test/blocks/global-navigation/keyboard/keyboard.test.js b/test/blocks/global-navigation/keyboard/keyboard.test.js index 401dcf0913..f4fb00aeb4 100644 --- a/test/blocks/global-navigation/keyboard/keyboard.test.js +++ b/test/blocks/global-navigation/keyboard/keyboard.test.js @@ -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' }); @@ -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); }); diff --git a/test/blocks/global-navigation/keyboard/mocks/localnav-mock.html b/test/blocks/global-navigation/keyboard/mocks/localnav-mock.html index 2bdc7cfe4d..5b16488b88 100644 --- a/test/blocks/global-navigation/keyboard/mocks/localnav-mock.html +++ b/test/blocks/global-navigation/keyboard/mocks/localnav-mock.html @@ -310,15 +310,15 @@ -
+
+
-