Skip to content

Commit

Permalink
[Uptime ]Update empty message for certs list (elastic#78575)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
shahzad31 and kibanamachine committed Dec 14, 2020
1 parent df0d81a commit 9a129b8
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CertMonitors } from './cert_monitors';
import * as labels from './translations';
import { Cert, CertMonitor } from '../../../common/runtime_types';
import { FingerprintCol } from './fingerprint_col';
import { NO_CERTS_AVAILABLE } from './translations';

interface Page {
index: number;
Expand Down Expand Up @@ -109,6 +110,7 @@ export const CertificateList: React.FC<Props> = ({ page, sort, onChange }) => {
direction: sort.direction,
},
}}
noItemsMessage={<span data-test-subj="uptimeCertsEmptyMessage">{NO_CERTS_AVAILABLE}</span>}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ export const FINGERPRINTS_COL = i18n.translate('xpack.uptime.certs.list.expirati
export const COPY_FINGERPRINT = i18n.translate('xpack.uptime.certs.list.copyFingerprint', {
defaultMessage: 'Click to copy fingerprint value',
});

export const NO_CERTS_AVAILABLE = i18n.translate('xpack.uptime.certs.list.empty', {
defaultMessage: 'No Certificates found. Note: Certificates are only visible for Heartbeat 7.8+',
});
102 changes: 60 additions & 42 deletions x-pack/test/functional/apps/uptime/certificates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,81 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const es = getService('es');

describe('certificates', function () {
before(async () => {
await makeCheck({ es, tls: true });
await uptime.goToRoot(true);
});
describe('empty certificates', function () {
before(async () => {
await makeCheck({ es });
await uptime.goToRoot(true);
});

beforeEach(async () => {
await makeCheck({ es, tls: true });
it('go to certs page', async () => {
await uptimeService.common.waitUntilDataIsLoaded();
await uptimeService.cert.hasViewCertButton();
await uptimeService.navigation.goToCertificates();
});
it('displays empty message', async () => {
await uptimeService.cert.displaysEmptyMessage();
});
});

it('can navigate to cert page', async () => {
await uptimeService.common.waitUntilDataIsLoaded();
await uptimeService.cert.hasViewCertButton();
await uptimeService.navigation.goToCertificates();
});
describe('with certs', function () {
before(async () => {
await makeCheck({ es, tls: true });
await uptime.goToRoot(true);
});

describe('page', () => {
beforeEach(async () => {
await uptimeService.navigation.goToCertificates();
await uptimeService.navigation.refreshApp();
await makeCheck({ es, tls: true });
});

it('displays certificates', async () => {
await uptimeService.cert.hasCertificates();
it('can navigate to cert page', async () => {
await uptimeService.common.waitUntilDataIsLoaded();
await uptimeService.cert.hasViewCertButton();
await uptimeService.navigation.goToCertificates();
});

it('displays specific certificates', async () => {
const certId = getSha256();
const { monitorId } = await makeCheck({
es,
tls: {
sha256: certId,
},
describe('page', () => {
beforeEach(async () => {
await uptimeService.navigation.goToCertificates();
await uptimeService.navigation.refreshApp();
});

await uptimeService.navigation.refreshApp();
await uptimeService.cert.certificateExists({ certId, monitorId });
});
it('displays certificates', async () => {
await uptimeService.cert.hasCertificates();
});

it('displays specific certificates', async () => {
const certId = getSha256();
const { monitorId } = await makeCheck({
es,
tls: {
sha256: certId,
},
});

await uptimeService.navigation.refreshApp();
await uptimeService.cert.certificateExists({ certId, monitorId });
});

it('performs search against monitor id', async () => {
const certId = getSha256();
const { monitorId } = await makeCheck({
es,
monitorId: 'cert-test-check-id',
fields: {
monitor: {
name: 'Cert Test Check',
it('performs search against monitor id', async () => {
const certId = getSha256();
const { monitorId } = await makeCheck({
es,
monitorId: 'cert-test-check-id',
fields: {
monitor: {
name: 'Cert Test Check',
},
url: {
full: 'https://site-to-check.com/',
},
},
url: {
full: 'https://site-to-check.com/',
tls: {
sha256: certId,
},
},
tls: {
sha256: certId,
},
});
await uptimeService.navigation.refreshApp();
await uptimeService.cert.searchIsWorking(monitorId);
});
await uptimeService.navigation.refreshApp();
await uptimeService.cert.searchIsWorking(monitorId);
});
});
});
Expand Down
7 changes: 7 additions & 0 deletions x-pack/test/functional/services/uptime/certificates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,12 @@ export function UptimeCertProvider({ getService, getPageObjects }: FtrProviderCo
await self.hasCertificates(1);
});
},
async displaysEmptyMessage() {
await testSubjects.existOrFail('uptimeCertsEmptyMessage');
const emptyText = await testSubjects.getVisibleText('uptimeCertsEmptyMessage');
expect(emptyText).to.eql(
'No Certificates found. Note: Certificates are only visible for Heartbeat 7.8+'
);
},
};
}

0 comments on commit 9a129b8

Please sign in to comment.