Skip to content

Commit

Permalink
fix EsSearchSource update editor jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Mar 14, 2020
1 parent ff8129b commit 08b0fb4
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 21 deletions.

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 @@ -16,14 +16,15 @@ import React from 'react';
import { shallow } from 'enzyme';

import { UpdateSourceEditor } from './update_source_editor';
import { SCALING_TYPES } from '../../../../common/constants';

const defaultProps = {
indexPatternId: 'indexPattern1',
onChange: () => {},
filterByMapBounds: true,
tooltipFields: [],
sortOrder: 'DESC',
useTopHits: false,
scalingType: SCALING_TYPES.LIMIT,
topHitsSplitField: 'trackId',
topHitsSize: 1,
};
Expand All @@ -40,8 +41,10 @@ test('should enable sort order select when sort field provided', async () => {
expect(component).toMatchSnapshot();
});

test('should render top hits form when useTopHits is true', async () => {
const component = shallow(<UpdateSourceEditor {...defaultProps} useTopHits={true} />);
test('should render top hits form when scaling type is TOP_HITS', async () => {
const component = shallow(
<UpdateSourceEditor {...defaultProps} scalingType={SCALING_TYPES.TOP_HITS} />
);

expect(component).toMatchSnapshot();
});

0 comments on commit 08b0fb4

Please sign in to comment.