mirror of
https://github.com/apache/superset.git
synced 2026-08-03 20:42:30 +00:00
23 lines
614 B
TypeScript
23 lines
614 B
TypeScript
import { ChartProps } from '@superset-ui/core';
|
|
import transformProps from '../src/transformProps';
|
|
|
|
const createProps = () =>
|
|
({
|
|
width: 800,
|
|
height: 600,
|
|
formData: {
|
|
includeSeries: false,
|
|
linearColorScheme: 'superset_seq_1',
|
|
metrics: undefined,
|
|
secondaryMetric: 'sum__SP_POP_TOTL',
|
|
series: 'country_name',
|
|
showDatatable: false,
|
|
},
|
|
queriesData: [{ data: [{ country_id: 'FRA', metric: 10 }] }],
|
|
theme: {},
|
|
}) as unknown as ChartProps;
|
|
|
|
test('do not crash on undefined metrics', () => {
|
|
expect(() => transformProps(createProps())).not.toThrow();
|
|
});
|