/*! grafana - v4.2.0 - 2017-03-24
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["test/lib/common","../query_def"],function(a,b){"use strict";var c,d;b&&b.id;return{setters:[function(a){c=a},function(a){d=a}],execute:function(){c.describe("ElasticQueryDef",function(){c.describe("getPipelineAggOptions",function(){c.describe("with zero targets",function(){var a=d.default.getPipelineAggOptions([]);c.it("should return zero",function(){c.expect(a.length).to.be(0)})}),c.describe("with count and sum targets",function(){var a={metrics:[{type:"count",field:"@value"},{type:"sum",field:"@value"}]},b=d.default.getPipelineAggOptions(a);c.it("should return zero",function(){c.expect(b.length).to.be(2)})}),c.describe("with count and moving average targets",function(){var a={metrics:[{type:"count",field:"@value"},{type:"moving_avg",field:"@value"}]},b=d.default.getPipelineAggOptions(a);c.it("should return one",function(){c.expect(b.length).to.be(1)})}),c.describe("with derivatives targets",function(){var a={metrics:[{type:"derivative",field:"@value"}]},b=d.default.getPipelineAggOptions(a);c.it("should return zero",function(){c.expect(b.length).to.be(0)})})}),c.describe("isPipelineMetric",function(){c.describe("moving_avg",function(){var a=d.default.isPipelineAgg("moving_avg");c.it("is pipe line metric",function(){c.expect(a).to.be(!0)})}),c.describe("count",function(){var a=d.default.isPipelineAgg("count");c.it("is not pipe line metric",function(){c.expect(a).to.be(!1)})})}),c.describe("pipeline aggs depending on esverison",function(){c.describe("using esversion undefined",function(){c.it("should not get pipeline aggs",function(){c.expect(d.default.getMetricAggTypes(void 0).length).to.be(9)})}),c.describe("using esversion 1",function(){c.it("should not get pipeline aggs",function(){c.expect(d.default.getMetricAggTypes(1).length).to.be(9)})}),c.describe("using esversion 2",function(){c.it("should get pipeline aggs",function(){c.expect(d.default.getMetricAggTypes(2).length).to.be(11)})}),c.describe("using esversion 5",function(){c.it("should get pipeline aggs",function(){c.expect(d.default.getMetricAggTypes(5).length).to.be(11)})})})})}}});