Skip to content

Commit

Permalink
Fix misc flaky Cypress failures
Browse files Browse the repository at this point in the history
- `.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
  • Loading branch information
cee-chen committed Nov 15, 2023
1 parent ef70edd commit f0d62d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/components/datagrid/body/data_grid_cell_popover.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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'
);
Expand Down Expand Up @@ -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');
});
Expand All @@ -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');
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/datagrid/utils/scrolling.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('useScroll', () => {

it('handles setFocusedCell being called manually on cells out of view', () => {
const ref = createRef<EuiDataGridRefProps>();
cy.mount(<EuiDataGrid {...baseProps} ref={ref} />);
cy.realMount(<EuiDataGrid {...baseProps} ref={ref} />);

// Wait for the grid to finish rendering and pass back the ref
cy.get('[data-test-subj="euiDataGridBody"]').then(() => {
Expand All @@ -80,7 +80,7 @@ describe('useScroll', () => {
describe('cell popover', () => {
it('handles openCellPopover being called manually on cells out of view', () => {
const ref = createRef<EuiDataGridRefProps>();
cy.mount(<EuiDataGrid {...baseProps} ref={ref} />);
cy.realMount(<EuiDataGrid {...baseProps} ref={ref} />);

// Wait for the grid to finish rendering and pass back the ref
cy.get('[data-test-subj="euiDataGridBody"]').then(() => {
Expand Down

0 comments on commit f0d62d8

Please sign in to comment.