Cypress.Commands.add('tabFocus', el => {
  do {
    cy.tab();
    cy.focused().should('have.attr', 'aria-label');
  } while (
    !cy
      .get(el)
      .last()
      .focus()
  );
});

describe('Facilities VAMC SideNav', () => {
  it('should tab access the links on the left nav and verify focus', () => {
    cy.visit('/pittsburgh-health-care');
    cy.injectAxe();
    cy.axeCheck();

    // Accept initial modal and start atop
    if (Cypress.$('body').find('#modal-announcement')) {
      cy.get('#modal-announcement')
        .get('.va-modal-close')
        .first()
        .click();
    }

    // Start tab access
    cy.get('.va-sidenav-item-label')
      .first()
      .focus();

    cy.tabFocus('.va-sidenav-level-2 a');
  });
});

@@ -387,218 +387,8 @@
 );%0A%0A
-    // Accept initial modal and start atop%0A    if (Cypress.$('body').find('#modal-announcement')) %7B%0A      cy.get('#modal-announcement')%0A        .get('.va-modal-close')%0A        .first()%0A        .click();%0A    %7D%0A%0A
     

Remove find modal and close it part to side nav e2e test (#18866)