Skip to content

Commit

Permalink
feat(connectRange): default precision to 0 (#3953)
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour authored and Haroenv committed Oct 23, 2019
1 parent 697f609 commit 632e06b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/connectors/range/__tests__/connectRange-test.js
Expand Up @@ -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,
});
}

Expand Down Expand Up @@ -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,
});
}
});
Expand Down Expand Up @@ -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();
});
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/range/connectRange.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 632e06b

Please sign in to comment.