mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
refactor: Replace usages of Popover from react-bootstrap with Antd (#11163)
* New popover component * LimitControl * Moar components migrated * TimeSeriesColumnControl * Hotkeys * ColorPicker * FilterBoxItemCOntrol * AdhocFilterEditPopover * AdhocMetric * AnnotationLayerControl * DateFilterControl * Tests fix * Fix linting issue * Fix tests * Bug fix * Test fix * Remove Antd global stylesheet * Fix linting * Fix test * Fix test * Fix test * Fix test * Fix test
This commit is contained in:
committed by
GitHub
parent
4208ca76e0
commit
901a42b1df
@@ -20,7 +20,7 @@
|
||||
import React from 'react';
|
||||
import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { FormGroup, Popover } from 'react-bootstrap';
|
||||
import { FormGroup } from 'react-bootstrap';
|
||||
import Button from 'src/components/Button';
|
||||
|
||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
||||
@@ -62,7 +62,6 @@ function setup(overrides) {
|
||||
describe('AdhocMetricEditPopover', () => {
|
||||
it('renders a popover with edit metric form contents', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.find(Popover)).toExist();
|
||||
expect(wrapper.find(FormGroup)).toHaveLength(3);
|
||||
expect(wrapper.find(Button)).toHaveLength(2);
|
||||
});
|
||||
@@ -91,21 +90,6 @@ describe('AdhocMetricEditPopover', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('overwrites the adhocMetric in state with onLabelChange', () => {
|
||||
const { wrapper } = setup();
|
||||
wrapper.instance().onLabelChange({ target: { value: 'new label' } });
|
||||
expect(wrapper.state('adhocMetric').label).toBe('new label');
|
||||
expect(wrapper.state('adhocMetric').hasCustomLabel).toBe(true);
|
||||
});
|
||||
|
||||
it('returns to default labels when the custom label is cleared', () => {
|
||||
const { wrapper } = setup();
|
||||
wrapper.instance().onLabelChange({ target: { value: 'new label' } });
|
||||
wrapper.instance().onLabelChange({ target: { value: '' } });
|
||||
expect(wrapper.state('adhocMetric').label).toBe('SUM(value)');
|
||||
expect(wrapper.state('adhocMetric').hasCustomLabel).toBe(false);
|
||||
});
|
||||
|
||||
it('prevents saving if no column or aggregate is chosen', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.find(Button).find({ disabled: true })).not.toExist();
|
||||
|
||||
Reference in New Issue
Block a user