Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Uptime ]Update empty message for certs list #78575

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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+'
);
},
};
}