From 1cbc352c6c6f052faf99ccd44a7689dc10ab9667 Mon Sep 17 00:00:00 2001 From: Harald Kraemer Date: Tue, 20 May 2014 09:48:36 +0200 Subject: [PATCH] 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 --- src/app/services/filterSrv.js | 4 ++-- src/test/specs/filterSrv-specs.js | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/services/filterSrv.js b/src/app/services/filterSrv.js index c9707fec36e..3d882354cbd 100644 --- a/src/app/services/filterSrv.js +++ b/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(); }, diff --git a/src/test/specs/filterSrv-specs.js b/src/test/specs/filterSrv-specs.js index e1d6467ea8c..1ab34aa0023 100644 --- a/src/test/specs/filterSrv-specs.js +++ b/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'); }); });