mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix(table-viz): table chart time column should use default (#10293)
This commit is contained in:
@@ -35,6 +35,7 @@ describe('controlUtils', () => {
|
||||
columns: ['a', 'b', 'c'],
|
||||
metrics: [{ metric_name: 'first' }, { metric_name: 'second' }],
|
||||
},
|
||||
controls: {},
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
@@ -250,9 +251,10 @@ describe('controlUtils', () => {
|
||||
it('should not apply mapStateToProps when initializing', () => {
|
||||
const control = getControlState('metrics', 'table', {
|
||||
...state,
|
||||
isInitializing: true,
|
||||
controls: undefined,
|
||||
});
|
||||
expect(control.default).toEqual(null);
|
||||
expect(typeof control.default).toBe('function');
|
||||
expect(control.value).toBe(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -261,6 +263,15 @@ describe('controlUtils', () => {
|
||||
const control = getControlState('metric', 'table', state, null);
|
||||
expect(control.validationErrors).toEqual(['cannot be empty']);
|
||||
});
|
||||
it('should not validate if control panel is initializing', () => {
|
||||
const control = getControlState(
|
||||
'metric',
|
||||
'table',
|
||||
{ ...state, controls: undefined },
|
||||
undefined,
|
||||
);
|
||||
expect(control.validationErrors).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('queryFields', () => {
|
||||
|
||||
Reference in New Issue
Block a user