From ef914536cf0b8ba0891653549d9691dea621fe23 Mon Sep 17 00:00:00 2001 From: "josh.bagwell" Date: Mon, 25 Nov 2024 13:16:49 -0700 Subject: [PATCH] fix: Updated Select Preview spec --- cypress/component/SelectPreview.spec.tsx | 26 +++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/cypress/component/SelectPreview.spec.tsx b/cypress/component/SelectPreview.spec.tsx index 432429ac9d..976a2acc6c 100644 --- a/cypress/component/SelectPreview.spec.tsx +++ b/cypress/component/SelectPreview.spec.tsx @@ -301,23 +301,21 @@ describe('Select', () => { }); }); - it('should not be flaky when arrow key is pressed', () => { - context('when the up arrow key is pressed', () => { - beforeEach(() => { + context('when the up arrow key is pressed', () => { + beforeEach(() => { + cy.findByRole('button', {name: 'Label'}) + .pipe(h.selectPreview.getMenu) + .should('exist') + .realPress('{uparrow}'); + }); + + context('the menu', () => { + it('should set assistive focus to the "E-mail" option', () => { cy.findByRole('button', {name: 'Label'}) .pipe(h.selectPreview.getMenu) .should('exist') - .realPress('{uparrow}'); - }); - - context('the menu', () => { - it('should set assistive focus to the "E-mail" option', () => { - cy.findByRole('button', {name: 'Label'}) - .pipe(h.selectPreview.getMenu) - .should('exist') - .pipe(getAssistiveFocus) - .should('have.text', 'E-mail'); - }); + .pipe(getAssistiveFocus) + .should('have.text', 'E-mail'); }); }); });