Skip to content

Commit

Permalink
feat(connectRange): default precision to 0 (#3953)
Browse files Browse the repository at this point in the history
francoischalifour authored and Haroenv committed Oct 23, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
colombod Diego Colombo
1 parent 697f609 commit 632e06b
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/connectors/range/__tests__/connectRange-test.js
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/range-input
expect(start).toEqual([-Infinity, Infinity]);
expect(widgetParams).toEqual({
attribute,
precision: 2,
precision: 0,
});
}

@@ -110,7 +110,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/range-input
expect(start).toEqual([-Infinity, Infinity]);
expect(widgetParams).toEqual({
attribute,
precision: 2,
precision: 0,
});
}
});
@@ -661,8 +661,8 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/range-input

widget._refine(helper, range)(values);

expect(helper.getNumericRefinement(attribute, '>=')).toEqual([10.5]);
expect(helper.getNumericRefinement(attribute, '<=')).toEqual([490.5]);
expect(helper.getNumericRefinement(attribute, '>=')).toEqual([11]);
expect(helper.getNumericRefinement(attribute, '<=')).toEqual([491]);
expect(helper.clearRefinements).toHaveBeenCalled();
expect(helper.search).toHaveBeenCalled();
});
2 changes: 1 addition & 1 deletion src/connectors/range/connectRange.js
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ export default function connectRange(renderFn, unmountFn = noop) {
attribute,
min: minBound,
max: maxBound,
precision = 2, // @MAJOR: the `precision` default value should be 0
precision = 0,
} = widgetParams;

if (!attribute) {

0 comments on commit 632e06b

Please sign in to comment.