Bläddra i källkod

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
Harald Kraemer 11 år sedan
förälder
incheckning
1cbc352c6c
2 ändrade filer med 7 tillägg och 6 borttagningar
  1. 2 2
      src/app/services/filterSrv.js
  2. 5 4
      src/test/specs/filterSrv-specs.js

+ 2 - 2
src/app/services/filterSrv.js

@@ -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
src/test/specs/filterSrv-specs.js

@@ -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');
       });
     });