mirror of
https://github.com/apache/superset.git
synced 2026-04-09 19:35:21 +00:00
* A React table editor * addressing comments * Fix SelectAsyncControl error on clear * fix tests * more corrections * Removed <strong>
20 lines
838 B
JavaScript
20 lines
838 B
JavaScript
/* eslint-disable no-unused-expressions */
|
|
import { it, describe } from 'mocha';
|
|
import { expect } from 'chai';
|
|
import { defaultState } from '../../../src/explore/store';
|
|
import exploreReducer from '../../../src/explore/reducers/exploreReducer';
|
|
import * as actions from '../../../src/explore/actions/exploreActions';
|
|
|
|
describe('reducers', () => {
|
|
it('sets correct control value given a key and value', () => {
|
|
const newState = exploreReducer(
|
|
defaultState, actions.setControlValue('x_axis_label', 'x', []));
|
|
expect(newState.controls.x_axis_label.value).to.equal('x');
|
|
});
|
|
it('setControlValue works as expected with a checkbox', () => {
|
|
const newState = exploreReducer(defaultState,
|
|
actions.setControlValue('show_legend', true, []));
|
|
expect(newState.controls.show_legend.value).to.equal(true);
|
|
});
|
|
});
|