[#264,bugfix,filtereditor][s]: track down and fix bug with addFilter (and hence filtereditor) - fixes #264.

* Quite a subtle bug due to the fact that we were not doing a deep copy on the filter template in addFilter
This commit is contained in:
Rufus Pollock
2012-11-08 20:35:03 +00:00
parent d479603ca7
commit ede211646a
3 changed files with 37 additions and 2 deletions

View File

@@ -320,6 +320,9 @@ test('Query.addFilter', function () {
};
deepEqual(query.get('filters')[0], exp);
query.addFilter({type: 'term', field: 'abc'});
deepEqual(query.get('filters')[0], exp);
query.addFilter({type: 'geo_distance', field: 'xyz'});
var exp = {
distance: 10,
@@ -331,7 +334,7 @@ test('Query.addFilter', function () {
field: 'xyz',
type: 'geo_distance'
};
deepEqual(exp, query.get('filters')[1]);
deepEqual(exp, query.get('filters')[2]);
});
})(this.jQuery);