Put formData in store (#1281)

* Put formData in store

* Reform actions and reducers

* Maded modifications based on comments:
This commit is contained in:
vera-liu
2016-10-07 14:53:36 -07:00
committed by GitHub
parent 3384e7598e
commit b7d1f78f5e
13 changed files with 283 additions and 390 deletions

View File

@@ -11,33 +11,6 @@ describe('reducers', () => {
expect(newState.datasourceId).to.equal(1);
});
it('should return new state with viz type', () => {
const newState = exploreReducer(initialState, actions.setVizType('bar'));
expect(newState.vizType).to.equal('bar');
});
it('should return new state with not groupby columns', () => {
const newColumn = ['col'];
const newState = exploreReducer(initialState, actions.setNotGroupByColumns(newColumn));
expect(newState.columns).to.deep.equal(['col']);
});
it('should return new state with orderings', () => {
const newOrdering = ['ord'];
const newState = exploreReducer(initialState, actions.setOrderings(newOrdering));
expect(newState.orderings).to.deep.equal(['ord']);
});
it('should return new state with time stamp', () => {
const newState = exploreReducer(initialState, actions.setTimeStampFormat(1));
expect(newState.timeStampFormat).to.equal(1);
});
it('should return new state with row limit', () => {
const newState = exploreReducer(initialState, actions.setRowLimit(10));
expect(newState.rowLimit).to.equal(10);
});
it('should return new state with search box toggled', () => {
const newState = exploreReducer(initialState, actions.toggleSearchBox(true));
expect(newState.searchBox).to.equal(true);