Fixed unit tests for grafanaGraph component

This commit is contained in:
Torkel Ödegaard 2014-10-01 09:10:49 +02:00
parent 8fc5a2785f
commit d77448d84e
2 changed files with 10 additions and 2 deletions

View File

@ -14,10 +14,13 @@ define([
function graphScenario(desc, func) {
describe(desc, function() {
var ctx = {};
ctx.setup = function (setupFunc) {
beforeEach(module(function($provide) {
$provide.value("timeSrv", new helpers.TimeSrvStub());
}));
beforeEach(inject(function($rootScope, $compile) {
var scope = $rootScope.$new();
var element = angular.element("<div style='width:500px' grafana-graph><div>");
@ -28,10 +31,13 @@ define([
grid: {},
y_formats: [],
seriesOverrides: [],
tooltip: {
tooltip: {
shared: true
}
};
scope.appEvent = sinon.spy();
scope.onAppEvent = sinon.spy();
scope.hiddenSeries = {};
scope.dashboard = { timezone: 'browser' };
scope.range = {

View File

@ -10,12 +10,14 @@ define([
formatDate: sinon.stub().returns('date'),
};
var scope = {
appEvent: sinon.spy(),
onAppEvent: sinon.spy(),
panel: {
tooltip: {
shared: true
},
y_formats: ['ms', 'none'],
stack: true
stack: true
}
};