InputDataSource: better empty value support (#17075)

This commit is contained in:
Ryan McKinley
2019-05-14 22:20:27 -07:00
committed by Torkel Ödegaard
parent 238a929262
commit d8280b895d
3 changed files with 37 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import InputDatasource from './InputDatasource';
import InputDatasource, { describeSeriesData } from './InputDatasource';
import { InputQuery, InputOptions } from './types';
import { readCSV, DataSourceInstanceSettings, PluginMeta } from '@grafana/ui';
import { getQueryOptions } from 'test/helpers/getQueryOptions';
@@ -31,4 +31,18 @@ describe('InputDatasource', () => {
});
});
});
test('SeriesData descriptions', () => {
expect(describeSeriesData([])).toEqual('');
expect(describeSeriesData(null)).toEqual('');
expect(
describeSeriesData([
{
name: 'x',
fields: [{ name: 'a' }],
rows: [],
},
])
).toEqual('1 Fields, 0 Rows');
});
});