diff --git a/public/app/plugins/panel/graph/specs/graph_specs.ts b/public/app/plugins/panel/graph/specs/graph_specs.ts index 1a708696680..b9c9362e5de 100644 --- a/public/app/plugins/panel/graph/specs/graph_specs.ts +++ b/public/app/plugins/panel/graph/specs/graph_specs.ts @@ -53,7 +53,9 @@ describe('grafanaGraph', function() { }, renderingCompleted: sinon.spy(), hiddenSeries: {}, - dashboard: {timezone: 'browser'}, + dashboard: { + getTimezone: sinon.stub().returns('browser') + }, range: { from: moment([2015, 1, 1, 10]), to: moment([2015, 1, 1, 22]), diff --git a/public/test/specs/dashboardSrv-specs.js b/public/test/specs/dashboardSrv-specs.js index e02495c1236..6fc53f09190 100644 --- a/public/test/specs/dashboardSrv-specs.js +++ b/public/test/specs/dashboardSrv-specs.js @@ -7,6 +7,10 @@ define([ var _dashboardSrv; beforeEach(module('grafana.services')); + beforeEach(module(function($provide) { + $provide.value('contextSrv', { + }); + })); beforeEach(inject(function(dashboardSrv) { _dashboardSrv = dashboardSrv; diff --git a/public/test/specs/dynamicDashboardSrv-specs.js b/public/test/specs/dynamicDashboardSrv-specs.js index 0104081b768..b988203009a 100644 --- a/public/test/specs/dynamicDashboardSrv-specs.js +++ b/public/test/specs/dynamicDashboardSrv-specs.js @@ -12,6 +12,11 @@ define([ ctx.setup = function (setupFunc) { beforeEach(module('grafana.services')); + beforeEach(module(function($provide) { + $provide.value('contextSrv', { + user: { timezone: 'utc'} + }); + })); beforeEach(inject(function(dynamicDashboardSrv, dashboardSrv) { ctx.dynamicDashboardSrv = dynamicDashboardSrv; @@ -45,10 +50,10 @@ define([ value: ['se1', 'se2', 'se3'] }, options: [ - {text: 'se1', value: 'se1', selected: true}, - {text: 'se2', value: 'se2', selected: true}, - {text: 'se3', value: 'se3', selected: true}, - {text: 'se4', value: 'se4', selected: false} + {text: 'se1', value: 'se1', selected: true}, + {text: 'se2', value: 'se2', selected: true}, + {text: 'se3', value: 'se3', selected: true}, + {text: 'se4', value: 'se4', selected: false} ] }); }); @@ -93,7 +98,7 @@ define([ describe('After a second iteration and selected values reduced', function() { beforeEach(function() { ctx.dash.templating.list[0].options[1].selected = false; - + ctx.dynamicDashboardSrv.update(ctx.dash); });