[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:
Tom Hunter
2019-07-29 19:53:52 -04:00
committed by Maxime Beauchemin
parent 06d547fbac
commit b7b517a102
6 changed files with 79 additions and 71 deletions

View File

@@ -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);
});
});