From ee6507288a7be576e26d075bf95216616c3ca03f Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Tue, 1 Mar 2022 13:16:55 -0800 Subject: [PATCH 1/4] [misc setup] refactor cell actions unit tests to use mock component - this allows us to `component.find()` by the 'MockAction' name, which future unit tests will be using to determine the # of actions rendered --- .../body/data_grid_cell_actions.test.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/datagrid/body/data_grid_cell_actions.test.tsx b/src/components/datagrid/body/data_grid_cell_actions.test.tsx index eb4056ffe02..2039e3eb448 100644 --- a/src/components/datagrid/body/data_grid_cell_actions.test.tsx +++ b/src/components/datagrid/body/data_grid_cell_actions.test.tsx @@ -9,11 +9,16 @@ import React from 'react'; import { shallow } from 'enzyme'; +import { EuiDataGridColumnCellAction } from '../data_grid_types'; import { EuiDataGridCellActions, EuiDataGridCellPopoverActions, } from './data_grid_cell_actions'; +const MockAction: EuiDataGridColumnCellAction = ({ Component }) => ( + +); + describe('EuiDataGridCellActions', () => { const requiredProps = { closePopover: jest.fn(), @@ -62,7 +67,7 @@ describe('EuiDataGridCellActions', () => {