Skip to content

Commit

Permalink
Update empty state for new page template
Browse files Browse the repository at this point in the history
- Remove EuiPanel wrapper - KibanaPageTemplate does that automatically for us

- Include SynonymModal, required for header create button to work as expected
  • Loading branch information
cee-chen committed Jun 21, 2021
1 parent 4de9944 commit 0739e1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { shallow } from 'enzyme';

import { EuiEmptyPrompt, EuiButton } from '@elastic/eui';

import { EmptyState } from './';
import { EmptyState, SynonymModal } from './';

describe('EmptyState', () => {
it('renders', () => {
Expand All @@ -24,4 +24,10 @@ describe('EmptyState', () => {
expect.stringContaining('/synonyms-guide.html')
);
});

it('renders the add synonym modal', () => {
const wrapper = shallow(<EmptyState />);

expect(wrapper.find(SynonymModal)).toHaveLength(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

import React from 'react';

import { EuiPanel, EuiEmptyPrompt, EuiButton } from '@elastic/eui';
import { EuiEmptyPrompt, EuiButton } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { DOCS_PREFIX } from '../../../routes';

import { SynonymIcon } from './';
import { SynonymModal, SynonymIcon } from './';

export const EmptyState: React.FC = () => {
return (
<EuiPanel color="subdued">
<>
<EuiEmptyPrompt
iconType={SynonymIcon}
title={
Expand Down Expand Up @@ -47,6 +47,7 @@ export const EmptyState: React.FC = () => {
</EuiButton>
}
/>
</EuiPanel>
<SynonymModal />
</>
);
};

0 comments on commit 0739e1f

Please sign in to comment.