Get sections to render when switching datasource (#1660)

* 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
This commit is contained in:
vera-liu
2016-11-22 14:55:32 -08:00
committed by GitHub
parent bdae570a69
commit 6b80f5bb35
7 changed files with 45 additions and 38 deletions

View File

@@ -7,11 +7,12 @@ import { exploreReducer } from '../../../javascripts/explorev2/reducers/exploreR
describe('reducers', () => {
it('sets correct field value given a key and value', () => {
const newState = exploreReducer(
initialState('dist_bar'), actions.setFieldValue('x_axis_label', 'x'));
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('show_legend'));
const newState = exploreReducer(initialState('dist_bar'),
actions.setFieldValue('table', 'show_legend'));
expect(newState.viz.form_data.show_legend).to.equal(false);
});
});