-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] fix unable to edit heatmap metric (#70606)
* [Maps] fix unable to edit heatmap metric * add comment Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
fd307a0
commit e774921
Showing
6 changed files
with
132 additions
and
7 deletions.
There are no files selected for viewing
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
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
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(); | ||
}); |