Skip to content

Commit

Permalink
feat(AlertCallContainer): allow props to be passed to outer div
Browse files Browse the repository at this point in the history
  • Loading branch information
bfbiggs authored and pauljeter committed Jun 25, 2019
1 parent 8ba0b07 commit 9c2657c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions react/src/lib/AlertCallContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ import React from 'react';
import PropTypes from 'prop-types';

const AlertCallContainer = props => {
const {alertList} = props;
const {
alertList,
...otherProps
} = props;

return (
<div className='md-alert__container md-alert__container--call'>
<div
className='md-alert__container md-alert__container--call'
{...otherProps}
>
{alertList}
</div>
);
Expand Down
6 changes: 6 additions & 0 deletions react/src/lib/AlertCallContainer/tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,10 @@ describe('tests for <AlertCallContainer />', () => {

expect(container.find(AlertCall).length).toEqual(2);
});

it('should pass otherProps to container', () => {
const container = shallow(<AlertCallContainer id='testid'/>);

expect(container.find('#testid').exists()).toEqual(true);
});
});

0 comments on commit 9c2657c

Please sign in to comment.