Commit f2b9ea10 by Harald Kraemer

Fixed timerange unparsed

 - had to call init with the dashboard mock, since this checks
   dashboard.refresh (need to look at that sometime)
parent 1cbc352c
...@@ -21,7 +21,7 @@ define([ ...@@ -21,7 +21,7 @@ define([
describe('init', function() { describe('init', function() {
beforeEach(function() { beforeEach(function() {
_filterSrv.init(); _filterSrv.init( _dashboard );
_filterSrv.addTemplateParameter({ name: 'test', current: { value: 'oogle' } }); _filterSrv.addTemplateParameter({ name: 'test', current: { value: 'oogle' } });
}); });
...@@ -33,7 +33,7 @@ define([ ...@@ -33,7 +33,7 @@ define([
describe('templateOptionSelected', function() { describe('templateOptionSelected', function() {
beforeEach(function() { beforeEach(function() {
_filterSrv.init(); _filterSrv.init( _dashboard );
_filterSrv.addTemplateParameter({ name: 'test' }); _filterSrv.addTemplateParameter({ name: 'test' });
_filterSrv.templateOptionSelected(_filterSrv.templateParameters[0], { value: 'muuuu' }); _filterSrv.templateOptionSelected(_filterSrv.templateParameters[0], { value: 'muuuu' });
}); });
...@@ -45,6 +45,7 @@ define([ ...@@ -45,6 +45,7 @@ define([
describe('timeRange', function() { describe('timeRange', function() {
it('should return unparsed when parse is false', function() { it('should return unparsed when parse is false', function() {
_filterSrv.init( _dashboard );
_filterSrv.setTime({from: 'now', to: 'now-1h' }); _filterSrv.setTime({from: 'now', to: 'now-1h' });
var time = _filterSrv.timeRange(false); var time = _filterSrv.timeRange(false);
expect(time.from).to.be('now'); expect(time.from).to.be('now');
......
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