Files
superset2/superset/assets/spec/javascripts/explore/exploreActions_spec.js
Chris Williams b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00

19 lines
800 B
JavaScript

/* eslint-disable no-unused-expressions */
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);
});
});