Skip to content

Commit

Permalink
chore: updates for e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Pickel committed Sep 18, 2019
1 parent e2a628e commit 920afe8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
5 changes: 1 addition & 4 deletions src/components/common/header-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ export function HeaderMenu(): JSX.Element {
activeClassName="active"
to="/split-invoice"
>
<FormattedMessage
id="SPLIT_INVOICE_LINK"
defaultMessage="Split Invoice"
/>
<FormattedMessage id="SPLIT_INVOICE_LINK" />
</NavLink>
)}
<NavLink activeClassName="active" to="/metrics">
Expand Down
24 changes: 13 additions & 11 deletions src/components/transaction/split-invoice/split-invoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,7 @@ export class SplitInvoiceForm extends React.Component<{}, State> {
<WrappedIdleTimer />
<TextCenter margin="3rem">
<h1>
<FormattedMessage
id="SPLIT_INVOICE_HEADLINE"
defaultMessage="Split Invoice"
/>
<FormattedMessage id="SPLIT_INVOICE_HEADLINE" />
</h1>
</TextCenter>

Expand Down Expand Up @@ -354,13 +351,18 @@ export class SplitInvoiceForm extends React.Component<{}, State> {
</>
)}
</P>
<PrimaryButton
isRound
onClick={this.submitSplitInvoice}
disabled={!this.submitIsValid()}
>
<AcceptIcon />
</PrimaryButton>
<FormattedMessage id="SPLIT_INVOICE_SUBMIT">
{text => (
<PrimaryButton
title={text as string}
isRound
onClick={this.submitSplitInvoice}
disabled={!this.submitIsValid()}
>
<AcceptIcon />
</PrimaryButton>
)}
</FormattedMessage>
</NotificationContainer>
</>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from 'react';
import { withTheme, Button, AcceptIcon } from 'bricks-of-sand';

export const AcceptButton = withTheme(
({ theme, margin, onClick, disabled, type = 'button' }: any) => (
({ theme, margin, onClick, disabled, type = 'button', title }: any) => (
<Button
title={title}
disabled={disabled}
type={type}
onClick={onClick}
Expand Down
9 changes: 7 additions & 2 deletions src/components/user/edit-user-form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { Block, CancelButton, Flex, Input } from 'bricks-of-sand';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import { useDispatch } from 'redux-react-hook';
import { useUser } from '../../store';
import { startUpdateUser } from '../../store/reducers';
Expand All @@ -15,6 +15,7 @@ interface Props {
}

export const UserEditForm = (props: Props) => {
const intl = useIntl();
const [name, setName] = React.useState(''),
[email, setEmail] = React.useState(''),
[isDisabled, setDisabled] = React.useState(false),
Expand Down Expand Up @@ -90,7 +91,11 @@ export const UserEditForm = (props: Props) => {
</label>
<div>
<CancelButton margin="0 1rem" onClick={props.onCancel} />
<AcceptButton type="submit" />

<AcceptButton
type="submit"
title={intl.formatMessage({ id: 'USER_EDIT_TRIGGER' })}
/>
</div>
</Flex>
{isDisabled && <FormattedMessage id="USER_EDIT_ACTIVE_WARNING" />}
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ export const en = {
METRICS_HEADLINE: 'Metrics',
ARTICLE_ACTIVE_HEADLINE: 'Active Articles',
ARTICLE_INACTIVE_HEADLINE: 'Inactive Articles',
SPLIT_INVOICE_LINK: 'Split Invoice',
SPLIT_INVOICE_HEADLINE: 'Split Invoice',
SPLIT_INVOICE_SUBMIT: 'submit the split invoice',
};

0 comments on commit 920afe8

Please sign in to comment.