Skip to content

Commit

Permalink
fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Feb 4, 2020
1 parent 5de2432 commit 8c59a1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
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 @@ -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
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/uptime/public/pages/monitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MonitorCharts, PingList } from '../components/functional';
import { UptimeRefreshContext, UptimeThemeContext } from '../contexts';
import { useUptimeTelemetry, useUrlParams, UptimePage } from '../hooks';
import { useTrackPageview } from '../../../infra/public';
import { MonitorStatusDetails } from '../components/functional/monitor_status_details';
import { MonitorStatusDetails } from '../components/connected';

export const MonitorPage = () => {
// decode 64 base string, it was decoded to make it a valid url, since monitor id can be a url
Expand Down

0 comments on commit 8c59a1c

Please sign in to comment.