diff --git a/CHANGELOG.md b/CHANGELOG.md index f78148178ea..3e56330bc76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fixed `EuiTableRowCell` from overwriting its child element's `className` [#709](https://github.com/elastic/eui/pull/709) - Allow `EuiContextMenuPanel`s to update when their `children` changes ([#710](https://github.com/elastic/eui/pull/710)) +- `EuiInMemoryTable` now passes `itemIdToExpandedRowMap` prop to `EuiBasicTable` ([#759](https://github.com/elastic/eui/pull/759)) ## [`0.0.44`](https://github.com/elastic/eui/tree/v0.0.44) diff --git a/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap b/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap index a1b126eccda..e628f608a7b 100644 --- a/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap +++ b/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap @@ -96,6 +96,46 @@ exports[`EuiInMemoryTable with items 1`] = ` /> `; +exports[`EuiInMemoryTable with items and expanded item 1`] = ` + + expanded row content + , + } + } + items={ + Array [ + Object { + "id": "1", + "name": "name1", + }, + Object { + "id": "2", + "name": "name2", + }, + Object { + "id": "3", + "name": "name3", + }, + ] + } + noItemsMessage="No items found" + onChange={[Function]} + responsive={true} +/> +`; + exports[`EuiInMemoryTable with items and message - expecting to show the items 1`] = ` ); diff --git a/src/components/basic_table/in_memory_table.test.js b/src/components/basic_table/in_memory_table.test.js index 8761cc6f05c..be00822f60f 100644 --- a/src/components/basic_table/in_memory_table.test.js +++ b/src/components/basic_table/in_memory_table.test.js @@ -93,6 +93,33 @@ describe('EuiInMemoryTable', () => { expect(component).toMatchSnapshot(); }); + test('with items and expanded item', () => { + + const props = { + ...requiredProps, + items: [ + { id: '1', name: 'name1' }, + { id: '2', name: 'name2' }, + { id: '3', name: 'name3' } + ], + columns: [ + { + field: 'name', + name: 'Name', + description: 'description' + } + ], + itemIdToExpandedRowMap: { + '1':
expanded row content
+ } + }; + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); + }); + test('with items and message - expecting to show the items', () => { const props = {