Skip to content

Commit

Permalink
remove code
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Jan 6, 2020
1 parent b198ef0 commit f2093d3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ describe('MonitorListDrawer component', () => {
let summary: MonitorSummary;
let loadMonitorDetails: any;
let monitorDetails: MonitorDetails;
let filters: Map<string, string[]>;

beforeEach(() => {
summary = {
Expand Down Expand Up @@ -48,8 +47,6 @@ describe('MonitorListDrawer component', () => {
'Get https://expired.badssl.com: x509: certificate has expired or is not yet valid',
},
};
filters = new Map();
filters.set('observer.geo.name', ['Tokyo', 'Berlin', 'NY']);
loadMonitorDetails = () => null;
});

Expand All @@ -59,7 +56,6 @@ describe('MonitorListDrawer component', () => {
loadMonitorDetails={loadMonitorDetails}
summary={summary}
monitorDetails={monitorDetails}
filters={filters}
/>
);
expect(component).toEqual({});
Expand All @@ -72,7 +68,6 @@ describe('MonitorListDrawer component', () => {
summary={summary}
loadMonitorDetails={loadMonitorDetails}
monitorDetails={monitorDetails}
filters={filters}
/>
);
expect(component).toEqual({});
Expand All @@ -84,7 +79,6 @@ describe('MonitorListDrawer component', () => {
summary={summary}
loadMonitorDetails={loadMonitorDetails}
monitorDetails={monitorDetails}
filters={filters}
/>
);
expect(component).toMatchSnapshot();
Expand Down Expand Up @@ -120,7 +114,6 @@ describe('MonitorListDrawer component', () => {
summary={summary}
loadMonitorDetails={loadMonitorDetails}
monitorDetails={monitorDetails}
filters={filters}
/>
);
expect(component).toMatchSnapshot();
Expand Down
3 changes: 1 addition & 2 deletions x-pack/legacy/plugins/uptime/public/state/effects/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ import { getBasePath } from '../selectors';
import { MonitorDetailsActionPayload } from '../actions/types';

function* monitorDetailsEffect(action: Action<any>) {
const { monitorId, dateStart, dateEnd, location }: MonitorDetailsActionPayload = action.payload;
const { monitorId, dateStart, dateEnd }: MonitorDetailsActionPayload = action.payload;
try {
const basePath = yield select(getBasePath);
const response = yield call(fetchMonitorDetails, {
monitorId,
basePath,
dateStart,
dateEnd,
location,
});
yield put({ type: FETCH_MONITOR_DETAILS_SUCCESS, payload: response });
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import {
setBasePath,
toggleIntegrationsPopover,
triggerAppRefresh,
setFilters,
} from '../../actions';
import { setBasePath, toggleIntegrationsPopover, triggerAppRefresh } from '../../actions';
import { uiReducer } from '../ui';
import { Action } from 'redux-actions';

Expand All @@ -22,7 +17,6 @@ describe('ui reducer', () => {
basePath: 'abc',
integrationsPopoverOpen: null,
lastRefresh: 125,
filters: new Map([['observer.geo.name', ['Tokyo', 'London', 'Karachi']]]),
},
action
)
Expand All @@ -40,7 +34,6 @@ describe('ui reducer', () => {
basePath: '',
integrationsPopoverOpen: null,
lastRefresh: 125,
filters: new Map([['observer.geo.name', ['Tokyo', 'London', 'Karachi']]]),
},
action
)
Expand All @@ -55,24 +48,6 @@ describe('ui reducer', () => {
basePath: 'abc',
integrationsPopoverOpen: null,
lastRefresh: 125,
filters: new Map([['observer.geo.name', ['Tokyo', 'London', 'Karachi']]]),
},
action
)
).toMatchSnapshot();
});

it('updates the filter value', () => {
const action = setFilters(
new Map([['observer.geo.name', ['Tokyo', 'London', 'Karachi']]])
) as Action<never>;
expect(
uiReducer(
{
basePath: '',
integrationsPopoverOpen: null,
lastRefresh: 125,
filters: new Map([['observer.geo.name', ['Tokyo', 'London']]]),
},
action
)
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 { getBasePath, isIntegrationsPopupOpen, getFilters } from '../index';
import { getBasePath, isIntegrationsPopupOpen } from '../index';
import { AppState } from '../../../state';

describe('state selectors', () => {
Expand All @@ -29,7 +29,6 @@ describe('state selectors', () => {
basePath: 'yyz',
integrationsPopoverOpen: null,
lastRefresh: 125,
filters: new Map([['observer.geo.name', ['Tokyo', 'London', 'Karachi']]]),
},
};

Expand All @@ -45,10 +44,4 @@ describe('state selectors', () => {
state.ui.integrationsPopoverOpen = integrationsPopupOpen;
expect(isIntegrationsPopupOpen(state)).toBe(integrationsPopupOpen);
});

it('get filter from ui state', () => {
const filters = new Map([['observer.geo.name', ['Tokyo', 'London', 'Karachi']]]);
state.ui.filters = filters;
expect(getFilters(state)).toBe(filters);
});
});

0 comments on commit f2093d3

Please sign in to comment.