query_def.test.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { isPipelineAgg, isPipelineAggWithMultipleBucketPaths } from '../query_def';
  2. describe('ElasticQueryDef', () => {
  3. describe('isPipelineMetric', () => {
  4. describe('moving_avg', () => {
  5. const result = isPipelineAgg('moving_avg');
  6. test('is pipe line metric', () => {
  7. expect(result).toBe(true);
  8. });
  9. });
  10. describe('count', () => {
  11. const result = isPipelineAgg('count');
  12. test('is not pipe line metric', () => {
  13. expect(result).toBe(false);
  14. });
  15. });
  16. });
  17. describe('isPipelineAggWithMultipleBucketPaths', () => {
  18. describe('bucket_script', () => {
  19. const result = isPipelineAggWithMultipleBucketPaths('bucket_script');
  20. test('should have multiple bucket paths support', () => {
  21. expect(result).toBe(true);
  22. });
  23. });
  24. describe('moving_avg', () => {
  25. const result = isPipelineAggWithMultipleBucketPaths('moving_avg');
  26. test('should not have multiple bucket paths support', () => {
  27. expect(result).toBe(false);
  28. });
  29. });
  30. });
  31. });