From f0d62d89b749c3c218756e24e5547c4b5a7142cf Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Wed, 15 Nov 2023 14:59:06 -0800 Subject: [PATCH] Fix misc flaky Cypress failures - `.realClick` causes issues on cell actions now due to the new transform animation, switch to `.click` - not totally what's going on with scrolling realMount, but oh well --- .../datagrid/body/data_grid_cell_popover.spec.tsx | 12 ++++++------ src/components/datagrid/utils/scrolling.spec.tsx | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/datagrid/body/data_grid_cell_popover.spec.tsx b/src/components/datagrid/body/data_grid_cell_popover.spec.tsx index c9f25772f605..13b3743b6c91 100644 --- a/src/components/datagrid/body/data_grid_cell_popover.spec.tsx +++ b/src/components/datagrid/body/data_grid_cell_popover.spec.tsx @@ -53,7 +53,7 @@ describe('EuiDataGridCellPopover', () => { '[data-gridcell-row-index="0"][data-gridcell-column-index="0"]' ).realClick(); - cy.get('[data-test-subj="euiDataGridCellExpandButton"]').realClick(); + cy.get('[data-test-subj="euiDataGridCellExpandButton"]').click(); cy.focused().should( 'have.attr', 'data-test-subj', @@ -73,7 +73,7 @@ describe('EuiDataGridCellPopover', () => { '[data-gridcell-row-index="1"][data-gridcell-column-index="1"]' ).realClick(); - cy.get('[data-test-subj="euiDataGridCellExpandButton"]').realClick(); + cy.get('[data-test-subj="euiDataGridCellExpandButton"]').click(); cy.focused().should( 'have.attr', 'data-test-subj', @@ -93,12 +93,12 @@ describe('EuiDataGridCellPopover', () => { '[data-gridcell-row-index="0"][data-gridcell-column-index="0"]' ).realClick(); - cy.get('[data-test-subj="euiDataGridCellExpandButton"]').realClick(); + cy.get('[data-test-subj="euiDataGridCellExpandButton"]').click(); cy.get('[data-test-subj="euiDataGridExpansionPopover"]').should('exist'); cy.get( '[data-gridcell-row-index="0"][data-gridcell-column-index="0"]' - ).realClick(); + ).realClick({ position: 'right' }); cy.get('[data-test-subj="euiDataGridExpansionPopover"]').should( 'not.exist' ); @@ -126,7 +126,7 @@ describe('EuiDataGridCellPopover', () => { cy.get( '[data-gridcell-row-index="0"][data-gridcell-column-index="0"]' ).realClick(); - cy.get('[data-test-subj="euiDataGridCellExpandButton"]').realClick(); + cy.get('[data-test-subj="euiDataGridCellExpandButton"]').click(); cy.get('.euiDataGridRowCell__popover.hello.world').should('exist'); }); @@ -150,7 +150,7 @@ describe('EuiDataGridCellPopover', () => { const openCellPopover = (id: string) => { cy.get( `[data-gridcell-row-index="0"][data-gridcell-column-id="${id}"]` - ).realClick(); + ).click(); cy.realPress('Enter'); }; diff --git a/src/components/datagrid/utils/scrolling.spec.tsx b/src/components/datagrid/utils/scrolling.spec.tsx index 6c9c1cbb5170..2d0762e101ab 100644 --- a/src/components/datagrid/utils/scrolling.spec.tsx +++ b/src/components/datagrid/utils/scrolling.spec.tsx @@ -65,7 +65,7 @@ describe('useScroll', () => { it('handles setFocusedCell being called manually on cells out of view', () => { const ref = createRef(); - cy.mount(); + cy.realMount(); // Wait for the grid to finish rendering and pass back the ref cy.get('[data-test-subj="euiDataGridBody"]').then(() => { @@ -80,7 +80,7 @@ describe('useScroll', () => { describe('cell popover', () => { it('handles openCellPopover being called manually on cells out of view', () => { const ref = createRef(); - cy.mount(); + cy.realMount(); // Wait for the grid to finish rendering and pass back the ref cy.get('[data-test-subj="euiDataGridBody"]').then(() => {