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
This commit is contained in:
Harald Kraemer
2014-05-20 09:48:36 +02:00
parent 51b70a7884
commit 1cbc352c6c
2 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ define([
this._templateData = _templateData;
},
templateOptionSelected : function(option) {
this.current = option;
templateOptionSelected : function(templateParameter, option) {
templateParameter.current = option;
this._updateTemplateData();
},
+5 -4
View File
@@ -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');
});
});