mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
[WiP] rename project from Caravel to Superset (#1576)
* Change in files * Renamin files and folders * cleaning up a single piece of lint * Removing boat picture from docs * add superset word mark * Update rename note in docs * Fixing images * Pinning datatables * Fixing issues with mapbox-gl * Forgot to rename one file * Linting * v0.13.0 * adding pyyaml to dev-reqs
This commit is contained in:
committed by
GitHub
parent
973537fd9a
commit
15b67b2c6c
@@ -0,0 +1,22 @@
|
||||
// this test must be commented out because ChartContainer is now importing files
|
||||
// from visualizations/*.js which are also importing css files which breaks in the testing env
|
||||
|
||||
// import React from 'react';
|
||||
// import { expect } from 'chai';
|
||||
// import { describe, it } from 'mocha';
|
||||
|
||||
// import ChartContainer from '../../../../javascripts/explorev2/components/ChartContainer';
|
||||
|
||||
// describe('ChartContainer', () => {
|
||||
// const mockProps = {
|
||||
// sliceName: 'Trend Line',
|
||||
// vizType: 'line',
|
||||
// height: '500px',
|
||||
// };
|
||||
|
||||
// it('renders when vizType is line', () => {
|
||||
// expect(
|
||||
// React.isValidElement(<ChartContainer {...mockProps} />)
|
||||
// ).to.equal(true);
|
||||
// });
|
||||
// });
|
||||
@@ -0,0 +1,31 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { Checkbox } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import CheckboxField from '../../../../javascripts/explorev2/components/CheckboxField';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'show_legend',
|
||||
onChange: sinon.spy(),
|
||||
};
|
||||
|
||||
describe('CheckboxField', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<CheckboxField {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders a Checkbox', () => {
|
||||
expect(wrapper.find(Checkbox)).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('calls onChange when toggled', () => {
|
||||
const checkbox = wrapper.find(Checkbox);
|
||||
checkbox.simulate('change', { value: true });
|
||||
expect(defaultProps.onChange.calledWith('show_legend')).to.be.true;
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Panel } from 'react-bootstrap';
|
||||
import { defaultFormData } from '../../../../javascripts/explorev2/stores/store';
|
||||
|
||||
import {
|
||||
ControlPanelsContainer,
|
||||
} from '../../../../javascripts/explorev2/components/ControlPanelsContainer';
|
||||
|
||||
const defaultProps = {
|
||||
datasource_id: 1,
|
||||
datasource_type: 'type',
|
||||
form_data: defaultFormData(),
|
||||
actions: {
|
||||
fetchFieldOptions: () => {
|
||||
// noop
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
describe('ControlPanelsContainer', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<ControlPanelsContainer {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders a Panel', () => {
|
||||
expect(wrapper.find(Panel)).to.have.lengthOf(1);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
// this test must be commented out because ChartContainer is now importing files
|
||||
// from visualizations/*.js which are also importing css files which breaks in the testing env.
|
||||
|
||||
// import React from 'react';
|
||||
// import { expect } from 'chai';
|
||||
// import { describe, it } from 'mocha';
|
||||
// import { shallow } from 'enzyme';
|
||||
|
||||
// import ExploreViewContainer
|
||||
// from '../../../../javascripts/explorev2/components/ExploreViewContainer';
|
||||
// import QueryAndSaveBtns
|
||||
// from '../../../../javascripts/explore/components/QueryAndSaveBtns';
|
||||
// import ControlPanelsContainer
|
||||
// from '../../../../javascripts/explorev2/components/ControlPanelsContainer';
|
||||
// import ChartContainer
|
||||
// from '../../../../javascripts/explorev2/components/ChartContainer';
|
||||
|
||||
// describe('ExploreViewContainer', () => {
|
||||
// it('renders', () => {
|
||||
// expect(
|
||||
// React.isValidElement(<ExploreViewContainer />)
|
||||
// ).to.equal(true);
|
||||
// });
|
||||
|
||||
// it('renders QueryAndSaveButtons', () => {
|
||||
// const wrapper = shallow(<ExploreViewContainer />);
|
||||
// expect(wrapper.find(QueryAndSaveBtns)).to.have.length(1);
|
||||
// });
|
||||
|
||||
// it('renders ControlPanelsContainer', () => {
|
||||
// const wrapper = shallow(<ExploreViewContainer />);
|
||||
// expect(wrapper.find(ControlPanelsContainer)).to.have.length(1);
|
||||
// });
|
||||
|
||||
// it('renders ChartContainer', () => {
|
||||
// const wrapper = shallow(<ExploreViewContainer />);
|
||||
// expect(wrapper.find(ChartContainer)).to.have.length(1);
|
||||
// });
|
||||
// });
|
||||
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import { fields, defaultFormData } from '../../../../javascripts/explorev2/stores/store';
|
||||
import FieldSetRow from '../../../../javascripts/explorev2/components/FieldSetRow';
|
||||
import FieldSet from '../../../../javascripts/explorev2/components/FieldSet';
|
||||
|
||||
const defaultProps = {
|
||||
fields,
|
||||
fieldSets: ['columns', 'metrics'],
|
||||
form_data: defaultFormData(),
|
||||
};
|
||||
|
||||
describe('FieldSetRow', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<FieldSetRow {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders a single row element', () => {
|
||||
expect(wrapper.find('.row')).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('renders a FieldSet for each item in fieldSets array', () => {
|
||||
const length = defaultProps.fieldSets.length;
|
||||
expect(wrapper.find(FieldSet)).to.have.lengthOf(length);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { FormControl } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import SelectField from '../../../../javascripts/explorev2/components/SelectField';
|
||||
|
||||
const defaultProps = {
|
||||
choices: [[10, 10], [20, 20]],
|
||||
name: 'row_limit',
|
||||
label: 'Row Limit',
|
||||
onChange: sinon.spy(),
|
||||
};
|
||||
|
||||
describe('SelectField', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<SelectField {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders a FormControl', () => {
|
||||
expect(wrapper.find(FormControl)).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('calls onChange when toggled', () => {
|
||||
const select = wrapper.find(FormControl);
|
||||
select.simulate('change', { target: { value: 50 } });
|
||||
expect(defaultProps.onChange.calledWith('row_limit', 50)).to.be.true;
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { FormControl } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import TextAreaField from '../../../../javascripts/explorev2/components/TextAreaField';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'x_axis_label',
|
||||
label: 'X Axis Label',
|
||||
onChange: sinon.spy(),
|
||||
};
|
||||
|
||||
describe('SelectField', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<TextAreaField {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders a FormControl', () => {
|
||||
expect(wrapper.find(FormControl)).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('calls onChange when toggled', () => {
|
||||
const select = wrapper.find(FormControl);
|
||||
select.simulate('change', { target: { value: 'x' } });
|
||||
expect(defaultProps.onChange.calledWith('x_axis_label', 'x')).to.be.true;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user