Skip to content

Commit

Permalink
Differentiate between Cloud and on-prem scenarios more clearly in Upg…
Browse files Browse the repository at this point in the history
…rade Step tests.
  • Loading branch information
cjcenizal committed Aug 23, 2021
1 parent c75ff8f commit 4fc9407
Showing 1 changed file with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,38 @@ describe('Overview - Upgrade Step', () => {
server.restore();
});

test('Shows link to setup upgrade docs for on-prem installations', () => {
const { exists } = testBed;
describe('On-prem', () => {
test('Shows link to setup upgrade docs', () => {
const { exists } = testBed;

expect(exists('upgradeSetupDocsLink')).toBe(true);
expect(exists('upgradeSetupCloudLink')).toBe(false);
expect(exists('upgradeSetupDocsLink')).toBe(true);
expect(exists('upgradeSetupCloudLink')).toBe(false);
});
});

test('Shows upgrade CTA and link to docs for cloud installations', async () => {
await act(async () => {
testBed = await setupOverviewPage({
kibanaContextOverrides: {
cloud: {
isCloudEnabled: true,
deploymentUrl: 'https://cloud.elastic.co./deployments/bfdad4ef99a24212a06d387593686d63',
describe('On Cloud', () => {
test('Shows upgrade CTA and link to docs', async () => {
await act(async () => {
testBed = await setupOverviewPage({
kibanaContextOverrides: {
cloud: {
isCloudEnabled: true,
deploymentUrl:
'https://cloud.elastic.co./deployments/bfdad4ef99a24212a06d387593686d63',
},
},
},
});
});
});

const { component, exists, find } = testBed;
component.update();
const { component, exists, find } = testBed;
component.update();

expect(exists('upgradeSetupCloudLink')).toBe(true);
expect(exists('upgradeSetupDocsLink')).toBe(true);
expect(exists('upgradeSetupDocsLink')).toBe(true);
expect(exists('upgradeSetupCloudLink')).toBe(true);

expect(find('upgradeSetupCloudLink').props().href).toBe(
'https://cloud.elastic.co./deployments/bfdad4ef99a24212a06d387593686d63'
);
expect(find('upgradeSetupCloudLink').props().href).toBe(
'https://cloud.elastic.co./deployments/bfdad4ef99a24212a06d387593686d63'
);
});
});
});

0 comments on commit 4fc9407

Please sign in to comment.