mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
[js-testing] more tests for SelectControl (#2877)
* rename spec folder * remove special handling for viz_type control since it now uses VizTypeControl * add test for getOptions * linting * add test for cwp * linting
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import { getFormDataFromControls, defaultControls }
|
||||
from '../../../../javascripts/explore/stores/store';
|
||||
import {
|
||||
ControlPanelsContainer,
|
||||
} from '../../../../javascripts/explore/components/ControlPanelsContainer';
|
||||
import ControlPanelSection from '../../../../javascripts/explore/components/ControlPanelSection';
|
||||
|
||||
const defaultProps = {
|
||||
datasource_type: 'table',
|
||||
actions: {},
|
||||
controls: defaultControls,
|
||||
form_data: getFormDataFromControls(defaultControls),
|
||||
isDatasourceMetaLoading: false,
|
||||
exploreState: {},
|
||||
};
|
||||
|
||||
describe('ControlPanelsContainer', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<ControlPanelsContainer {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders ControlPanelSections', () => {
|
||||
expect(wrapper.find(ControlPanelSection)).to.have.lengthOf(7);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user