From cdce29097b18de323be5274fe16126a35533979b Mon Sep 17 00:00:00 2001 From: "josh.bagwell" Date: Mon, 25 Nov 2024 17:04:58 -0700 Subject: [PATCH] fix: Updated Select Preview spec --- cypress/component/SelectPreview.spec.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cypress/component/SelectPreview.spec.tsx b/cypress/component/SelectPreview.spec.tsx index 73577530ab..d142756074 100644 --- a/cypress/component/SelectPreview.spec.tsx +++ b/cypress/component/SelectPreview.spec.tsx @@ -417,9 +417,9 @@ describe('Select', () => { // re-open while it's in the middle of closing) cy.findByRole('button', {name: 'Label'}) .pipe(h.selectPreview.getMenu) - .should('not.exist'); - cy.findByRole('button', {name: 'Label'}).focus(); - cy.findByRole('button', {name: 'Label'}).type('{downArrow}'); + .should('not.exist') + .focus() + .type('{downArrow}'); }); context('the menu', () => { @@ -434,12 +434,11 @@ describe('Select', () => { context('when the menu is re-opened BEFORE it has fully closed', () => { beforeEach(() => { - cy.findByRole('button', {name: 'Label'}).should('exist'); - cy.findByRole('button', {name: 'Label'}).realPress('{downarrow}'); + cy.findByRole('button', {name: 'Label'}).should('exist').type('{downArrow}'); }); context('the menu', () => { - it('should still have assistive focus set to the second option ("Phone")', () => { + it.only('should still have assistive focus set to the second option ("Phone")', () => { // Focus is shifting between the button and menu as we close // and open the menu. It's important that we use getMenu rather // than cy.focused() to ensure we obtain a reference to the menu.