[Stack Monitoring] Fix monitoring func test (#115013)

* 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>
This commit is contained in:
Kevin Lacabane 2021-10-14 22:47:57 +02:00 committed by GitHub
parent 91d48ff475
commit e49ec25fae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 9 deletions

View file

@ -3,6 +3,7 @@
exports[`NoData should show a default message if reason is unknown 1`] = `
<div
class="euiPage euiPage--paddingMedium euiPage--grow"
data-test-subj="noDataContainer"
>
<h1
class="euiScreenReaderOnly"
@ -94,6 +95,7 @@ exports[`NoData should show a default message if reason is unknown 1`] = `
exports[`NoData should show text next to the spinner while checking a setting 1`] = `
<div
class="euiPage euiPage--paddingMedium euiPage--grow"
data-test-subj="noDataContainer"
>
<h1
class="euiScreenReaderOnly"

View file

@ -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
@ -97,13 +101,13 @@ export function NoData(props) {
<CloudDeployment />
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</NoDataContainer>
);
}
if (useInternalCollection) {
return (
<EuiPage>
<NoDataContainer>
<EuiScreenReaderOnly>
<h1>
<FormattedMessage
@ -140,12 +144,12 @@ export function NoData(props) {
) : null}
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</NoDataContainer>
);
}
return (
<EuiPage>
<NoDataContainer>
<EuiScreenReaderOnly>
<h1>
<FormattedMessage
@ -211,7 +215,7 @@ export function NoData(props) {
</EuiButtonEmpty>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</NoDataContainer>
);
}

View file

@ -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');
@ -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);
});