Skip to content

Commit

Permalink
fix(connectRangeSlider): only clear the refinement on the current att…
Browse files Browse the repository at this point in the history
…ribute (#2459)
  • Loading branch information
samouss authored and bobylito committed Oct 9, 2017
1 parent 0eb3dc8 commit 7cebf58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/connectors/range-slider/__tests__/connectRangeSlider-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ describe('connectRangeSlider', () => {

expect(helper.getNumericRefinement(attributeName, '>=')).toEqual([10]);
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual([490]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -553,7 +553,7 @@ describe('connectRangeSlider', () => {

expect(helper.getNumericRefinement(attributeName, '>=')).toEqual([10]);
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual([490]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -570,7 +570,7 @@ describe('connectRangeSlider', () => {

expect(helper.getNumericRefinement(attributeName, '>=')).toEqual([10]);
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual([490]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -587,7 +587,7 @@ describe('connectRangeSlider', () => {

expect(helper.getNumericRefinement(attributeName, '>=')).toEqual([10]);
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual([490]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -603,7 +603,7 @@ describe('connectRangeSlider', () => {
undefined
);
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual([490]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -619,7 +619,7 @@ describe('connectRangeSlider', () => {
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual(
undefined
);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -635,7 +635,7 @@ describe('connectRangeSlider', () => {
undefined
);
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual([490]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand All @@ -651,7 +651,7 @@ describe('connectRangeSlider', () => {
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual(
undefined
);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});

Expand Down Expand Up @@ -686,7 +686,7 @@ describe('connectRangeSlider', () => {
expect(helper.getNumericRefinement(attributeName, '<=')).toEqual(
undefined
);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.clearRefinements).toHaveBeenCalledWith(attributeName);
expect(helper.search).toHaveBeenCalled();
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/range-slider/connectRangeSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function connectRangeSlider(renderFn) {
!hasMaxBound && rangeMax === nextMax ? undefined : nextMax;

if (min !== newNextMin || max !== newNextMax) {
helper.clearRefinements();
helper.clearRefinements(attributeName);

const isValidMinInput = _isFinite(newNextMin);
const isValidMinRange = _isFinite(rangeMin);
Expand Down

0 comments on commit 7cebf58

Please sign in to comment.