瀏覽代碼

Added some more test for sanity

utkarshcmu 9 年之前
父節點
當前提交
922b7c44ce
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. 19 0
      public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts

+ 19 - 0
public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts

@@ -98,4 +98,23 @@ describe('GraphCtrl', function() {
     });
   });
 
+  describe('msResolution with millisecond resolution timestamps in one of the series', function() {
+    beforeEach(function() {
+      ctx.datasource.query = sinon.stub().returns(ctx.$q.when({
+        data: [
+          { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]},
+          { target: 'test.cpu2', datapoints: [[1236547890010, 55], [1234456709000, 90]]},
+          { target: 'test.cpu3', datapoints: [[1236547890000, 65], [1234456709000, 120]]}
+        ]
+      }));
+      ctx.ctrl.panel.tooltip.msResolution = false;
+      ctx.ctrl.refreshData(ctx.datasource);
+      ctx.scope.$digest();
+    });
+
+    it('should show millisecond resolution tooltip', function() {
+      expect(ctx.ctrl.panel.tooltip.msResolution).to.be(true);
+    });
+  });
+
 });