Skip to content

Commit

Permalink
Merge branch 'main' into more-region-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Oct 27, 2023
2 parents ca195e0 + b3eaaf8 commit ee1e90f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/accordion/accordion.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ describe('EuiAccordion', () => {
});

describe('forceState', () => {
it('does not focus the accordion when `forceState` prevents the accordion from opening', () => {
cy.realMount(<EuiAccordion {...sharedProps} forceState="closed" />);
if (!React.version.startsWith('16')) {
// React 16 is super flaky for this test and can't find cy.focused() half the time
it('does not focus the accordion when `forceState` prevents the accordion from opening', () => {
cy.realMount(<EuiAccordion {...sharedProps} forceState="closed" />);

cy.contains('Click me to toggle').realClick();
cy.focused()
.should('not.have.class', 'euiAccordion__childWrapper')
.contains('Click me to toggle');
});
cy.contains('Click me to toggle').realClick();
cy.focused()
.should('not.have.class', 'euiAccordion__childWrapper')
.contains('Click me to toggle');
});
}

it('does not focus the accordion when programmatically toggled from outside the accordion', () => {
const ControlledComponent = () => {
Expand Down

0 comments on commit ee1e90f

Please sign in to comment.