Skip to content

Commit 2923526

Browse files
[Uptime ]Update empty message for certs list (#78575)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent 2038582 commit 2923526

File tree

4 files changed

+73
-42
lines changed

4 files changed

+73
-42
lines changed

x-pack/plugins/uptime/public/components/certificates/certificates_list.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { CertMonitors } from './cert_monitors';
1414
import * as labels from './translations';
1515
import { Cert, CertMonitor } from '../../../common/runtime_types';
1616
import { FingerprintCol } from './fingerprint_col';
17+
import { NO_CERTS_AVAILABLE } from './translations';
1718

1819
interface Page {
1920
index: number;
@@ -109,6 +110,7 @@ export const CertificateList: React.FC<Props> = ({ page, sort, onChange }) => {
109110
direction: sort.direction,
110111
},
111112
}}
113+
noItemsMessage={<span data-test-subj="uptimeCertsEmptyMessage">{NO_CERTS_AVAILABLE}</span>}
112114
/>
113115
);
114116
};

x-pack/plugins/uptime/public/components/certificates/translations.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ export const FINGERPRINTS_COL = i18n.translate('xpack.uptime.certs.list.expirati
6565
export const COPY_FINGERPRINT = i18n.translate('xpack.uptime.certs.list.copyFingerprint', {
6666
defaultMessage: 'Click to copy fingerprint value',
6767
});
68+
69+
export const NO_CERTS_AVAILABLE = i18n.translate('xpack.uptime.certs.list.empty', {
70+
defaultMessage: 'No Certificates found. Note: Certificates are only visible for Heartbeat 7.8+',
71+
});

x-pack/test/functional/apps/uptime/certificates.ts

Lines changed: 60 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,63 +15,81 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
1515
const es = getService('es');
1616

1717
describe('certificates', function () {
18-
before(async () => {
19-
await makeCheck({ es, tls: true });
20-
await uptime.goToRoot(true);
21-
});
18+
describe('empty certificates', function () {
19+
before(async () => {
20+
await makeCheck({ es });
21+
await uptime.goToRoot(true);
22+
});
2223

23-
beforeEach(async () => {
24-
await makeCheck({ es, tls: true });
24+
it('go to certs page', async () => {
25+
await uptimeService.common.waitUntilDataIsLoaded();
26+
await uptimeService.cert.hasViewCertButton();
27+
await uptimeService.navigation.goToCertificates();
28+
});
29+
it('displays empty message', async () => {
30+
await uptimeService.cert.displaysEmptyMessage();
31+
});
2532
});
2633

27-
it('can navigate to cert page', async () => {
28-
await uptimeService.common.waitUntilDataIsLoaded();
29-
await uptimeService.cert.hasViewCertButton();
30-
await uptimeService.navigation.goToCertificates();
31-
});
34+
describe('with certs', function () {
35+
before(async () => {
36+
await makeCheck({ es, tls: true });
37+
await uptime.goToRoot(true);
38+
});
3239

33-
describe('page', () => {
3440
beforeEach(async () => {
35-
await uptimeService.navigation.goToCertificates();
36-
await uptimeService.navigation.refreshApp();
41+
await makeCheck({ es, tls: true });
3742
});
3843

39-
it('displays certificates', async () => {
40-
await uptimeService.cert.hasCertificates();
44+
it('can navigate to cert page', async () => {
45+
await uptimeService.common.waitUntilDataIsLoaded();
46+
await uptimeService.cert.hasViewCertButton();
47+
await uptimeService.navigation.goToCertificates();
4148
});
4249

43-
it('displays specific certificates', async () => {
44-
const certId = getSha256();
45-
const { monitorId } = await makeCheck({
46-
es,
47-
tls: {
48-
sha256: certId,
49-
},
50+
describe('page', () => {
51+
beforeEach(async () => {
52+
await uptimeService.navigation.goToCertificates();
53+
await uptimeService.navigation.refreshApp();
5054
});
5155

52-
await uptimeService.navigation.refreshApp();
53-
await uptimeService.cert.certificateExists({ certId, monitorId });
54-
});
56+
it('displays certificates', async () => {
57+
await uptimeService.cert.hasCertificates();
58+
});
59+
60+
it('displays specific certificates', async () => {
61+
const certId = getSha256();
62+
const { monitorId } = await makeCheck({
63+
es,
64+
tls: {
65+
sha256: certId,
66+
},
67+
});
68+
69+
await uptimeService.navigation.refreshApp();
70+
await uptimeService.cert.certificateExists({ certId, monitorId });
71+
});
5572

56-
it('performs search against monitor id', async () => {
57-
const certId = getSha256();
58-
const { monitorId } = await makeCheck({
59-
es,
60-
monitorId: 'cert-test-check-id',
61-
fields: {
62-
monitor: {
63-
name: 'Cert Test Check',
73+
it('performs search against monitor id', async () => {
74+
const certId = getSha256();
75+
const { monitorId } = await makeCheck({
76+
es,
77+
monitorId: 'cert-test-check-id',
78+
fields: {
79+
monitor: {
80+
name: 'Cert Test Check',
81+
},
82+
url: {
83+
full: 'https://site-to-check.com/',
84+
},
6485
},
65-
url: {
66-
full: 'https://site-to-check.com/',
86+
tls: {
87+
sha256: certId,
6788
},
68-
},
69-
tls: {
70-
sha256: certId,
71-
},
89+
});
90+
await uptimeService.navigation.refreshApp();
91+
await uptimeService.cert.searchIsWorking(monitorId);
7292
});
73-
await uptimeService.navigation.refreshApp();
74-
await uptimeService.cert.searchIsWorking(monitorId);
7593
});
7694
});
7795
});

x-pack/test/functional/services/uptime/certificates.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,12 @@ export function UptimeCertProvider({ getService, getPageObjects }: FtrProviderCo
5959
await self.hasCertificates(1);
6060
});
6161
},
62+
async displaysEmptyMessage() {
63+
await testSubjects.existOrFail('uptimeCertsEmptyMessage');
64+
const emptyText = await testSubjects.getVisibleText('uptimeCertsEmptyMessage');
65+
expect(emptyText).to.eql(
66+
'No Certificates found. Note: Certificates are only visible for Heartbeat 7.8+'
67+
);
68+
},
6269
};
6370
}

0 commit comments

Comments
 (0)