Skip to content

Commit 3ed3d39

Browse files
committedOct 19, 2015
fix(rangeSlider): restore wrongly removed state nesting
1 parent 7f983d0 commit 3ed3d39

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎widgets/range-slider/__tests__/range-slider-test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ describe('rangeSlider()', () => {
4040
})
4141
};
4242
helper = {
43-
getNumericRefinement: sinon.stub().returns([]),
43+
state: {
44+
getNumericRefinement: sinon.stub().returns([])
45+
},
4446
addNumericRefinement: sinon.spy(),
4547
clearRefinements: sinon.spy(),
4648
search: sinon.spy()
@@ -77,7 +79,7 @@ describe('rangeSlider()', () => {
7779

7880
it('doesn\'t call the refinement functions if not refined', () => {
7981
widget.render({results, helper});
80-
expect(helper.getNumericRefinement.calledTwice).toBe(true, 'getNumericRefinement called once');
82+
expect(helper.state.getNumericRefinement.calledTwice).toBe(true, 'getNumericRefinement called once');
8183
expect(helper.clearRefinements.called).toBe(false, 'clearRefinements never called');
8284
expect(helper.addNumericRefinement.called).toBe(false, 'addNumericRefinement never called');
8385
expect(helper.search.called).toBe(false, 'search never called');

‎widgets/range-slider/range-slider.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ function rangeSlider({
4646
disjunctiveFacets: [facetName]
4747
}),
4848
_getCurrentRefinement(helper) {
49-
var min = helper.getNumericRefinement(facetName, '>=');
50-
var max = helper.getNumericRefinement(facetName, '<=');
49+
var min = helper.state.getNumericRefinement(facetName, '>=');
50+
var max = helper.state.getNumericRefinement(facetName, '<=');
5151

5252
if (min && min.length) {
5353
min = min[0];

0 commit comments

Comments
 (0)
Please sign in to comment.