From ccc31c1e1867c37335ee3fbdd4bc729ad6917883 Mon Sep 17 00:00:00 2001 From: Sriram Viswanathan Date: Fri, 24 Mar 2017 14:39:43 -0300 Subject: |#973| Thais + Sriram | Adds title and aria label for the logout button on the header --- web-ui/src/common/header/header.js | 9 ++------- web-ui/src/common/header/header.spec.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'web-ui/src/common/header') diff --git a/web-ui/src/common/header/header.js b/web-ui/src/common/header/header.js index ee0259d1..715d54c6 100644 --- a/web-ui/src/common/header/header.js +++ b/web-ui/src/common/header/header.js @@ -16,11 +16,10 @@ */ import React from 'react'; -import { translate } from 'react-i18next'; import Logout from 'src/common/logout/logout'; import './header.scss'; -export const Header = ({ t }) => ( +export const Header = () => (
@@ -37,8 +36,4 @@ export const Header = ({ t }) => (
); -Header.propTypes = { - t: React.PropTypes.func.isRequired -}; - -export default translate('', { wait: true })(Header); +export default Header; diff --git a/web-ui/src/common/header/header.spec.js b/web-ui/src/common/header/header.spec.js index e5004bcc..81a952c7 100644 --- a/web-ui/src/common/header/header.spec.js +++ b/web-ui/src/common/header/header.spec.js @@ -2,16 +2,20 @@ import { shallow } from 'enzyme'; import expect from 'expect'; import React from 'react'; import { Header } from 'src/common/header/header'; +import Logout from 'src/common/logout/logout'; describe('Header', () => { let header; beforeEach(() => { - const mockTranslations = key => key; - header = shallow(
); + header = shallow(
); }); - it('renders the header content', () => { - expect(header.find('header').text()).toContain('Logout'); + it('renders the header containing the logout button', () => { + expect(header.find('header').find(Logout)).toExist(); + }); + + it('renders the header pixelated logo', () => { + expect(header.find('header').find('img').props().alt).toEqual('Pixelated'); }); }); -- cgit v1.2.3