/*! grafana - v3.1.0 - 2016-07-18
 * Copyright (c) 2016 Torkel Ödegaard; Licensed Apache-2.0 */

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