Skip to content

Commit

Permalink
enable spreading props to buttongroup
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan committed Jan 16, 2019
1 parent 00d5fd7 commit 7393b97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ Button.propTypes = {
onClick: PropTypes.func
};

export const ButtonGroup = props => {
const { children } = props;
export const ButtonGroup = ({children, ...props}) => {
return (
<div aria-label='Group label' className='fd-button-group'
role='group'>
role='group'
{...props}>
{children}
</div>
);
Expand Down
8 changes: 6 additions & 2 deletions src/Button/Button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ describe('<Button />', () => {
).toBe('Sample');
});

xtest('should allow props to be spread to the ButtonGroup component', () => {
// TODO: placeholder for this test description once that functionality is built
test('should allow props to be spread to the ButtonGroup component', () => {
const element = mount(<ButtonGroup data-sample='Sample' />);

expect(
element.getDOMNode().attributes['data-sample'].value
).toBe('Sample');
});
});
});

0 comments on commit 7393b97

Please sign in to comment.