mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
Remove aggregates from metric options if datasource has no columns (#7586)
This commit is contained in:
@@ -85,6 +85,14 @@ describe('MetricsControl', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('does not show aggregates in options if no columns', () => {
|
||||
const { wrapper } = setup({ columns: [] });
|
||||
expect(wrapper.state('options')).toEqual([
|
||||
{ optionName: 'sum__value', metric_name: 'sum__value', expression: 'SUM(energy_usage.value)' },
|
||||
{ optionName: 'avg__value', metric_name: 'avg__value', expression: 'AVG(energy_usage.value)' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('coerces Adhoc Metrics from form data into instances of the AdhocMetric class and leaves saved metrics', () => {
|
||||
const { wrapper } = setup({
|
||||
value: [
|
||||
|
||||
Reference in New Issue
Block a user