mirror of
https://github.com/apache/superset.git
synced 2026-04-16 14:45:21 +00:00
test(frontend): use absolute path for src imports (#9761)
* test(frontend): use absolute path for src imports * Upgrade prettier, fix eslint
This commit is contained in:
@@ -24,11 +24,11 @@ import { shallow } from 'enzyme';
|
||||
import AdhocFilter, {
|
||||
EXPRESSION_TYPES,
|
||||
CLAUSES,
|
||||
} from '../../../../src/explore/AdhocFilter';
|
||||
import AdhocFilterControl from '../../../../src/explore/components/controls/AdhocFilterControl';
|
||||
import AdhocMetric from '../../../../src/explore/AdhocMetric';
|
||||
import { AGGREGATES, OPERATORS } from '../../../../src/explore/constants';
|
||||
import OnPasteSelect from '../../../../src/components/OnPasteSelect';
|
||||
} from 'src/explore/AdhocFilter';
|
||||
import AdhocFilterControl from 'src/explore/components/controls/AdhocFilterControl';
|
||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
||||
import { AGGREGATES, OPERATORS } from 'src/explore/constants';
|
||||
import OnPasteSelect from 'src/components/OnPasteSelect';
|
||||
|
||||
const simpleAdhocFilter = new AdhocFilter({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
|
||||
@@ -25,10 +25,10 @@ import { FormGroup } from 'react-bootstrap';
|
||||
import AdhocFilter, {
|
||||
EXPRESSION_TYPES,
|
||||
CLAUSES,
|
||||
} from '../../../../src/explore/AdhocFilter';
|
||||
import AdhocMetric from '../../../../src/explore/AdhocMetric';
|
||||
import AdhocFilterEditPopoverSimpleTabContent from '../../../../src/explore/components/AdhocFilterEditPopoverSimpleTabContent';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
} from 'src/explore/AdhocFilter';
|
||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
||||
import AdhocFilterEditPopoverSimpleTabContent from 'src/explore/components/AdhocFilterEditPopoverSimpleTabContent';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const simpleAdhocFilter = new AdhocFilter({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
|
||||
@@ -25,8 +25,8 @@ import { FormGroup } from 'react-bootstrap';
|
||||
import AdhocFilter, {
|
||||
EXPRESSION_TYPES,
|
||||
CLAUSES,
|
||||
} from '../../../../src/explore/AdhocFilter';
|
||||
import AdhocFilterEditPopoverSqlTabContent from '../../../../src/explore/components/AdhocFilterEditPopoverSqlTabContent';
|
||||
} from 'src/explore/AdhocFilter';
|
||||
import AdhocFilterEditPopoverSqlTabContent from 'src/explore/components/AdhocFilterEditPopoverSqlTabContent';
|
||||
|
||||
const sqlAdhocFilter = new AdhocFilter({
|
||||
expressionType: EXPRESSION_TYPES.SQL,
|
||||
|
||||
@@ -25,12 +25,12 @@ import { Button, Popover, Tab, Tabs } from 'react-bootstrap';
|
||||
import AdhocFilter, {
|
||||
EXPRESSION_TYPES,
|
||||
CLAUSES,
|
||||
} from '../../../../src/explore/AdhocFilter';
|
||||
import AdhocMetric from '../../../../src/explore/AdhocMetric';
|
||||
import AdhocFilterEditPopover from '../../../../src/explore/components/AdhocFilterEditPopover';
|
||||
import AdhocFilterEditPopoverSimpleTabContent from '../../../../src/explore/components/AdhocFilterEditPopoverSimpleTabContent';
|
||||
import AdhocFilterEditPopoverSqlTabContent from '../../../../src/explore/components/AdhocFilterEditPopoverSqlTabContent';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
} from 'src/explore/AdhocFilter';
|
||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
||||
import AdhocFilterEditPopover from 'src/explore/components/AdhocFilterEditPopover';
|
||||
import AdhocFilterEditPopoverSimpleTabContent from 'src/explore/components/AdhocFilterEditPopoverSimpleTabContent';
|
||||
import AdhocFilterEditPopoverSqlTabContent from 'src/explore/components/AdhocFilterEditPopoverSqlTabContent';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const simpleAdhocFilter = new AdhocFilter({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
|
||||
@@ -25,8 +25,8 @@ import { Label, OverlayTrigger } from 'react-bootstrap';
|
||||
import AdhocFilter, {
|
||||
EXPRESSION_TYPES,
|
||||
CLAUSES,
|
||||
} from '../../../../src/explore/AdhocFilter';
|
||||
import AdhocFilterOption from '../../../../src/explore/components/AdhocFilterOption';
|
||||
} from 'src/explore/AdhocFilter';
|
||||
import AdhocFilterOption from 'src/explore/components/AdhocFilterOption';
|
||||
|
||||
const simpleAdhocFilter = new AdhocFilter({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
|
||||
@@ -22,9 +22,9 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
|
||||
import AdhocMetric from '../../../../src/explore/AdhocMetric';
|
||||
import AdhocMetricEditPopoverTitle from '../../../../src/explore/components/AdhocMetricEditPopoverTitle';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
||||
import AdhocMetricEditPopoverTitle from 'src/explore/components/AdhocMetricEditPopoverTitle';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const columns = [
|
||||
{ type: 'VARCHAR(255)', column_name: 'source' },
|
||||
@@ -52,12 +52,9 @@ describe('AdhocMetricEditPopoverTitle', () => {
|
||||
it('renders an OverlayTrigger wrapper with the title', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.find(OverlayTrigger)).toHaveLength(1);
|
||||
expect(
|
||||
wrapper
|
||||
.find(OverlayTrigger)
|
||||
.find('span')
|
||||
.text(),
|
||||
).toBe('My Metric\xa0');
|
||||
expect(wrapper.find(OverlayTrigger).find('span').text()).toBe(
|
||||
'My Metric\xa0',
|
||||
);
|
||||
});
|
||||
|
||||
it('transfers to edit mode when clicked', () => {
|
||||
|
||||
@@ -22,11 +22,9 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Button, FormGroup, Popover } from 'react-bootstrap';
|
||||
|
||||
import AdhocMetric, {
|
||||
EXPRESSION_TYPES,
|
||||
} from '../../../../src/explore/AdhocMetric';
|
||||
import AdhocMetricEditPopover from '../../../../src/explore/components/AdhocMetricEditPopover';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
||||
import AdhocMetricEditPopover from 'src/explore/components/AdhocMetricEditPopover';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const columns = [
|
||||
{ type: 'VARCHAR(255)', column_name: 'source' },
|
||||
|
||||
@@ -22,9 +22,9 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Label, OverlayTrigger } from 'react-bootstrap';
|
||||
|
||||
import AdhocMetric from '../../../../src/explore/AdhocMetric';
|
||||
import AdhocMetricOption from '../../../../src/explore/components/AdhocMetricOption';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
||||
import AdhocMetricOption from 'src/explore/components/AdhocMetricOption';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const columns = [
|
||||
{ type: 'VARCHAR(255)', column_name: 'source' },
|
||||
|
||||
@@ -20,11 +20,9 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import AdhocMetricStaticOption from '../../../../src/explore/components/AdhocMetricStaticOption';
|
||||
import AdhocMetric, {
|
||||
EXPRESSION_TYPES,
|
||||
} from '../../../../src/explore/AdhocMetric';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import AdhocMetricStaticOption from 'src/explore/components/AdhocMetricStaticOption';
|
||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const sumValueAdhocMetric = new AdhocMetric({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import AggregateOption from '../../../../src/explore/components/AggregateOption';
|
||||
import AggregateOption from 'src/explore/components/AggregateOption';
|
||||
|
||||
describe('AggregateOption', () => {
|
||||
it('renders the aggregate', () => {
|
||||
|
||||
@@ -22,7 +22,7 @@ import { FormControl } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import BoundsControl from '../../../../src/explore/components/controls/BoundsControl';
|
||||
import BoundsControl from 'src/explore/components/controls/BoundsControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'y_axis_bounds',
|
||||
|
||||
@@ -21,9 +21,9 @@ import React from 'react';
|
||||
import sinon from 'sinon';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
|
||||
import CheckboxControl from '../../../../src/explore/components/controls/CheckboxControl';
|
||||
import ControlHeader from '../../../../src/explore/components/ControlHeader';
|
||||
import Checkbox from '../../../../src/components/Checkbox';
|
||||
import CheckboxControl from 'src/explore/components/controls/CheckboxControl';
|
||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||
import Checkbox from 'src/components/Checkbox';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'show_legend',
|
||||
@@ -54,10 +54,7 @@ describe('CheckboxControl', () => {
|
||||
|
||||
fullComponent.instance().forceUpdate();
|
||||
|
||||
fullComponent
|
||||
.find('label span')
|
||||
.last()
|
||||
.simulate('click');
|
||||
fullComponent.find('label span').last().simulate('click');
|
||||
|
||||
expect(spy.calledOnce).toBe(true);
|
||||
});
|
||||
|
||||
@@ -26,8 +26,8 @@ import {
|
||||
getCategoricalSchemeRegistry,
|
||||
} from '@superset-ui/color';
|
||||
|
||||
import ColorPickerControl from '../../../../src/explore/components/controls/ColorPickerControl';
|
||||
import ControlHeader from '../../../../src/explore/components/ControlHeader';
|
||||
import ColorPickerControl from 'src/explore/components/controls/ColorPickerControl';
|
||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||
|
||||
const defaultProps = {
|
||||
value: {},
|
||||
|
||||
@@ -22,7 +22,7 @@ import { mount } from 'enzyme';
|
||||
import { Creatable } from 'react-select';
|
||||
import { getCategoricalSchemeRegistry } from '@superset-ui/color';
|
||||
|
||||
import ColorSchemeControl from '../../../../src/explore/components/controls/ColorSchemeControl';
|
||||
import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl';
|
||||
|
||||
const defaultProps = {
|
||||
options: getCategoricalSchemeRegistry()
|
||||
|
||||
@@ -20,9 +20,9 @@ import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Panel } from 'react-bootstrap';
|
||||
|
||||
import InfoTooltipWithTrigger from '../../../../src/components/InfoTooltipWithTrigger';
|
||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
||||
|
||||
import ControlPanelSection from '../../../../src/explore/components/ControlPanelSection';
|
||||
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
|
||||
|
||||
const defaultProps = {
|
||||
children: <div>a child element</div>,
|
||||
@@ -55,20 +55,12 @@ describe('ControlPanelSection', () => {
|
||||
});
|
||||
|
||||
it('renders a label if present', () => {
|
||||
expect(
|
||||
wrapper
|
||||
.find(Panel.Title)
|
||||
.dive()
|
||||
.text(),
|
||||
).toContain('my label');
|
||||
expect(wrapper.find(Panel.Title).dive().text()).toContain('my label');
|
||||
});
|
||||
|
||||
it('renders a InfoTooltipWithTrigger if label and tooltip is present', () => {
|
||||
expect(
|
||||
wrapper
|
||||
.find(Panel)
|
||||
.dive()
|
||||
.find(InfoTooltipWithTrigger),
|
||||
wrapper.find(Panel).dive().find(InfoTooltipWithTrigger),
|
||||
).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import ControlSetRow from '../../../../src/explore/components/ControlRow';
|
||||
import ControlSetRow from 'src/explore/components/ControlRow';
|
||||
|
||||
describe('ControlSetRow', () => {
|
||||
it('renders a single row with one element', () => {
|
||||
|
||||
@@ -21,9 +21,9 @@ import sinon from 'sinon';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { shallow } from 'enzyme';
|
||||
import { MenuItem } from 'react-bootstrap';
|
||||
import DatasourceModal from '../../../../src/datasource/DatasourceModal';
|
||||
import ChangeDatasourceModal from '../../../../src/datasource/ChangeDatasourceModal';
|
||||
import DatasourceControl from '../../../../src/explore/components/controls/DatasourceControl';
|
||||
import DatasourceModal from 'src/datasource/DatasourceModal';
|
||||
import ChangeDatasourceModal from 'src/datasource/ChangeDatasourceModal';
|
||||
import DatasourceControl from 'src/explore/components/controls/DatasourceControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'datasource',
|
||||
@@ -70,22 +70,16 @@ describe('DatasourceControl', () => {
|
||||
it('show or hide Edit Datasource option', () => {
|
||||
let wrapper = setup();
|
||||
expect(wrapper.find('#datasource_menu')).toHaveLength(1);
|
||||
expect(
|
||||
wrapper
|
||||
.find('#datasource_menu')
|
||||
.dive()
|
||||
.find(MenuItem),
|
||||
).toHaveLength(2);
|
||||
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
|
||||
2,
|
||||
);
|
||||
|
||||
wrapper = setup({
|
||||
onDatasourceSave: () => {},
|
||||
});
|
||||
expect(wrapper.find('#datasource_menu')).toHaveLength(1);
|
||||
expect(
|
||||
wrapper
|
||||
.find('#datasource_menu')
|
||||
.dive()
|
||||
.find(MenuItem),
|
||||
).toHaveLength(3);
|
||||
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
|
||||
3,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,8 +22,8 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Button, Label } from 'react-bootstrap';
|
||||
|
||||
import DateFilterControl from '../../../../src/explore/components/controls/DateFilterControl';
|
||||
import ControlHeader from '../../../../src/explore/components/ControlHeader';
|
||||
import DateFilterControl from 'src/explore/components/controls/DateFilterControl';
|
||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||
|
||||
const defaultProps = {
|
||||
animation: false,
|
||||
@@ -70,9 +70,7 @@ describe('DateFilterControl', () => {
|
||||
label.simulate('click');
|
||||
setTimeout(() => {
|
||||
expect(wrapper.find('.popover')).toHaveLength(1);
|
||||
expect(wrapper.find('.ok'))
|
||||
.first()
|
||||
.simulate('click');
|
||||
expect(wrapper.find('.ok')).first().simulate('click');
|
||||
setTimeout(() => {
|
||||
expect(wrapper.find('.popover')).toHaveLength(0);
|
||||
}, 10);
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import ModalTrigger from './../../../../src/components/ModalTrigger';
|
||||
|
||||
import { DisplayQueryButton } from '../../../../src/explore/components/DisplayQueryButton';
|
||||
import { DisplayQueryButton } from 'src/explore/components/DisplayQueryButton';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
|
||||
describe('DisplayQueryButton', () => {
|
||||
const defaultProps = {
|
||||
|
||||
@@ -21,8 +21,8 @@ import { shallow, mount } from 'enzyme';
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import EmbedCodeButton from '../../../../src/explore/components/EmbedCodeButton';
|
||||
import * as exploreUtils from '../../../../src/explore/exploreUtils';
|
||||
import EmbedCodeButton from 'src/explore/components/EmbedCodeButton';
|
||||
import * as exploreUtils from 'src/explore/exploreUtils';
|
||||
|
||||
describe('EmbedCodeButton', () => {
|
||||
const defaultProps = {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import ExploreActionButtons from '../../../../src/explore/components/ExploreActionButtons';
|
||||
import ExploreActionButtons from 'src/explore/components/ExploreActionButtons';
|
||||
|
||||
describe('ExploreActionButtons', () => {
|
||||
const defaultProps = {
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { ExploreChartHeader } from '../../../../src/explore/components/ExploreChartHeader';
|
||||
import ExploreActionButtons from '../../../../src/explore/components/ExploreActionButtons';
|
||||
import EditableTitle from '../../../../src/components/EditableTitle';
|
||||
import { ExploreChartHeader } from 'src/explore/components/ExploreChartHeader';
|
||||
import ExploreActionButtons from 'src/explore/components/ExploreActionButtons';
|
||||
import EditableTitle from 'src/components/EditableTitle';
|
||||
|
||||
const stub = jest.fn(() => ({
|
||||
then: () => {},
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
|
||||
import ChartContainer from '../../../../src/explore/components/ExploreChartPanel';
|
||||
import ChartContainer from 'src/explore/components/ExploreChartPanel';
|
||||
|
||||
describe('ChartContainer', () => {
|
||||
const mockProps = {
|
||||
|
||||
@@ -22,8 +22,8 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
|
||||
import FilterBoxItemControl from '../../../../src/explore/components/controls/FilterBoxItemControl';
|
||||
import FormRow from '../../../../src/components/FormRow';
|
||||
import FilterBoxItemControl from 'src/explore/components/controls/FilterBoxItemControl';
|
||||
import FormRow from 'src/components/FormRow';
|
||||
import datasources from '../../../fixtures/mockDatasource';
|
||||
|
||||
const defaultProps = {
|
||||
|
||||
@@ -20,13 +20,11 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import FilterDefinitionOption from '../../../../src/explore/components/FilterDefinitionOption';
|
||||
import ColumnOption from '../../../../src/components/ColumnOption';
|
||||
import AdhocMetricStaticOption from '../../../../src/explore/components/AdhocMetricStaticOption';
|
||||
import AdhocMetric, {
|
||||
EXPRESSION_TYPES,
|
||||
} from '../../../../src/explore/AdhocMetric';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import FilterDefinitionOption from 'src/explore/components/FilterDefinitionOption';
|
||||
import ColumnOption from 'src/components/ColumnOption';
|
||||
import AdhocMetricStaticOption from 'src/explore/components/AdhocMetricStaticOption';
|
||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const sumValueAdhocMetric = new AdhocMetric({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import FixedOrMetricControl from '../../../../src/explore/components/controls/FixedOrMetricControl';
|
||||
import TextControl from '../../../../src/explore/components/controls/TextControl';
|
||||
import MetricsControl from '../../../../src/explore/components/controls/MetricsControl';
|
||||
import FixedOrMetricControl from 'src/explore/components/controls/FixedOrMetricControl';
|
||||
import TextControl from 'src/explore/components/controls/TextControl';
|
||||
import MetricsControl from 'src/explore/components/controls/MetricsControl';
|
||||
|
||||
const defaultProps = {
|
||||
value: {},
|
||||
|
||||
@@ -20,10 +20,10 @@ import React from 'react';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import MetricDefinitionOption from '../../../../src/explore/components/MetricDefinitionOption';
|
||||
import MetricOption from '../../../../src/components/MetricOption';
|
||||
import ColumnOption from '../../../../src/components/ColumnOption';
|
||||
import AggregateOption from '../../../../src/explore/components/AggregateOption';
|
||||
import MetricDefinitionOption from 'src/explore/components/MetricDefinitionOption';
|
||||
import MetricOption from 'src/components/MetricOption';
|
||||
import ColumnOption from 'src/components/ColumnOption';
|
||||
import AggregateOption from 'src/explore/components/AggregateOption';
|
||||
|
||||
describe('MetricDefinitionOption', () => {
|
||||
const mockStore = configureStore([]);
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import MetricDefinitionValue from '../../../../src/explore/components/MetricDefinitionValue';
|
||||
import MetricOption from '../../../../src/components/MetricOption';
|
||||
import AdhocMetricOption from '../../../../src/explore/components/AdhocMetricOption';
|
||||
import AdhocMetric from '../../../../src/explore/AdhocMetric';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import MetricDefinitionValue from 'src/explore/components/MetricDefinitionValue';
|
||||
import MetricOption from 'src/components/MetricOption';
|
||||
import AdhocMetricOption from 'src/explore/components/AdhocMetricOption';
|
||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const sumValueAdhocMetric = new AdhocMetric({
|
||||
column: { type: 'DOUBLE', column_name: 'value' },
|
||||
|
||||
@@ -21,12 +21,10 @@ import React from 'react';
|
||||
import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import MetricsControl from '../../../../src/explore/components/controls/MetricsControl';
|
||||
import { AGGREGATES } from '../../../../src/explore/constants';
|
||||
import OnPasteSelect from '../../../../src/components/OnPasteSelect';
|
||||
import AdhocMetric, {
|
||||
EXPRESSION_TYPES,
|
||||
} from '../../../../src/explore/AdhocMetric';
|
||||
import MetricsControl from 'src/explore/components/controls/MetricsControl';
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
import OnPasteSelect from 'src/components/OnPasteSelect';
|
||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'metrics',
|
||||
|
||||
@@ -20,8 +20,8 @@ import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import QueryAndSaveButtons from '../../../../src/explore/components/QueryAndSaveBtns';
|
||||
import Button from '../../../../src/components/Button';
|
||||
import QueryAndSaveButtons from 'src/explore/components/QueryAndSaveBtns';
|
||||
import Button from 'src/components/Button';
|
||||
|
||||
describe('QueryAndSaveButtons', () => {
|
||||
const defaultProps = {
|
||||
|
||||
@@ -20,9 +20,8 @@ import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Label } from 'react-bootstrap';
|
||||
|
||||
import TooltipWrapper from './../../../../src/components/TooltipWrapper';
|
||||
|
||||
import RowCountLabel from '../../../../src/explore/components/RowCountLabel';
|
||||
import TooltipWrapper from 'src/components/TooltipWrapper';
|
||||
import RowCountLabel from 'src/explore/components/RowCountLabel';
|
||||
|
||||
describe('RowCountLabel', () => {
|
||||
const defaultProps = {
|
||||
@@ -46,11 +45,6 @@ describe('RowCountLabel', () => {
|
||||
limit: 100,
|
||||
};
|
||||
const wrapper = shallow(<RowCountLabel {...props} />);
|
||||
expect(
|
||||
wrapper
|
||||
.find(Label)
|
||||
.first()
|
||||
.props().bsStyle,
|
||||
).toBe('danger');
|
||||
expect(wrapper.find(Label).first().props().bsStyle).toBe('danger');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import RunQueryActionButton from '../../../../src/SqlLab/components/RunQueryActionButton';
|
||||
import Button from '../../../../src/components/Button';
|
||||
import RunQueryActionButton from 'src/SqlLab/components/RunQueryActionButton';
|
||||
import Button from 'src/components/Button';
|
||||
|
||||
describe('RunQueryActionButton', () => {
|
||||
let wrapper;
|
||||
|
||||
@@ -26,9 +26,9 @@ import { Modal, Button, Radio } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import fetchMock from 'fetch-mock';
|
||||
|
||||
import * as exploreUtils from '../../../../src/explore/exploreUtils';
|
||||
import * as saveModalActions from '../../../../src/explore/actions/saveModalActions';
|
||||
import SaveModal from '../../../../src/explore/components/SaveModal';
|
||||
import * as exploreUtils from 'src/explore/exploreUtils';
|
||||
import * as saveModalActions from 'src/explore/actions/saveModalActions';
|
||||
import SaveModal from 'src/explore/components/SaveModal';
|
||||
|
||||
describe('SaveModal', () => {
|
||||
const middlewares = [thunk];
|
||||
|
||||
@@ -22,9 +22,9 @@ import Select, { Creatable } from 'react-select';
|
||||
import VirtualizedSelect from 'react-virtualized-select';
|
||||
import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import OnPasteSelect from '../../../../src/components/OnPasteSelect';
|
||||
import VirtualizedRendererWrap from '../../../../src/components/VirtualizedRendererWrap';
|
||||
import SelectControl from '../../../../src/explore/components/controls/SelectControl';
|
||||
import OnPasteSelect from 'src/components/OnPasteSelect';
|
||||
import VirtualizedRendererWrap from 'src/components/VirtualizedRendererWrap';
|
||||
import SelectControl from 'src/explore/components/controls/SelectControl';
|
||||
|
||||
const defaultProps = {
|
||||
choices: [
|
||||
|
||||
@@ -23,7 +23,7 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import AceEditor from 'react-ace';
|
||||
|
||||
import TextAreaControl from '../../../../src/explore/components/controls/TextAreaControl';
|
||||
import TextAreaControl from 'src/explore/components/controls/TextAreaControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'x_axis_label',
|
||||
|
||||
@@ -22,7 +22,7 @@ import { FormControl, OverlayTrigger } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import TimeSeriesColumnControl from '../../../../src/explore/components/controls/TimeSeriesColumnControl';
|
||||
import TimeSeriesColumnControl from 'src/explore/components/controls/TimeSeriesColumnControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'x_axis_label',
|
||||
|
||||
@@ -21,9 +21,9 @@ import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger, Label } from 'react-bootstrap';
|
||||
|
||||
import ViewportControl from '../../../../src/explore/components/controls/ViewportControl';
|
||||
import TextControl from '../../../../src/explore/components/controls/TextControl';
|
||||
import ControlHeader from '../../../../src/explore/components/ControlHeader';
|
||||
import ViewportControl from 'src/explore/components/controls/ViewportControl';
|
||||
import TextControl from 'src/explore/components/controls/TextControl';
|
||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||
|
||||
const defaultProps = {
|
||||
value: {
|
||||
@@ -55,12 +55,8 @@ describe('ViewportControl', () => {
|
||||
});
|
||||
|
||||
it('renders a summary in the label', () => {
|
||||
expect(
|
||||
wrapper
|
||||
.find(Label)
|
||||
.first()
|
||||
.render()
|
||||
.text(),
|
||||
).toBe('6° 51\' 8.50" | 31° 13\' 21.56"');
|
||||
expect(wrapper.find(Label).first().render().text()).toBe(
|
||||
'6° 51\' 8.50" | 31° 13\' 21.56"',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Modal } from 'react-bootstrap';
|
||||
import { getChartMetadataRegistry, ChartMetadata } from '@superset-ui/chart';
|
||||
import VizTypeControl from '../../../../src/explore/components/controls/VizTypeControl';
|
||||
import VizTypeControl from 'src/explore/components/controls/VizTypeControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'viz_type',
|
||||
|
||||
@@ -21,8 +21,8 @@ import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
import fetchMock from 'fetch-mock';
|
||||
|
||||
import MetricsControl from '../../../../src/explore/components/controls/MetricsControl';
|
||||
import withVerification from '../../../../src/explore/components/controls/withVerification';
|
||||
import MetricsControl from 'src/explore/components/controls/MetricsControl';
|
||||
import withVerification from 'src/explore/components/controls/withVerification';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'metrics',
|
||||
|
||||
Reference in New Issue
Block a user