diff --git a/apps/trading-e2e/src/integration/deposit.cy.ts b/apps/trading-e2e/src/integration/deposit.cy.ts index dad973e56..0f0fae630 100644 --- a/apps/trading-e2e/src/integration/deposit.cy.ts +++ b/apps/trading-e2e/src/integration/deposit.cy.ts @@ -87,7 +87,10 @@ describe('deposit form validation', { tags: '@smoke' }, () => { .clear() .type('850') .next(`[data-testid="${formFieldError}"]`) - .should('have.text', 'Insufficient amount in Ethereum wallet'); + .should( + 'have.text', + "You can't deposit more than you have in your Ethereum wallet, 800 tEURO" + ); }); }); diff --git a/libs/deposits/src/lib/approve-notification.tsx b/libs/deposits/src/lib/approve-notification.tsx index 9b2d6a62f..9f3a006ce 100644 --- a/libs/deposits/src/lib/approve-notification.tsx +++ b/libs/deposits/src/lib/approve-notification.tsx @@ -51,11 +51,12 @@ export const ApproveNotification = ({ intent={intent} testId="approve-default" message={t( - `Before you can make a deposit of your chosen asset, ${selectedAsset?.symbol}, you need to approve its use in your Ethereum wallet` + 'Before you can make a deposit of your chosen asset, %s, you need to approve its use in your Ethereum wallet', + selectedAsset?.symbol )} buttonProps={{ size: 'sm', - text: `Approve ${selectedAsset?.symbol}`, + text: t('Approve %s', selectedAsset?.symbol), action: onApprove, dataTestId: 'approve-submit', }} @@ -68,13 +69,12 @@ export const ApproveNotification = ({ intent={intent} testId="reapprove-default" message={t( - `Approve again to deposit more than ${formatNumber( - balances.allowance.toString() - )}` + 'Approve again to deposit more than %s', + formatNumber(balances.allowance.toString()) )} buttonProps={{ size: 'sm', - text: `Approve ${selectedAsset?.symbol}`, + text: t('Approve %s', selectedAsset?.symbol), action: onApprove, dataTestId: 'reapprove-submit', }} @@ -157,7 +157,8 @@ const ApprovalTxFeedback = ({ intent={Intent.Warning} testId="approve-requested" message={t( - `Go to your Ethereum wallet and approve the transaction to enable the use of ${selectedAsset?.symbol}` + 'Go to your Ethereum wallet and approve the transaction to enable the use of %s', + selectedAsset?.symbol )} /> @@ -174,7 +175,8 @@ const ApprovalTxFeedback = ({ <>
{t( - `Your ${selectedAsset?.symbol} approval is being confirmed by the Ethereum network. When this is complete, you can continue your deposit` + 'Your %s approval is being confirmed by the Ethereum network. When this is complete, you can continue your deposit', + selectedAsset?.symbol )}{' '}
{txLink &&{txLink}
} @@ -194,13 +196,10 @@ const ApprovalTxFeedback = ({ message={ <>- {t( - `You can now make deposits in ${ - selectedAsset?.symbol - }, up to a maximum of ${formatNumber( - allowance?.toString() || 0 - )}` - )} + {t('You approved deposits of up to %s %s.', [ + selectedAsset?.symbol, + formatNumber(allowance?.toString() || 0), + ])}
{txLink &&{txLink}
} > diff --git a/libs/deposits/src/lib/deposit-form.spec.tsx b/libs/deposits/src/lib/deposit-form.spec.tsx index 3ce7565b4..8a3e3fde4 100644 --- a/libs/deposits/src/lib/deposit-form.spec.tsx +++ b/libs/deposits/src/lib/deposit-form.spec.tsx @@ -1,4 +1,11 @@ -import { waitFor, fireEvent, render, screen } from '@testing-library/react'; +import { + waitFor, + fireEvent, + render, + screen, + act, +} from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; import BigNumber from 'bignumber.js'; import type { DepositFormProps } from './deposit-form'; import { DepositForm } from './deposit-form'; @@ -141,12 +148,14 @@ describe('Deposit form', () => { fireEvent.submit(screen.getByTestId('deposit-form')); expect( - await screen.findByText('Insufficient amount in Ethereum wallet') + await screen.findByText( + "You can't deposit more than you have in your Ethereum wallet, 5" + ) ).toBeInTheDocument(); }); it('fails when submitted amount is more than the maximum limit', async () => { - render(