diff --git a/packages/react-core/src/Button/index.js b/packages/react-core/src/Button/index.js index b589c5d5..9d665314 100644 --- a/packages/react-core/src/Button/index.js +++ b/packages/react-core/src/Button/index.js @@ -100,7 +100,7 @@ const Button = styled( } return ( - + {React.Children.map(children, node => ['string', 'number'].includes(typeof node) ? ( {node} diff --git a/packages/react-core/src/Button/index.test.js b/packages/react-core/src/Button/index.test.js index 38bb3382..b00c4be0 100644 --- a/packages/react-core/src/Button/index.test.js +++ b/packages/react-core/src/Button/index.test.js @@ -113,6 +113,12 @@ it('renders a Button with type=submit', () => { expect(wrapper.find('button').props().type).toBe('submit'); }); +it('forwards ref properly', () => { + const ref = React.createRef(); + mount(); + expect(ref.current).toBeDefined(); +}); + // it('renders properly with isGroupChild property', () => { // const wrapper = mount(