fix: chart validation error not cleared on control value update (#10224)

This commit is contained in:
Jesse Yang
2020-07-01 18:32:27 -07:00
committed by GitHub
parent f7a024d7de
commit 700429f431
12 changed files with 362 additions and 295 deletions

View File

@@ -189,15 +189,15 @@ describe('controlUtils', () => {
it('removes the mapStateToProps key from the object', () => {
let control = getControlConfig('all_columns', 'table');
control = applyMapStateToPropsToControl(control, state);
expect(control.mapStateToProps).toBe(undefined);
expect(control.mapStateToProps[0]).toBe(undefined);
});
});
describe('getControlState', () => {
it('to be function free', () => {
const control = getControlState('all_columns', 'table', state, ['a']);
expect(control.mapStateToProps).toBe(undefined);
expect(control.validators).toBe(undefined);
it('to still have the functions', () => {
const control = getControlState('metrics', 'table', state, ['a']);
expect(typeof control.mapStateToProps).toBe('function');
expect(typeof control.validators[0]).toBe('function');
});
it('to fix multi with non-array values', () => {