Skip to content
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
4 changes: 4 additions & 0 deletions x-pack/legacy/plugins/uptime/common/constants/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

export const MONITOR_ROUTE = '/monitor/:monitorId?';

export const OVERVIEW_ROUTE = '/';

export enum STATUS {
UP = 'up',
DOWN = 'down',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
export { PingHistogram } from './charts/ping_histogram';
export { Snapshot } from './charts/snapshot_container';
export { KueryBar } from './kuerybar/kuery_bar_container';
export { OverviewPage } from './pages/overview_container';
export { FilterGroup } from './filter_group/filter_group_container';
export { MonitorStatusDetails } from './monitor/status_details_container';
export { MonitorStatusBar } from './monitor/status_bar_container';
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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 { connect } from 'react-redux';
import { selectSelectedMonitor } from '../../../state/selectors';
import { AppState } from '../../../state';
import { PageHeaderComponent } from '../../../pages/page_header';

const mapStateToProps = (state: AppState) => ({
monitorStatus: selectSelectedMonitor(state),
});

export const PageHeader = connect(mapStateToProps, null)(PageHeaderComponent);
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

import React from 'react';
import DateMath from '@elastic/datemath';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { MonitorChartsComponent } from '../monitor_charts';
import { MonitorChart } from '../../../../common/graphql/types';
import { renderWithRouter } from '../../../lib';
import { shallowWithRouter } from '../../../lib';

describe('MonitorCharts component', () => {
let dateMathSpy: any;
Expand Down Expand Up @@ -63,18 +62,16 @@ describe('MonitorCharts component', () => {
};

it('renders the component without errors', () => {
const component = shallowWithIntl(
renderWithRouter(
<MonitorChartsComponent
danger="dangerColor"
data={{ monitorChartsData: chartResponse.monitorChartsData }}
loading={false}
mean="mean"
range="range"
success="success"
monitorId="something"
/>
)
const component = shallowWithRouter(
<MonitorChartsComponent
danger="dangerColor"
data={{ monitorChartsData: chartResponse.monitorChartsData }}
loading={false}
mean="mean"
range="range"
success="success"
monitorId="something"
/>
);
expect(component).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { shallowWithIntl, renderWithIntl } from 'test_utils/enzyme_helpers';
import React from 'react';
import { UptimeDatePicker } from '../uptime_date_picker';
import { renderWithRouter } from '../../../lib';
import { renderWithRouter, shallowWithRouter } from '../../../lib';

describe('UptimeDatePicker component', () => {
it('validates props with shallow render', () => {
const component = shallowWithIntl(renderWithRouter(<UptimeDatePicker />));
const component = shallowWithRouter(<UptimeDatePicker />);
expect(component).toMatchSnapshot();
});

it('renders properly with mock data', () => {
const component = renderWithIntl(renderWithRouter(<UptimeDatePicker />));
const component = renderWithRouter(<UptimeDatePicker />);
expect(component).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
*/

import React from 'react';
import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { MonitorBarSeries, MonitorBarSeriesProps } from '../monitor_bar_series';
import { renderWithRouter } from '../../../../lib';
import { renderWithRouter, shallowWithRouter } from '../../../../lib';
import { SummaryHistogramPoint } from '../../../../../common/graphql/types';

describe('MonitorBarSeries component', () => {
Expand Down Expand Up @@ -161,13 +160,13 @@ describe('MonitorBarSeries component', () => {
});

it('shallow renders a series when there are down items', () => {
const component = shallowWithIntl(renderWithRouter(<MonitorBarSeries {...props} />));
const component = shallowWithRouter(<MonitorBarSeries {...props} />);
expect(component).toMatchSnapshot();
});

it('shallow renders null when there are no down items', () => {
props.histogramSeries = [];
const component = shallowWithIntl(renderWithRouter(<MonitorBarSeries {...props} />));
const component = shallowWithRouter(<MonitorBarSeries {...props} />);
expect(component).toEqual({});
});

Expand All @@ -189,20 +188,20 @@ describe('MonitorBarSeries component', () => {
up: 0,
},
];
const component = shallowWithIntl(renderWithRouter(<MonitorBarSeries {...props} />));
const component = shallowWithRouter(<MonitorBarSeries {...props} />);
expect(component).toEqual({});
});

it('shallow renders nothing if the data series is null', () => {
const component = shallowWithIntl(
renderWithRouter(<MonitorBarSeries dangerColor="danger" histogramSeries={null} />)
const component = shallowWithRouter(
<MonitorBarSeries dangerColor="danger" histogramSeries={null} />
);
expect(component).toEqual({});
});

it('renders if the data series is present', () => {
const component = renderWithIntl(
renderWithRouter(<MonitorBarSeries dangerColor="danger" histogramSeries={histogramSeries} />)
const component = renderWithRouter(
<MonitorBarSeries dangerColor="danger" histogramSeries={histogramSeries} />
);
expect(component).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
*/

import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { FilterStatusButton, FilterStatusButtonProps } from '../filter_status_button';
import { renderWithRouter } from '../../../../lib/';
import { shallowWithRouter } from '../../../../lib/';

describe('FilterStatusButton', () => {
let props: FilterStatusButtonProps;
Expand All @@ -21,7 +20,7 @@ describe('FilterStatusButton', () => {
});

it('renders without errors for valid props', () => {
const wrapper = shallowWithIntl(renderWithRouter(<FilterStatusButton {...props} />));
const wrapper = shallowWithRouter(<FilterStatusButton {...props} />);
expect(wrapper).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 @@ -32,7 +32,6 @@ const EuiFlexItemTags = styled(EuiFlexItem)`
padding-top: 5px;
@media (max-width: 850px) {
order: 1;
text-align: center;
}
`;

Expand Down Expand Up @@ -80,14 +79,14 @@ export const LocationMap = ({ monitorLocations }: LocationMapProps) => {
<EuiFlexItemTags>
<LocationStatusTags locations={monitorLocations?.locations || []} />
</EuiFlexItemTags>
<EuiFlexItem grow={false}>
<EuiHideFor sizes={['xs']}>
<EuiHideFor sizes={['xs']}>
<EuiFlexItem grow={false}>
{isGeoInfoMissing && <LocationMissingWarning />}
<MapPanel>
<EmbeddedMap upPoints={upPoints} downPoints={downPoints} />
</MapPanel>
</EuiHideFor>
</EuiFlexItem>
</EuiFlexItem>
</EuiHideFor>
</FlexGroup>
</EuiErrorBoundary>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import React from 'react';
import { MonitorSummaryResult } from '../../../../../common/graphql/types';
import { MonitorListComponent } from '../monitor_list';
Expand Down Expand Up @@ -110,16 +110,14 @@ describe('MonitorList component', () => {
});

it('renders the monitor list', () => {
const component = renderWithIntl(
renderWithRouter(
<MonitorListComponent
dangerColor="danger"
data={{ monitorStates: result }}
hasActiveFilters={false}
loading={false}
successColor="primary"
/>
)
const component = renderWithRouter(
<MonitorListComponent
dangerColor="danger"
data={{ monitorStates: result }}
hasActiveFilters={false}
loading={false}
successColor="primary"
/>
);

expect(component).toMatchSnapshot();
Expand Down
Loading