mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[fix] bug on FixedOrMetricControl component causing issues with deck.gl polygon height + deck.gl scatter radius controls (#7924)
* [WIP] bug fix for FixedOrMetricControl not rendering * Updated value preview and type selection * fix metric control not on setting polygon elevation data * Updated layout of FoM comp * linting fixes * linting fix pt. 2 * linting fix pt. 3 * fix scatter tooltip to work with metric control * Fixed tests
This commit is contained in:
committed by
Maxime Beauchemin
parent
06d547fbac
commit
b7b517a102
@@ -19,7 +19,6 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
|
||||
import FixedOrMetricControl from
|
||||
'../../../../src/explore/components/controls/FixedOrMetricControl';
|
||||
@@ -27,29 +26,21 @@ import TextControl from
|
||||
'../../../../src/explore/components/controls/TextControl';
|
||||
import MetricsControl from
|
||||
'../../../../src/explore/components/controls/MetricsControl';
|
||||
import ControlHeader from '../../../../src/explore/components/ControlHeader';
|
||||
|
||||
const defaultProps = {
|
||||
value: { },
|
||||
datasource: { },
|
||||
};
|
||||
|
||||
describe('FixedOrMetricControl', () => {
|
||||
let wrapper;
|
||||
let inst;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<FixedOrMetricControl {...defaultProps} />);
|
||||
inst = wrapper.instance();
|
||||
});
|
||||
|
||||
it('renders a OverlayTrigger', () => {
|
||||
const controlHeader = wrapper.find(ControlHeader);
|
||||
expect(controlHeader).toHaveLength(1);
|
||||
expect(wrapper.find(OverlayTrigger)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('renders a TextControl and a SelectControl', () => {
|
||||
const popOver = shallow(inst.renderPopover());
|
||||
expect(popOver.find(TextControl)).toHaveLength(1);
|
||||
expect(popOver.find(MetricsControl)).toHaveLength(1);
|
||||
expect(wrapper.find(TextControl)).toHaveLength(1);
|
||||
expect(wrapper.find(MetricsControl)).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user