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 19, 2024
1 parent 335a0ea commit 5b40eb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
17 changes: 8 additions & 9 deletions cypress/component/SelectPreview.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ describe('Select', () => {
});

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

Expand Down Expand Up @@ -500,8 +502,7 @@ describe('Select', () => {

context('when the down arrow key is pressed 2 more times', () => {
beforeEach(() => {
cy.realType('{downarrow}');
cy.realType('{downarrow}');
cy.realType('{downarrow}{downarrow}');
});

context('the menu', () => {
Expand All @@ -515,13 +516,13 @@ describe('Select', () => {

context('when the down arrow key is pressed 2 more times', () => {
beforeEach(() => {
cy.realType('{downarrow}');
cy.realType('{downarrow}');
cy.realType('{downarrow}{downarrow}');
});

context('the menu', () => {
it('should set assistive focus to the first option down ("Mobile Phone") since the second option down ("Telegram", which also happens to be the last option) is disabled', () => {
cy.findByRole('listbox')
cy.findByRole('button', {name: 'Label (Disabled Options)'})
.pipe(h.selectPreview.getMenu)
.pipe(getAssistiveFocus)
.should('have.text', 'Mobile Phone');
});
Expand Down Expand Up @@ -596,9 +597,7 @@ describe('Select', () => {

context('when "s{500ms delay}s" is typed', () => {
beforeEach(() => {
cy.findByRole('button', {name: 'Label'}).realType('s');
cy.wait(1000);
cy.realType('s');
cy.findByRole('button', {name: 'Label'}).realType('ss', {delay: 500});
});

context('the select button', () => {
Expand Down
1 change: 0 additions & 1 deletion modules/react/breadcrumbs/stories/examples/Overflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const OverflowBreadcrumbs = ({width = '100%'}) => {
<SegmentedControl
initialValue={width}
onSelect={data => {
console.log('you called?');
setContainerWidth(data.id);
}}
>
Expand Down

0 comments on commit 5b40eb4

Please sign in to comment.