diff --git a/src/components/basic_table/basic_table.test.tsx b/src/components/basic_table/basic_table.test.tsx index bf9513474ff..6239fdf69f1 100644 --- a/src/components/basic_table/basic_table.test.tsx +++ b/src/components/basic_table/basic_table.test.tsx @@ -692,6 +692,40 @@ describe('EuiBasicTable', () => { ); }); + test('custom item actions', () => { + const props: EuiBasicTableProps = { + items: basicItems, + columns: [ + ...basicColumns, + { + name: 'Actions', + actions: [ + { + render: ({ id }) => ( + + ), + available: ({ id }) => id !== '3', + }, + ], + }, + ], + responsiveBreakpoint: true, // Needs to be in mobile to render customAction cell CSS + }; + const { queryByTestSubject, container } = render( + + ); + + expect(queryByTestSubject('customAction-1')).toBeInTheDocument(); + expect(queryByTestSubject('customAction-2')).toBeInTheDocument(); + expect(queryByTestSubject('customAction-3')).not.toBeInTheDocument(); + + expect( + container.querySelector('.euiTableRowCell--hasActions')!.className + ).toContain('-customActions'); + }); + describe('are disabled on selection', () => { test('single action', () => { const props: EuiBasicTableProps = {