Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
add chart and ad result css file; fix some ut (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylwu-amzn authored Apr 30, 2020
1 parent aee03e8 commit 5a0b940
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions public/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
@import 'pages/createDetector/index.scss';
@import 'pages/Dashboard/index.scss';
@import 'pages/DetectorConfig/index.scss';
@import 'pages/AnomalyCharts/index.scss';
@import 'pages/DetectorResults/index.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
mockedStore,
} from '../../../../../redux/utils/testUtils';
import { FeaturesFormikValues } from '../../../containers/utils/formikToFeatures';
import { INITIAL_VALUES } from '../../../containers/utils/constants';
import { INITIAL_VALUES } from '../../../utils/constants';

const renderAggregationSelector = (initialValue: FeaturesFormikValues) => ({
...render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Provider } from 'react-redux';
import { mockedStore } from '../../../../../redux/utils/testUtils';
import { Formik } from 'formik';
import { FeaturesFormikValues } from '../../../../EditFeatures/containers/utils/formikToFeatures';
import { INITIAL_VALUES } from '../../../../EditFeatures/containers/utils/constants';
import { INITIAL_VALUES } from '../../../../EditFeatures/utils/constants';

const renderWithFormik = (initialValue: FeaturesFormikValues) => ({
...render(
Expand Down
5 changes: 4 additions & 1 deletion public/redux/reducers/__tests__/ad.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import reducer, {
updateDetector,
} from '../ad';
import { getRandomDetector } from './utils';
import { get } from 'lodash';

describe('detector reducer actions', () => {
let store: MockStore;
Expand Down Expand Up @@ -197,13 +198,15 @@ describe('detector reducer actions', () => {
requesting: true,
});
expect(actions[1].type).toBe('ad/UPDATE_DETECTOR_SUCCESS');
expect(reducer(initialDetectorsState, actions[1])).toEqual({
const result = reducer(initialDetectorsState, actions[1]);
expect(result).toEqual({
...initialDetectorsState,
requesting: false,
detectors: {
[detectorId]: {
...randomDetector,
id: detectorId,
lastUpdateTime: get(result, `detectors.${detectorId}.lastUpdateTime`)
},
},
});
Expand Down
1 change: 1 addition & 0 deletions public/redux/reducers/__tests__/anomalyResults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('elasticsearch reducer actions', () => {
requesting: false,
total: response.totalAnomalies,
anomalies: response.results,
"featureData": undefined,
});
expect(httpMockedClient.get).toHaveBeenCalledWith(
`..${AD_NODE_API.DETECTOR}/${tempDetectorId}/results`,
Expand Down
1 change: 0 additions & 1 deletion public/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { ALERTING_PLUGIN_NAME, NAME_REGEX } from './constants';
import { MAX_FEATURE_NAME_SIZE } from './constants';

export const validateName = (featureName: string): string | undefined => {
debugger;
if (isEmpty(featureName)) {
return 'Required';
}
Expand Down

0 comments on commit 5a0b940

Please sign in to comment.