From aed577435c2f6070d49e1d53102964232beb4a21 Mon Sep 17 00:00:00 2001 From: MrCreeper1008 Date: Wed, 27 Jan 2021 01:36:01 +0000 Subject: [PATCH] Add rounded props for Form.Select --- .../__snapshots__/select.test.js.snap | 23 +++++++++++++ .../form/components/__test__/select.test.js | 10 ++++++ src/components/form/components/select.js | 34 ++++++++++++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/components/form/components/__test__/__snapshots__/select.test.js.snap b/src/components/form/components/__test__/__snapshots__/select.test.js.snap index 1e02077ba..d9ff89a0d 100644 --- a/src/components/form/components/__test__/__snapshots__/select.test.js.snap +++ b/src/components/form/components/__test__/__snapshots__/select.test.js.snap @@ -23,6 +23,29 @@ exports[`Select component Should be large, red, disabled and multioption 1`] = ` `; +exports[`Select component Should be rounded 1`] = ` +
+ +
+`; + exports[`Select component Should concat classname in props with Bulma classname 1`] = `
{ ); expect(component.toJSON()).toMatchSnapshot(); }); + it('Should be rounded', () => { + const component = renderer.create( + , + ); + expect(component.toJSON()).toMatchSnapshot(); + }); describe('value PropTypes', () => { it('Should be multioption and should not accept non array value', () => { const spy = jest.spyOn(console, 'error').mockImplementation(); diff --git a/src/components/form/components/select.js b/src/components/form/components/select.js index 2c077139f..10762458a 100644 --- a/src/components/form/components/select.js +++ b/src/components/form/components/select.js @@ -9,6 +9,7 @@ const colors = [null].concat(Object.values(CONSTANTS.COLORS)); const Select = ({ className, + rounded, style, size, color, @@ -37,6 +38,7 @@ const Select = ({ [`is-${color}`]: color, 'is-loading': loading, 'is-multiple': multiple, + 'is-rounded': rounded, })} style={style} > @@ -57,15 +59,44 @@ const Select = ({ Select.propTypes = { ...modifiers.propTypes, + /** + * Children of this component. Usually they are `