Skip to content

Commit

Permalink
fix: Updated Select Preview spec
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-bagwell committed Nov 25, 2024
1 parent a8eab18 commit 2e565f4
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions cypress/component/SelectPreview.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,21 +301,23 @@ describe('Select', () => {
});
});

context('when the up arrow key is pressed', () => {
beforeEach(() => {
cy.findByRole('button', {name: 'Label'})
.pipe(h.selectPreview.getMenu)
.should('exist')
.realPress('ArrowUp');
});

context('the menu', () => {
it('should set assistive focus to the "E-mail" option', () => {
it('should not be flaky when arrow key is pressed', () => {
context('when the up arrow key is pressed', () => {
beforeEach(() => {
cy.findByRole('button', {name: 'Label'})
.pipe(h.selectPreview.getMenu)
.should('exist')
.pipe(getAssistiveFocus)
.should('have.text', 'E-mail');
.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');
});
});
});
});
Expand Down

0 comments on commit 2e565f4

Please sign in to comment.