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

[Monitoring] Metricbeat Migration Wizard Tests #47139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
bc66425
Enable setup mode UI toggles
chrisronline Aug 6, 2019
3f0c65a
We want to keep the no data page but update the copy
chrisronline Aug 19, 2019
8c7e679
More updated copy
chrisronline Aug 19, 2019
10aeb2b
Remove manual checks for logstash, beats, apm and kibana
chrisronline Aug 19, 2019
3b33637
Hide the setup mode controls on the no data page. There is nothing di…
chrisronline Aug 21, 2019
100da8b
Setup mode test
chrisronline Aug 21, 2019
236b08b
Fix bug with disabling internal collection for ES
chrisronline Sep 4, 2019
fa80d10
First steps towards the redesign of setup mode
chrisronline Sep 6, 2019
cfb67e6
Consolidate UI code, design changes, use constants defined in our plugin
chrisronline Sep 9, 2019
2e72734
Fix tooltips
chrisronline Sep 9, 2019
679ff23
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Sep 9, 2019
da0e658
Design/copy feedback
chrisronline Sep 10, 2019
2241135
Use badge and onClick
chrisronline Sep 10, 2019
532bb55
Tests!
chrisronline Sep 11, 2019
e252fc2
Set up mode renderer tests
chrisronline Sep 12, 2019
faea4c2
More feedback
chrisronline Sep 16, 2019
7bc14c8
Only detect usage on the live cluster
chrisronline Sep 16, 2019
ad4aa88
Merge in monitoring/mb_setup_wizard_step5
chrisronline Sep 16, 2019
db69453
Update tests
chrisronline Sep 16, 2019
17991ab
Fix existing tests, remove test that will be added in other PR
chrisronline Sep 16, 2019
bfe2b49
Merge in master
chrisronline Sep 16, 2019
b0bed5b
Merge in monitoring/mb_setup_wizard_step5
chrisronline Sep 16, 2019
ff11b88
Undo accidential change
chrisronline Sep 16, 2019
af03ab4
Fix failing test
chrisronline Sep 16, 2019
1b75c94
Fix issue with wrong callout showing
chrisronline Sep 17, 2019
cdc25ea
Ensure we check for live nodes if no cluster uuid is provided
chrisronline Sep 17, 2019
207c0c7
We need a custom listing callout for ES
chrisronline Sep 17, 2019
46ef2af
Custom callout for kibana instances
chrisronline Sep 17, 2019
7ba9bf1
More space from the bottom bar
chrisronline Sep 17, 2019
2d83d88
Disable switching if they enabled internal collection
chrisronline Sep 17, 2019
079d44c
Copy updates
chrisronline Sep 17, 2019
7454702
Fix broken tests
chrisronline Sep 17, 2019
6af3a07
Fix more tests
chrisronline Sep 17, 2019
b83a1d4
Fix i18n
chrisronline Sep 18, 2019
7facf47
Update copy
chrisronline Sep 19, 2019
e0b6806
Merge in master
chrisronline Sep 19, 2019
b9c29a8
Fix a couple i18n issues
chrisronline Sep 20, 2019
d86ebba
Fixing a couple of missing scenarios
chrisronline Sep 20, 2019
3f57210
Fix translations
chrisronline Sep 24, 2019
a92d02d
Update snapshots
chrisronline Sep 24, 2019
7bd565c
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Sep 24, 2019
23860df
Merge remote-tracking branch 'elastic/master' into monitoring/mb_setu…
chrisronline Sep 30, 2019
a7dda51
PR feedback
chrisronline Sep 30, 2019
b9cfc26
PR feedback
chrisronline Sep 30, 2019
a82dd8a
We also need totalUniqueInternallyCollectedCount to identify when we …
chrisronline Oct 1, 2019
afa5751
Remove why documentation link until we have the resource available
chrisronline Oct 1, 2019
3c88753
Ensure tabs are properly disabled
chrisronline Oct 1, 2019
cf32128
Address issue with the ES nodes callout not working at times
chrisronline Oct 1, 2019
906c254
Ensure we check if setup mode is enabled
chrisronline Oct 1, 2019
05279cf
Change internal collection to self monitoring, and remove the word 'c…
chrisronline Oct 1, 2019
309acef
Merge in master
chrisronline Oct 1, 2019
82c03e3
Only show Enter setup mode on pages with valid setup mode options
chrisronline Oct 1, 2019
76f3ae2
Copy updates
chrisronline Oct 1, 2019
997de3e
Copy updates
chrisronline Oct 2, 2019
7002594
Merge in monitoring/mb_setup_wizard_step5
chrisronline Oct 2, 2019
b30c856
Fix up some tests
chrisronline Oct 2, 2019
ed27251
Ensure we update the top nav item when we toggle setup mode on or off
chrisronline Oct 2, 2019
c93d1de
Merge branch 'monitoring/mb_setup_wizard_step5' into monitoring/mb_se…
chrisronline Oct 2, 2019
29a0a8e
Update snapshot
chrisronline Oct 2, 2019
07962b1
Merge in master
chrisronline Oct 2, 2019
8a12fd9
Update tests
chrisronline Oct 2, 2019
7e1406c
Remove console.log
chrisronline Oct 2, 2019
968f783
Update copy
chrisronline Oct 2, 2019
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { shallow } from 'enzyme';
import { Flyout } from './flyout';
import { INSTRUCTION_STEP_ENABLE_METRICBEAT } from '../constants';
import {
ELASTICSEARCH_SYSTEM_ID,
KIBANA_SYSTEM_ID,
BEATS_SYSTEM_ID,
APM_SYSTEM_ID,
LOGSTASH_SYSTEM_ID
} from '../../../../common/constants';

jest.mock('ui/documentation_links', () => ({
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
DOC_LINK_VERSION: 'current'
}));

jest.mock('../../../../common', () => ({
formatTimestampToDuration: () => `0 seconds`,
}));

const PRODUCTS = [
{
name: ELASTICSEARCH_SYSTEM_ID
},
{
name: KIBANA_SYSTEM_ID
},
{
name: LOGSTASH_SYSTEM_ID
},
{
name: BEATS_SYSTEM_ID
},
{
name: APM_SYSTEM_ID
}
];

describe('Flyout', () => {
for (const { name } of PRODUCTS) {
describe(`${name}`, () => {
describe('part one', () => {
it('should render normally', () => {
const component = shallow(
<Flyout
onClose={() => {}}
product={{}}
productName={name}
/>
);
expect(component).toMatchSnapshot();
});
});

describe('part two', () => {
it('should show instructions to migrate to metricbeat', () => {
const component = shallow(
<Flyout
onClose={() => {}}
product={{
isInternalCollector: true
}}
productName={name}
/>
);
component.find('EuiButton').simulate('click');
component.update();
expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
});

it('should show instructions to disable internal collection', () => {
const component = shallow(
<Flyout
onClose={() => {}}
product={{
isPartiallyMigrated: true,
lastInternallyCollectedTimestamp: 0,
}}
meta={{
secondsAgo: 30
}}
productName={name}
/>
);
component.find('EuiButton').simulate('click');
component.update();
expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
});
});
});
}

it('should render a consistent completion state for all products', () => {
let template = null;
for (const { name } of PRODUCTS) {
const component = shallow(
<Flyout
onClose={() => {}}
product={{
isPartiallyMigrated: true
}}
meta={{
secondsAgo: 10
}}
productName={name}
/>
);
component.setState({
activeStep: INSTRUCTION_STEP_ENABLE_METRICBEAT,
});
component.update();
const steps = component.find('EuiSteps').prop('steps');
const step = steps[steps.length - 1];
if (!template) {
template = step;
expect(template).toMatchSnapshot();
} else {
expect(template).toEqual(step);
}
}
});

it('should render the beat type for beats for the enabling metricbeat step', () => {
const component = shallow(
<Flyout
onClose={() => {}}
product={{
isInternalCollector: true,
beatType: 'filebeat'
}}
productName={BEATS_SYSTEM_ID}
/>
);
component.find('EuiButton').simulate('click');
component.update();
expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
});

it('should render the beat type for beats for the disabling internal collection step', () => {
const component = shallow(
<Flyout
onClose={() => {}}
product={{
isPartiallyMigrated: true,
beatType: 'filebeat'
}}
meta={{
secondsAgo: 30
}}
productName={BEATS_SYSTEM_ID}
/>
);
component.find('EuiButton').simulate('click');
component.update();
expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
});

it('should show a restart warning for restarting the primary Kibana', () => {
const component = shallow(
<Flyout
onClose={() => {}}
product={{
isPartiallyMigrated: true,
isPrimary: true
}}
meta={{
secondsAgo: 30
}}
productName={KIBANA_SYSTEM_ID}
/>
);
component.find('EuiButton').simulate('click');
component.update();
expect(component.find('EuiFlyoutBody')).toMatchSnapshot();
});
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class SetupModeRenderer extends React.Component {
<Fragment>
<EuiSpacer size="xxl"/>
<EuiBottomBar>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem grow={false}>
Expand Down
Loading