diff --git a/client/src/templates/Challenges/classic/lower-jaw.tsx b/client/src/templates/Challenges/classic/lower-jaw.tsx index 1c88a1810f9..233cb7feae6 100644 --- a/client/src/templates/Challenges/classic/lower-jaw.tsx +++ b/client/src/templates/Challenges/classic/lower-jaw.tsx @@ -275,7 +275,8 @@ const LowerJaw = ({ onClick={tryToExecuteChallenge} {...(challengeIsCompleted && !focusManagementCompleted && { tabIndex: -1, className: 'sr-only' })} - {...(focusManagementCompleted && { 'aria-hidden': true })} + {...(challengeIsCompleted && + focusManagementCompleted && { 'aria-hidden': true })} ref={checkYourCodeButtonRef} > {checkButtonText} diff --git a/cypress/e2e/default/learn/challenges/multifile.ts b/cypress/e2e/default/learn/challenges/multifile.ts index 8a1a7c874eb..b7ae34b288d 100644 --- a/cypress/e2e/default/learn/challenges/multifile.ts +++ b/cypress/e2e/default/learn/challenges/multifile.ts @@ -70,6 +70,28 @@ describe('Challenge with multifile editor', () => { } ); + it( + 'brings back the check button after reset', + { browser: '!firefox' }, + () => { + cy.visit(location); + cy.focused().click().type('{end}{enter}'); + cy.get(selectors.checkLowerJawButton).should('not.be.focused'); + cy.get(selectors.checkLowerJawButton).click(); + // Ready to submit (submit button replaces check button) + cy.get(selectors.submitLowerJawButton).should('be.visible'); + cy.get(selectors.checkLowerJawButton).should('not.be.visible'); + // Reset + cy.get(selectors.resetCodeButton).click(); + cy.get('[data-cy=reset-modal-confirm').click(); + // First we need to click on the description or Cypress will not be able + // to scroll to the button + cy.get('.editor-upper-jaw').click(); + cy.get(selectors.checkLowerJawButton).should('be.visible'); + cy.get(selectors.submitLowerJawButton).should('not.be.visible'); + } + ); + it( 'checks hotkeys when instruction is focused', { browser: '!firefox' },