Commit 1e7beffa by Torkel Ödegaard

more unit test work

parent c2c16b6b
......@@ -6,6 +6,7 @@ define([
describe('OverviewCtrl', function() {
var _controller;
var _scope;
var _datasource;
beforeEach(module('grafana.services'));
beforeEach(module('grafana.panels.overview'));
......@@ -15,14 +16,22 @@ define([
getMetricSources: function() {
},
get: function() {
return {};
return _datasource;
}
});
}));
beforeEach(inject(function($controller, $rootScope) {
beforeEach(inject(function($controller, $rootScope, $q) {
_scope = $rootScope.$new();
_scope.panel = { targets: [] };
_scope.filter = {
timeRange: function() { }
};
_scope.datasource = {
query: function() {
return $q.resolve('hej');
}
};
_controller = $controller('OverviewCtrl', {
$scope: _scope
});
......
......@@ -124,6 +124,7 @@ require([
'specs/filterSrv-specs',
'specs/kbn-format-specs',
'specs/dashboardModel-specs',
'specs/overview-ctrl-specs',
'specs/influxSeries-specs'
], function () {
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