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

System.register(["../../../../../test/lib/common","../module","../../../../../test/specs/helpers"],function(a){var b,c,d;return{setters:[function(a){b=a},function(a){c=a},function(a){d=a}],execute:function(){b.describe("GraphCtrl",function(){var a=new d["default"].ControllerTestContext;b.beforeEach(b.angularMocks.module("grafana.services")),b.beforeEach(b.angularMocks.module("grafana.controllers")),b.beforeEach(a.providePhase()),b.beforeEach(a.createPanelController(c.GraphCtrl)),b.beforeEach(function(){a.ctrl.annotationsPromise=Promise.resolve({}),a.ctrl.updateTimeRange()}),b.describe("msResolution with second resolution timestamps",function(){b.beforeEach(function(){var b=[{target:"test.cpu1",datapoints:[[45,1234567890],[60,1234567899]]},{target:"test.cpu2",datapoints:[[55,1236547890],[90,1234456709]]}];a.ctrl.panel.tooltip.msResolution=!1,a.ctrl.onDataReceived(b)}),b.it("should not show millisecond resolution tooltip",function(){b.expect(a.ctrl.panel.tooltip.msResolution).to.be(!1)})}),b.describe("msResolution with millisecond resolution timestamps",function(){b.beforeEach(function(){var b=[{target:"test.cpu1",datapoints:[[45,123456789e4],[60,1234567899e3]]},{target:"test.cpu2",datapoints:[[55,1236547890001],[90,1234456709e3]]}];a.ctrl.panel.tooltip.msResolution=!1,a.ctrl.onDataReceived(b)}),b.it("should show millisecond resolution tooltip",function(){b.expect(a.ctrl.panel.tooltip.msResolution).to.be(!0)})}),b.describe("msResolution with millisecond resolution timestamps but with trailing zeroes",function(){b.beforeEach(function(){var b=[{target:"test.cpu1",datapoints:[[45,123456789e4],[60,1234567899e3]]},{target:"test.cpu2",datapoints:[[55,123654789e4],[90,1234456709e3]]}];a.ctrl.panel.tooltip.msResolution=!1,a.ctrl.onDataReceived(b)}),b.it("should not show millisecond resolution tooltip",function(){b.expect(a.ctrl.panel.tooltip.msResolution).to.be(!1)})}),b.describe("msResolution with millisecond resolution timestamps in one of the series",function(){b.beforeEach(function(){var b=[{target:"test.cpu1",datapoints:[[45,123456789e4],[60,1234567899e3]]},{target:"test.cpu2",datapoints:[[55,1236547890010],[90,1234456709e3]]},{target:"test.cpu3",datapoints:[[65,123654789e4],[120,1234456709e3]]}];a.ctrl.panel.tooltip.msResolution=!1,a.ctrl.onDataReceived(b)}),b.it("should show millisecond resolution tooltip",function(){b.expect(a.ctrl.panel.tooltip.msResolution).to.be(!0)})})})}}});