Commit 1e7beffa by Torkel Ödegaard

more unit test work

parent c2c16b6b
...@@ -6,6 +6,7 @@ define([ ...@@ -6,6 +6,7 @@ define([
describe('OverviewCtrl', function() { describe('OverviewCtrl', function() {
var _controller; var _controller;
var _scope; var _scope;
var _datasource;
beforeEach(module('grafana.services')); beforeEach(module('grafana.services'));
beforeEach(module('grafana.panels.overview')); beforeEach(module('grafana.panels.overview'));
...@@ -15,14 +16,22 @@ define([ ...@@ -15,14 +16,22 @@ define([
getMetricSources: function() { getMetricSources: function() {
}, },
get: function() { get: function() {
return {}; return _datasource;
} }
}); });
})); }));
beforeEach(inject(function($controller, $rootScope) { beforeEach(inject(function($controller, $rootScope, $q) {
_scope = $rootScope.$new(); _scope = $rootScope.$new();
_scope.panel = { targets: [] }; _scope.panel = { targets: [] };
_scope.filter = {
timeRange: function() { }
};
_scope.datasource = {
query: function() {
return $q.resolve('hej');
}
};
_controller = $controller('OverviewCtrl', { _controller = $controller('OverviewCtrl', {
$scope: _scope $scope: _scope
}); });
......
...@@ -124,6 +124,7 @@ require([ ...@@ -124,6 +124,7 @@ require([
'specs/filterSrv-specs', 'specs/filterSrv-specs',
'specs/kbn-format-specs', 'specs/kbn-format-specs',
'specs/dashboardModel-specs', 'specs/dashboardModel-specs',
'specs/overview-ctrl-specs',
'specs/influxSeries-specs' 'specs/influxSeries-specs'
], function () { ], function () {
window.__karma__.start(); window.__karma__.start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment