Skip to content

Commit

Permalink
fix: demo create success modal content (deriv-com#17557)
Browse files Browse the repository at this point in the history
  • Loading branch information
lubega-deriv authored Dec 2, 2024
1 parent da17d7c commit 28c3eb0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CTraderSuccessModal = ({ createdAccount, isDemo, walletCurrencyType }: TCT
if (isLoading) return <Loader />;

const description = isDemo
? localize("Let's practise trading with {{ctraderBalance}} virtual funds.", {
? localize('Practise trading with {{ctraderBalance}} virtual funds.', {
ctraderBalance: cTraderAccount.display_balance,
})
: localize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const DxtradeEnterPasswordModal = () => {

const successDescription = useMemo(() => {
return accountType === 'demo'
? localize("Let's practise trading with {{dxtradeBalance}} virtual funds.", { dxtradeBalance })
? localize('Practise trading with {{dxtradeBalance}} virtual funds.', { dxtradeBalance })
: localize(
'Transfer funds from your {{currency}} Wallet to your {{dxtradeTitle}} account to start trading.',
{ currency: activeWallet?.currency, dxtradeTitle: PlatformDetails.dxtrade.title }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const MT5AccountAdded: FC<TProps> = ({ account, marketType, platform, product })

const renderSuccessDescription = useMemo(() => {
if (isDemo) {
return localize("Let's practise trading with {{accountBalance}} virtual funds.", {
return localize('Practise trading with {{accountBalance}} virtual funds.', {
accountBalance: addedAccount?.display_balance,
});
}
Expand Down Expand Up @@ -136,7 +136,10 @@ const MT5AccountAdded: FC<TProps> = ({ account, marketType, platform, product })
i18n_default_text='Your {{marketTypeTitle}} {{demoTitle}} account is ready'
values={{
demoTitle: isDemo ? localize('demo') : landingCompanyName,
marketTypeTitle,
marketTypeTitle:
isDemo && platform === CFD_PLATFORMS.MT5
? `${CFD_PLATFORMS.MT5.toUpperCase()} ${getMarketTypeDetails(localize, product)[marketType].title}`
: marketTypeTitle,
}}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ describe('MT5AccountAdded', () => {
</WalletsAuthProvider>
</APIProvider>
);
expect(screen.getByText('Your Financial demo account is ready')).toBeInTheDocument();
expect(screen.getByText("Let's practise trading with 10,000.00 USD virtual funds.")).toBeInTheDocument();
expect(screen.getByText('Your MT5 Financial demo account is ready')).toBeInTheDocument();
expect(screen.getByText('Practise trading with 10,000.00 USD virtual funds.')).toBeInTheDocument();
const okButton = screen.getAllByRole('button', { name: 'OK' })[0];
expect(okButton).toBeInTheDocument();
expect(okButton).toBeEnabled();
Expand Down

0 comments on commit 28c3eb0

Please sign in to comment.