This commit is contained in:
Peter Holmberg
2019-03-18 11:21:40 +01:00
parent 39728c885b
commit cb9bda810f

View File

@ -0,0 +1,30 @@
import { DataQuery } from '@grafana/ui';
import { getNextRefIdChar } from './query';
const dataQueries: DataQuery[] = [
{
refId: 'A',
},
{
refId: 'B',
},
{
refId: 'C',
},
{
refId: 'D',
},
{
refId: 'E',
},
];
describe('Get next refId char', () => {
it('should return next char', () => {
expect(getNextRefIdChar(dataQueries)).toEqual('F');
});
it('should get first char', () => {
expect(getNextRefIdChar([])).toEqual('A');
});
});