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 21, 2024
1 parent 5b40eb4 commit a99261d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cypress/component/SelectPreview.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,13 @@ describe('Select', () => {
cy.findByRole('button', {name: 'Label'}).focus();
});

it('the button should have focus', () => {
cy.findByRole('button', {name: 'Label'}).should('have.focus');
});

context('when the down arrow key is pressed', () => {
beforeEach(() => {
cy.findByRole('button', {name: 'Label'}).realType('{downarrow}');
cy.realType('{downarrow}');
});

context('the select button', () => {
Expand Down Expand Up @@ -573,6 +577,10 @@ describe('Select', () => {
cy.findByRole('button', {name: 'Label'}).focus();
});

it('button should have focus', () => {
cy.findByRole('button', {name: 'Label'}).should('have.focus');
});

context(
'when a character is typed (provided no other characters have been typed in the last 500ms), the select should select the first matching option beyond the currently selected option (cycling back to the beginning of the options if necessary)',
() => {
Expand Down

0 comments on commit a99261d

Please sign in to comment.