Skip to content

Commit

Permalink
[Stack Monitoring] Fix monitoring func test (#115013)
Browse files Browse the repository at this point in the history
* add noDataContainer test-subj

* remove unnecessary test step

* Fix test subjects for overview page

* remove unused service

* update NoData component snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and matschaffer committed Oct 15, 2021
1 parent d2075f6 commit 9b08c78
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.

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

32 changes: 26 additions & 6 deletions x-pack/plugins/monitoring/public/components/no_data/no_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ export function NoData(props) {
window.location.hash = getSafeForExternalLink('#/elasticsearch/nodes');
}

const NoDataContainer = ({ children }) => {
return <EuiPage data-test-subj="noDataContainer">{children}</EuiPage>;
};

if (isCloudEnabled) {
return (
<EuiPage>
<NoDataContainer>
<EuiScreenReaderOnly>
<h1>
<FormattedMessage
Expand Down Expand Up @@ -97,13 +101,21 @@ export function NoData(props) {
<CloudDeployment />
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</NoDataContainer>
);
}

if (useInternalCollection) {
return (
<EuiPage>
<NoDataContainer>
<EuiScreenReaderOnly>
<h1>
<FormattedMessage
id="xpack.monitoring.no_data.internal_collection.heading"
defaultMessage="No monitoring data found."
/>
</h1>
</EuiScreenReaderOnly>
<EuiPageBody restrictWidth={600}>
<EuiPageContent
verticalPosition="center"
Expand Down Expand Up @@ -132,12 +144,20 @@ export function NoData(props) {
) : null}
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</NoDataContainer>
);
}

return (
<EuiPage>
<NoDataContainer>
<EuiScreenReaderOnly>
<h1>
<FormattedMessage
id="xpack.monitoring.no_data.heading"
defaultMessage="No monitoring data found."
/>
</h1>
</EuiScreenReaderOnly>
<EuiPageBody restrictWidth={600}>
<EuiPageContent
verticalPosition="center"
Expand Down Expand Up @@ -195,7 +215,7 @@ export function NoData(props) {
</EuiButtonEmpty>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</NoDataContainer>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['monitoring', 'common', 'header']);
const esSupertest = getService('esSupertest');
const noData = getService('monitoringNoData');
const testSubjects = getService('testSubjects');
const clusterOverview = getService('monitoringClusterOverview');
const retry = getService('retry');
const esDeleteAllIndices = getService('esDeleteAllIndices');
Expand Down Expand Up @@ -53,8 +52,6 @@ export default function ({ getService, getPageObjects }) {
// Here we are checking that once Monitoring is enabled,
// it moves on to the cluster overview page.
await retry.tryForTime(20000, async () => {
// Click the refresh button
await testSubjects.click('querySubmitButton');
await clusterOverview.closeAlertsModal();
expect(await clusterOverview.isOnClusterOverview()).to.be(true);
});
Expand Down

0 comments on commit 9b08c78

Please sign in to comment.