mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
* Get sections to render when switching datasource - Move sectionsToRender in store and use is for defaultFormData - Change some SelectField to FreeFormSelect according to forms.py * Solved the css not found problem in staging * Fixed js tests
19 lines
854 B
JavaScript
19 lines
854 B
JavaScript
import { it, describe } from 'mocha';
|
|
import { expect } from 'chai';
|
|
import * as actions from '../../../javascripts/explorev2/actions/exploreActions';
|
|
import { initialState } from '../../../javascripts/explorev2/stores/store';
|
|
import { exploreReducer } from '../../../javascripts/explorev2/reducers/exploreReducer';
|
|
|
|
describe('reducers', () => {
|
|
it('sets correct field value given a key and value', () => {
|
|
const newState = exploreReducer(
|
|
initialState('dist_bar'), actions.setFieldValue('table', 'x_axis_label', 'x'));
|
|
expect(newState.viz.form_data.x_axis_label).to.equal('x');
|
|
});
|
|
it('toggles a boolean field value given only a key', () => {
|
|
const newState = exploreReducer(initialState('dist_bar'),
|
|
actions.setFieldValue('table', 'show_legend'));
|
|
expect(newState.viz.form_data.show_legend).to.equal(false);
|
|
});
|
|
});
|