Commit 86b204ac by Torkel Odegaard

fixed failing unit test

parent 8cd5a996
...@@ -29,7 +29,6 @@ define([ ...@@ -29,7 +29,6 @@ define([
if (!templateParameter.current || !templateParameter.current.value) { if (!templateParameter.current || !templateParameter.current.value) {
return; return;
} }
_templateData[templateParameter.name] = templateParameter.current.value; _templateData[templateParameter.name] = templateParameter.current.value;
}); });
this._templateData = _templateData; this._templateData = _templateData;
......
...@@ -20,7 +20,7 @@ define([ ...@@ -20,7 +20,7 @@ define([
})); }));
beforeEach(function() { beforeEach(function() {
_filterSrv.init( _dashboard.current ); _filterSrv.init(_dashboard.current);
}); });
describe('init', function() { describe('init', function() {
...@@ -34,10 +34,15 @@ define([ ...@@ -34,10 +34,15 @@ define([
}); });
}); });
describe('templateOptionSelected', function() { describe('updateTemplateData', function() {
beforeEach(function() { beforeEach(function() {
_filterSrv.addTemplateParameter({ name: 'test' }); _filterSrv.addTemplateParameter({
_filterSrv.templateOptionSelected(_filterSrv.templateParameters[0], { value: 'muuuu' }); name: 'test',
value: 'muuu',
current: { value: 'muuuu' }
});
_filterSrv.updateTemplateData();
}); });
it('should set current value and update template data', function() { it('should set current value and update template data', function() {
var target = _filterSrv.applyTemplateToTarget('this.[[test]].filters'); var target = _filterSrv.applyTemplateToTarget('this.[[test]].filters');
......
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