query.test.ts 488 B

123456789101112131415161718192021222324252627282930
  1. import { DataQuery } from '@grafana/ui';
  2. import { getNextRefIdChar } from './query';
  3. const dataQueries: DataQuery[] = [
  4. {
  5. refId: 'A',
  6. },
  7. {
  8. refId: 'B',
  9. },
  10. {
  11. refId: 'C',
  12. },
  13. {
  14. refId: 'D',
  15. },
  16. {
  17. refId: 'E',
  18. },
  19. ];
  20. describe('Get next refId char', () => {
  21. it('should return next char', () => {
  22. expect(getNextRefIdChar(dataQueries)).toEqual('F');
  23. });
  24. it('should get first char', () => {
  25. expect(getNextRefIdChar([])).toEqual('A');
  26. });
  27. });