Commit 1cbc352c by Harald Kraemer

Fixed (filter->template)OptionSelected test

- small misunderstanding on my part, fixed the API in the filterSrv back
- renames to match my renames
- init script has to be called or fundefined things happen
parent 51b70a78
......@@ -34,8 +34,8 @@ define([
this._templateData = _templateData;
},
templateOptionSelected : function(option) {
this.current = option;
templateOptionSelected : function(templateParameter, option) {
templateParameter.current = option;
this._updateTemplateData();
},
......
......@@ -31,13 +31,14 @@ define([
});
});
describe('filterOptionSelected', function() {
describe('templateOptionSelected', function() {
beforeEach(function() {
_filterSrv.add({ name: 'test' });
_filterSrv.filterOptionSelected(_filterSrv.list[0], { value: 'muuuu' });
_filterSrv.init();
_filterSrv.addTemplateParameter({ name: 'test' });
_filterSrv.templateOptionSelected(_filterSrv.templateParameters[0], { value: 'muuuu' });
});
it('should set current value and update template data', function() {
var target = _filterSrv.applyFilterToTarget('this.[[test]].filters');
var target = _filterSrv.applyTemplateToTarget('this.[[test]].filters');
expect(target).to.be('this.muuuu.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