diff options
author | Sriram Viswanathan <sriramv@thoughtworks.com> | 2017-03-24 14:39:43 -0300 |
---|---|---|
committer | Sriram Viswanathan <sriramv@thoughtworks.com> | 2017-03-24 14:39:43 -0300 |
commit | ccc31c1e1867c37335ee3fbdd4bc729ad6917883 (patch) | |
tree | 3b85bd81921e65ca86892139a7564a4df535b314 /web-ui/src/common/flat_button | |
parent | 4688646080ea8c7783f94371d2fe2f1dafb7b335 (diff) |
|#973| Thais + Sriram | Adds title and aria label for the logout button on the header
Diffstat (limited to 'web-ui/src/common/flat_button')
-rw-r--r-- | web-ui/src/common/flat_button/flat_button.js | 2 | ||||
-rw-r--r-- | web-ui/src/common/flat_button/flat_button.spec.js | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/web-ui/src/common/flat_button/flat_button.js b/web-ui/src/common/flat_button/flat_button.js index 33df7de4..b8c6c2c7 100644 --- a/web-ui/src/common/flat_button/flat_button.js +++ b/web-ui/src/common/flat_button/flat_button.js @@ -43,6 +43,8 @@ const SubmitFlatButton = ({ name, buttonText, fontIconClass }) => ( labelPosition='before' label={buttonText} labelStyle={labelStyle} + aria-label={buttonText} + title={buttonText} icon={<FontIcon className={fontIconClass} color={grey500} style={iconStyle} />} /> ); diff --git a/web-ui/src/common/flat_button/flat_button.spec.js b/web-ui/src/common/flat_button/flat_button.spec.js index 8939e3d9..16f03acb 100644 --- a/web-ui/src/common/flat_button/flat_button.spec.js +++ b/web-ui/src/common/flat_button/flat_button.spec.js @@ -18,6 +18,14 @@ describe('FlatButton', () => { expect(flatButton.find('FlatButton').props().label).toEqual('Logout'); }); + it('renders a FlatButton of type submit with title logout', () => { + expect(flatButton.find('FlatButton').props().title).toEqual('Logout'); + }); + + it('renders a FlatButton of type submit with aria-label logout', () => { + expect(flatButton.find('FlatButton').props()['aria-label']).toEqual('Logout'); + }); + it('renders a FlatButton with given fontIcon class', () => { expect(flatButton.find('FlatButton').props().icon.props.className).toEqual('fa fa-sign-out'); }); |