Skip to content

Commit

Permalink
Fix Engine Overview not properly stretching to full page height (#103337
Browse files Browse the repository at this point in the history
)

- Caused by the wrapping <div> around the child views - removing that div and moving the `data-test-subj` hooks to the individual views fixes the issue
  • Loading branch information
Constance authored and kibanamachine committed Jun 24, 2021
1 parent 6c49247 commit 00bff7f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ describe('EngineOverview', () => {
setMockValues(values);
});

it('renders', () => {
const wrapper = shallow(<EngineOverview />);
expect(wrapper.find('[data-test-subj="EngineOverview"]')).toHaveLength(1);
});

describe('EmptyEngineOverview', () => {
it('renders when the engine has no documents & the user can add documents', () => {
const myRole = { canManageEngineDocuments: true, canViewEngineCredentials: true };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ export const EngineOverview: React.FC = () => {
const canAddDocuments = canManageEngineDocuments && canViewEngineCredentials;
const showEngineOverview = !isEngineEmpty || !canAddDocuments || isMetaEngine;

return (
<div data-test-subj="EngineOverview">
{showEngineOverview ? <EngineOverviewMetrics /> : <EmptyEngineOverview />}
</div>
);
return showEngineOverview ? <EngineOverviewMetrics /> : <EmptyEngineOverview />;
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const EmptyEngineOverview: React.FC = () => {
</EuiButton>,
],
}}
data-test-subj="EngineOverview"
>
<DocumentCreationButtons />
<DocumentCreationFlyout />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const EngineOverviewMetrics: React.FC = () => {
}),
}}
isLoading={dataLoading}
data-test-subj="EngineOverview"
>
<EuiFlexGroup>
<EuiFlexItem grow={1}>
Expand Down

0 comments on commit 00bff7f

Please sign in to comment.