diff --git a/x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap index 09dcb8dc5d84e1..9bf3be7b5dfa47 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders correctly 1`] = ` +exports[`EmptyPage component renders actions with descriptions 1`] = ` `; + +exports[`EmptyPage component renders actions without descriptions 1`] = ` + + + + Do Something + + + + } + iconType="logoSecurity" + title={ +

+ My Super Title +

+ } +/> +`; diff --git a/x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx index 8e025faefeabe3..28e01eaa3eead9 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx @@ -9,13 +9,27 @@ import React from 'react'; import { EmptyPage } from './index'; -test('renders correctly', () => { - const actions = { - actions: { - label: 'Do Something', - url: 'my/url/from/nowwhere', - }, - }; - const EmptyComponent = shallow(); - expect(EmptyComponent).toMatchSnapshot(); +describe('EmptyPage component', () => { + it('renders actions without descriptions', () => { + const actions = { + actions: { + label: 'Do Something', + url: 'my/url/from/nowwhere', + }, + }; + const EmptyComponent = shallow(); + expect(EmptyComponent).toMatchSnapshot(); + }); + + it('renders actions with descriptions', () => { + const actions = { + actions: { + description: 'My Description', + label: 'Do Something', + url: 'my/url/from/nowwhere', + }, + }; + const EmptyComponent = shallow(); + expect(EmptyComponent).toMatchSnapshot(); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx b/x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx index 89f4b125e930cd..e0db1e90374ad2 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx @@ -51,16 +51,7 @@ const EmptyPageComponent = React.memo(({ actions, message, title .filter((a) => a.label && a.url) .map( ( - { - icon, - label, - target, - url, - descriptionTitle = false, - description = false, - onClick, - fill = true, - }, + { icon, label, target, url, descriptionTitle, description, onClick, fill = true }, idx ) => descriptionTitle != null || description != null ? ( @@ -70,8 +61,8 @@ const EmptyPageComponent = React.memo(({ actions, message, title key={`empty-page-${titles[idx]}-action`} >