mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
[explorev2] adding support for client side validators on controls (#1920)
* Adding support for client side validators on controls * Applying validators to more fields * Addressing comments
This commit is contained in:
committed by
GitHub
parent
fc74fbeeaa
commit
470a6e9d76
@@ -7,13 +7,13 @@ 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('table', 'x_axis_label', 'x'));
|
||||
initialState('dist_bar'), actions.setFieldValue('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', () => {
|
||||
it('setFieldValue works as expected with a checkbox', () => {
|
||||
const newState = exploreReducer(initialState('dist_bar'),
|
||||
actions.setFieldValue('table', 'show_legend'));
|
||||
expect(newState.viz.form_data.show_legend).to.equal(false);
|
||||
actions.setFieldValue('show_legend', true));
|
||||
expect(newState.viz.form_data.show_legend).to.equal(true);
|
||||
});
|
||||
it('adds a filter given a new filter', () => {
|
||||
const newState = exploreReducer(initialState('table'),
|
||||
|
||||
Reference in New Issue
Block a user