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:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user