fix(client): show check code button after reset (#50778)

This commit is contained in:
Oliver Eyton-Williams
2023-06-22 22:19:17 +02:00
committed by GitHub
parent ea45dc84b7
commit 73249cf6e3
2 changed files with 24 additions and 1 deletions
@@ -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}
@@ -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}<meta charset="UTF-8" />');
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' },