diff --git a/src/Alert/Alert.js b/src/Alert/Alert.js
index 7d25565e3..3a91f4cad 100644
--- a/src/Alert/Alert.js
+++ b/src/Alert/Alert.js
@@ -17,8 +17,10 @@ export class Alert extends Component {
render() {
const {
+ buttonProps,
type,
link,
+ linkProps,
linkText,
dismissable,
children,
@@ -39,11 +41,15 @@ export class Alert extends Component {
aria-controls='j2ALl423'
aria-label='Close'
className='fd-alert__close'
- onClick={() => this.closeAlertHandler()} />
+ onClick={() => this.closeAlertHandler()}
+ {...buttonProps} />
)}
{children}
{link && (
-
+
{linkText}{' '}
@@ -56,9 +62,11 @@ export class Alert extends Component {
}
Alert.propTypes = {
+ buttonProps: PropTypes.object,
className: PropTypes.string,
dismissable: PropTypes.bool,
link: PropTypes.string,
+ linkProps: PropTypes.object,
linkText: PropTypes.string,
type: PropTypes.oneOf(['', 'warning', 'error', 'success', 'information'])
};
diff --git a/src/Alert/Alert.test.js b/src/Alert/Alert.test.js
index 11fa7776a..ec20073fb 100644
--- a/src/Alert/Alert.test.js
+++ b/src/Alert/Alert.test.js
@@ -62,12 +62,20 @@ describe('', () => {
).toBe('Sample');
});
- xtest('should allow props to be spread to the Alert component\'s button element when dismissable', () => {
- // TODO: placeholder for this test description once that functionality is built
+ test('should allow props to be spread to the Alert component\'s button element when dismissable', () => {
+ const element = mount();
+
+ expect(
+ element.find('button').getDOMNode().attributes['data-sample'].value
+ ).toBe('Sample');
});
- xtest('should allow props to be spread to the Alert component\'s a element when link provided', () => {
- // TODO: placeholder for this test description once that functionality is built
+ test('should allow props to be spread to the Alert component\'s a element when link provided', () => {
+ const element = mount();
+
+ expect(
+ element.find('a').getDOMNode().attributes['data-sample'].value
+ ).toBe('Sample');
});
});
});