fix(table-viz): table chart time column should use default (#10293)

This commit is contained in:
Jesse Yang
2020-07-13 23:44:57 -07:00
committed by GitHub
parent f9c2600efc
commit 96e0da9fea
6 changed files with 70 additions and 66 deletions

View File

@@ -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', () => {