diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap new file mode 100644 index 00000000000000..6f50b9eaea2bcb --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap @@ -0,0 +1,292 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should enable sort order select when sort field provided 1`] = ` + + + + + + + + + + + + + + + + + + + +`; + +exports[`should render top hits form when useTopHits is true 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + + +`; + +exports[`should render update source editor 1`] = ` + + + + + + + + + + + + + + + + + + + +`; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js index 552d6e8c9a3fd4..ea7594423e3514 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js +++ b/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js @@ -201,8 +201,8 @@ export class UpdateSourceEditor extends Component { ({})); + +import React from 'react'; +import { shallow } from 'enzyme'; + +import { UpdateSourceEditor } from './update_source_editor'; + +const defaultProps = { + indexPatternId: 'indexPattern1', + onChange: () => {}, + filterByMapBounds: true, + tooltipProperties: [], + sortOrder: 'DESC', + useTopHits: false, + topHitsSplitField: 'trackId', + topHitsSize: 1, +}; + +test('should render update source editor', async () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); +}); + +test('should enable sort order select when sort field provided', async () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); +}); + +test('should render top hits form when useTopHits is true', async () => { + const component = shallow( + + ); + + expect(component).toMatchSnapshot(); +});