From b3eaaf871dc201ad79e34d1a64f9280e12a60a93 Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Fri, 27 Oct 2023 15:57:07 -0700 Subject: [PATCH] Skip flaky React 16 Cypress test --- src/components/accordion/accordion.spec.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/accordion/accordion.spec.tsx b/src/components/accordion/accordion.spec.tsx index 40eb8538c769..055b2f14e1ad 100644 --- a/src/components/accordion/accordion.spec.tsx +++ b/src/components/accordion/accordion.spec.tsx @@ -75,14 +75,17 @@ describe('EuiAccordion', () => { }); describe('forceState', () => { - it('does not focus the accordion when `forceState` prevents the accordion from opening', () => { - cy.realMount(); + 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(); - 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 = () => {