[SIEM] Fix layout issue for open timeline modal (#61786)

* show icon on open timeline modal

* add unit test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Angela Chuang 2020-03-30 14:32:20 +01:00 committed by GitHub
parent 2c60c5e005
commit f21dea11c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -70,6 +70,25 @@ describe('#getActionsColumns', () => {
expect(wrapper.find('[data-test-subj="open-duplicate"]').exists()).toBe(true);
});
test('it renders only duplicate icon (without heading)', () => {
const testProps: TimelinesTableProps = {
...getMockTimelinesTableProps(mockResults),
actionTimelineToShow: ['duplicate'],
};
const wrapper = mountWithIntl(
<ThemeProvider theme={theme}>
<TimelinesTable {...testProps} />
</ThemeProvider>
);
expect(
wrapper
.find('[data-test-subj="open-duplicate"]')
.first()
.text()
).toEqual('');
});
test('it does NOT render the duplicate timeline when actionTimelineToShow is NOT including the action duplicate)', () => {
const testProps: TimelinesTableProps = {
...getMockTimelinesTableProps(mockResults),

View file

@ -42,6 +42,7 @@ export const getActionsColumns = ({
timelineId: savedObjectId ?? '',
});
},
type: 'icon',
enabled: ({ savedObjectId }: OpenTimelineResult) => savedObjectId != null,
description: i18n.OPEN_AS_DUPLICATE,
'data-test-subj': 'open-duplicate',