diff options
Diffstat (limited to 'web-ui')
-rw-r--r-- | web-ui/app/locales/en_US/translation.json | 7 | ||||
-rw-r--r-- | web-ui/app/locales/pt_BR/translation.json | 7 | ||||
-rw-r--r-- | web-ui/src/login/app.js | 12 | ||||
-rw-r--r-- | web-ui/src/login/login.js | 4 | ||||
-rw-r--r-- | web-ui/test/unit/login/app.spec.js | 17 |
5 files changed, 39 insertions, 8 deletions
diff --git a/web-ui/app/locales/en_US/translation.json b/web-ui/app/locales/en_US/translation.json index 7252d1d7..ffbce321 100644 --- a/web-ui/app/locales/en_US/translation.json +++ b/web-ui/app/locales/en_US/translation.json @@ -84,5 +84,10 @@ "button": "Add Account" }, "back-to-inbox": "Back to my inbox", - "footer-text": "Product in development. Feedback and issues to" + "footer-text": "Product in development. Feedback and issues to", + "login": { + "email": "Your email", + "password": "Your password", + "submit": "Login" + } } diff --git a/web-ui/app/locales/pt_BR/translation.json b/web-ui/app/locales/pt_BR/translation.json index 9a4393fa..45d4a210 100644 --- a/web-ui/app/locales/pt_BR/translation.json +++ b/web-ui/app/locales/pt_BR/translation.json @@ -84,5 +84,10 @@ "button": "Adicionar e-mail" }, "back-to-inbox": "Voltar", - "footer-text": "Produto em desenvolvimento. Reporte problemas através do" + "footer-text": "Produto em desenvolvimento. Reporte problemas através do", + "login": { + "email": "Seu e-mail", + "password": "Sua senha", + "submit": "Entrar" + } } diff --git a/web-ui/src/login/app.js b/web-ui/src/login/app.js index e6ac3192..dda6148c 100644 --- a/web-ui/src/login/app.js +++ b/web-ui/src/login/app.js @@ -18,18 +18,22 @@ import React from 'react'; import { translate } from 'react-i18next'; -const App = () => ( +export const App = ({ t }) => ( <form className='standard' id='login_form' action='/login' method='post'> <input type='text' name='username' id='email' className='text-field' - placeholder='username' autoFocus='' + placeholder={t('login.email')} autoFocus='' /> <input type='password' name='password' id='password' className='text-field' - placeholder='password' autoComplete='off' + placeholder={t('login.password')} autoComplete='off' /> - <input type='submit' name='login' value='Login' className='button' /> + <input type='submit' name='login' value={t('login.submit')} className='button' /> </form> ); +App.propTypes = { + t: React.PropTypes.func.isRequired +}; + export default translate('', { wait: true })(App); diff --git a/web-ui/src/login/login.js b/web-ui/src/login/login.js index ddbe1943..9a8c9042 100644 --- a/web-ui/src/login/login.js +++ b/web-ui/src/login/login.js @@ -20,14 +20,14 @@ import { render } from 'react-dom'; import a11y from 'react-a11y'; import { I18nextProvider } from 'react-i18next'; -import App from './app'; +import AppWrapper from './app'; import i18n from '../i18n'; if (process.env.NODE_ENV === 'development') a11y(React); render( <I18nextProvider i18n={i18n}> - <App /> + <AppWrapper /> </I18nextProvider>, document.getElementById('root') ); diff --git a/web-ui/test/unit/login/app.spec.js b/web-ui/test/unit/login/app.spec.js new file mode 100644 index 00000000..3b6461cf --- /dev/null +++ b/web-ui/test/unit/login/app.spec.js @@ -0,0 +1,17 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { App } from 'src/login/app'; + +describe('App', () => { + let app; + + beforeEach(() => { + const mockTranslations = key => key; + app = shallow(<App t={mockTranslations} />); + }); + + it('renders login form', () => { + expect(app.find('form').props().action).toEqual('/login'); + }); +}); |