Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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(<EmptyPage actions={actions} title="My Super Title" />);
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(<EmptyPage actions={actions} title="My Super Title" />);
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(<EmptyPage actions={actions} title="My Super Title" />);
expect(EmptyComponent).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,7 @@ const EmptyPageComponent = React.memo<EmptyPageProps>(({ 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 ? (
Expand All @@ -70,8 +61,8 @@ const EmptyPageComponent = React.memo<EmptyPageProps>(({ actions, message, title
key={`empty-page-${titles[idx]}-action`}
>
<EuiCard
title={descriptionTitle}
description={description}
title={descriptionTitle ?? false}
description={description ?? false}
Comment on lines +64 to +65
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close enough... 😅

Suggested change
title={descriptionTitle ?? false}
description={description ?? false}
gpt3={`if text === '' DON'T DISPLAY BOX AROUND BUTTON PLZ`}

footer={
/* eslint-disable-next-line @elastic/eui/href-or-on-click */
<EuiButton
Expand Down