Skip to content

Commit ee1e90f

Browse files
authored
Merge branch 'main' into more-region-cleanup
2 parents ca195e0 + b3eaaf8 commit ee1e90f

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/components/accordion/accordion.spec.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,17 @@ describe('EuiAccordion', () => {
7575
});
7676

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

81-
cy.contains('Click me to toggle').realClick();
82-
cy.focused()
83-
.should('not.have.class', 'euiAccordion__childWrapper')
84-
.contains('Click me to toggle');
85-
});
83+
cy.contains('Click me to toggle').realClick();
84+
cy.focused()
85+
.should('not.have.class', 'euiAccordion__childWrapper')
86+
.contains('Click me to toggle');
87+
});
88+
}
8689

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

0 commit comments

Comments
 (0)