grafana/public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts
Giordano Ricci bb45f5fedc
Elasticsearch: Migrate queryeditor to React (#28033)
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-12-04 14:29:40 +00:00

40 lines
1.0 KiB
TypeScript

import { isPipelineAgg, isPipelineAggWithMultipleBucketPaths } from '../query_def';
describe('ElasticQueryDef', () => {
describe('isPipelineMetric', () => {
describe('moving_avg', () => {
const result = isPipelineAgg('moving_avg');
test('is pipe line metric', () => {
expect(result).toBe(true);
});
});
describe('count', () => {
const result = isPipelineAgg('count');
test('is not pipe line metric', () => {
expect(result).toBe(false);
});
});
});
describe('isPipelineAggWithMultipleBucketPaths', () => {
describe('bucket_script', () => {
const result = isPipelineAggWithMultipleBucketPaths('bucket_script');
test('should have multiple bucket paths support', () => {
expect(result).toBe(true);
});
});
describe('moving_avg', () => {
const result = isPipelineAggWithMultipleBucketPaths('moving_avg');
test('should not have multiple bucket paths support', () => {
expect(result).toBe(false);
});
});
});
});