Commit 86b204ac by Torkel Odegaard

fixed failing unit test

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