mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix: optimize mapStateToProps for chart controls (#10264)
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
getFormDataFromControls,
|
||||
applyMapStateToPropsToControl,
|
||||
getAllControlsState,
|
||||
getControlsState,
|
||||
} from 'src/explore/controlUtils';
|
||||
|
||||
describe('controlUtils', () => {
|
||||
@@ -246,6 +247,14 @@ describe('controlUtils', () => {
|
||||
const control = getControlState('metrics', 'table', stateWithCount);
|
||||
expect(control.default).toEqual(['count']);
|
||||
});
|
||||
|
||||
it('should not apply mapStateToProps when initializing', () => {
|
||||
const control = getControlState('metrics', 'table', {
|
||||
...state,
|
||||
isInitializing: true,
|
||||
});
|
||||
expect(control.default).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateControl', () => {
|
||||
|
||||
Reference in New Issue
Block a user