-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [Maps] fix unable to edit heatmap metric (#70606) * [Maps] fix unable to edit heatmap metric * add comment Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.js # x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.js * fix import
- Loading branch information
Showing
5 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
x-pack/plugins/maps/public/components/__snapshots__/metrics_editor.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/maps/public/components/metrics_editor.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { MetricsEditor } from './metrics_editor'; | ||
import { AGG_TYPE } from '../../common/constants'; | ||
|
||
const defaultProps = { | ||
metrics: [ | ||
{ | ||
type: AGG_TYPE.SUM, | ||
field: 'myField', | ||
}, | ||
], | ||
fields: [], | ||
onChange: () => {}, | ||
allowMultipleMetrics: true, | ||
metricsFilter: () => {}, | ||
}; | ||
|
||
test('should render metrics editor', async () => { | ||
const component = shallow(<MetricsEditor {...defaultProps} />); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('should add default count metric when metrics is empty array', async () => { | ||
const component = shallow(<MetricsEditor {...defaultProps} metrics={[]} />); | ||
expect(component).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters