From 7fca59fb386f0463f7b120e2965807f1d23eea86 Mon Sep 17 00:00:00 2001 From: iRohitSingh <61353484+iRohitSingh@users.noreply.github.com> Date: Tue, 13 Feb 2024 20:29:26 +0530 Subject: [PATCH] Fix A11y in Navigation (#344) --- acceptance/cypress/tests/main/nav.cy.js | 8 +-- news/289.bugfix | 1 + src/components/Navigation/Navigation.jsx | 72 ++++++++++-------------- src/theme/_header.scss | 17 ++---- 4 files changed, 39 insertions(+), 59 deletions(-) create mode 100644 news/289.bugfix diff --git a/acceptance/cypress/tests/main/nav.cy.js b/acceptance/cypress/tests/main/nav.cy.js index ee26daf3..0f8e518a 100644 --- a/acceptance/cypress/tests/main/nav.cy.js +++ b/acceptance/cypress/tests/main/nav.cy.js @@ -27,7 +27,6 @@ context('Navigation Acceptance Tests', () => { path: '/level-1/level-2', }); - cy.visit('/'); cy.viewport('macbook-16'); }); @@ -44,17 +43,12 @@ context('Navigation Acceptance Tests', () => { cy.get('ul.desktop-menu button').contains('Level 1').click(); cy.get('.subitem-wrapper').findByText('Level 2').click(); cy.get('.documentFirstHeading').should('have.text', 'Level 2'); - }); it('Open 3rd level', function () { cy.wait('@content'); cy.get('ul.desktop-menu button').contains('Level 1').click(); - cy.get('.subsubitem-wrapper li').findByText('Level 3').click(); + cy.get('.subsubitem-wrapper').findByText('Level 3').click(); cy.get('.documentFirstHeading').should('have.text', 'Level 3'); - }); }); - - - diff --git a/news/289.bugfix b/news/289.bugfix new file mode 100644 index 00000000..ffd81190 --- /dev/null +++ b/news/289.bugfix @@ -0,0 +1 @@ +Fix Navigation fails html validator due to use of divs inside ul tag @iRohitSingh \ No newline at end of file diff --git a/src/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx index 3b9e6e26..17a4723a 100644 --- a/src/components/Navigation/Navigation.jsx +++ b/src/components/Navigation/Navigation.jsx @@ -141,58 +141,48 @@ const Navigation = ({ pathname }) => { {item.items && item.items.length > 0 && item.items.map((subitem) => ( -