From a79417a73bb4fdf9acf58772ed917cb2b1597c69 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 28 Jan 2020 18:09:30 +0200 Subject: [PATCH] feat(Progress): Allow passing in custom style object (#1771) Allows for more flexibility in styling --- src/Progress.js | 8 +++++++- src/__tests__/Progress.spec.js | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Progress.js b/src/Progress.js index 1cf31b2d9..098393232 100644 --- a/src/Progress.js +++ b/src/Progress.js @@ -22,12 +22,14 @@ const propTypes = { className: PropTypes.string, barClassName: PropTypes.string, cssModule: PropTypes.object, + style: PropTypes.object, }; const defaultProps = { tag: 'div', value: 0, max: 100, + style: {}, }; const Progress = (props) => { @@ -44,6 +46,7 @@ const Progress = (props) => { bar, multi, tag: Tag, + style, ...attributes } = props; @@ -65,7 +68,10 @@ const Progress = (props) => { const ProgressBar = multi ? children : (
{ expect(wrapper.prop('max')).toBe(100); }); + it('should render with "style" empty object by default', () => { + const wrapper = mount(); + + expect(wrapper.prop('style')).toEqual({}); + }); + it('should render with the given "value" when passed as string prop', () => { const wrapper = mount();