From e4c4670e30bb27852b60408ef78bdb4507b4d38e Mon Sep 17 00:00:00 2001 From: arshad-rao-deriv Date: Mon, 14 Aug 2023 20:08:11 +0400 Subject: [PATCH 1/3] fix: show correct platform on trader's hub onboarding --- .../src/components/onboarding-new/static-dashboard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx index 4fe05bb469dd..2c86c0abd422 100644 --- a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx +++ b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx @@ -270,11 +270,11 @@ const StaticDashboard = observer( availability='All' has_applauncher_account={has_applauncher_account} is_item_blurry={is_blurry.platformlauncher} - has_divider={!eu_user} + has_divider={!eu_user && !financial_restricted_countries} /> - {!eu_user && ( + {!eu_user && !financial_restricted_countries && (
- {!is_eu_user && !CFDs_restricted_countries && ( + {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && ( )} - {!is_eu_user && !CFDs_restricted_countries && ( + {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && (
Date: Tue, 15 Aug 2023 13:52:22 +0400 Subject: [PATCH 2/3] test: :white_check_mark: added onboarding test for financial restricted countries --- .../__tests__/static-dashboard.spec.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx b/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx index 1b2ebf1886e3..017a8e222e88 100644 --- a/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx +++ b/packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.spec.tsx @@ -4,6 +4,13 @@ import { StoreProvider, mockStore } from '@deriv/stores'; import { render, screen } from '@testing-library/react'; import StaticDashboard, { TStaticDashboard } from '../static-dashboard'; +jest.mock('../static-trading-app-card.tsx', () => + jest.fn(({ name }) =>
{name}
) +); +jest.mock('../static-cfd-account-manager.tsx', () => + jest.fn(({ appname }) =>
{appname}
) +); + describe('StaticDashboard', () => { const render_container = (mock_store_override = {}) => { const mock_store = mockStore(mock_store_override); @@ -65,4 +72,15 @@ describe('StaticDashboard', () => { const dashboard_sections = screen.getByTestId('dt_onboarding_dashboard'); expect(dashboard_sections).toHaveClass('static-dashboard--eu'); }); + + it('should display correct platforms if the user residence is in financial restricted countries', () => { + render_container({ client: { is_logged_in: true }, traders_hub: { financial_restricted_countries: true } }); + const trading_app_card = screen.getAllByTestId('trading_app_card'); + const cfd_account_manager = screen.getAllByTestId('cfd_account_manager'); + expect(trading_app_card.length).not.toBeGreaterThan(1); + expect(trading_app_card[0]).toHaveTextContent('Deriv Trader'); + expect(cfd_account_manager.length).not.toBeGreaterThan(2); + expect(cfd_account_manager[0]).toHaveTextContent('Deriv account'); + expect(cfd_account_manager[1]).toHaveTextContent('Financial'); + }); }); From 875becac21e12652fecf812a9b43d2a8632ed885 Mon Sep 17 00:00:00 2001 From: arshad-rao-deriv Date: Thu, 17 Aug 2023 20:26:14 +0400 Subject: [PATCH 3/3] fix: fixed cfd restricted countries --- .../appstore/src/components/onboarding-new/static-dashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx index 2c86c0abd422..91844ad2c5b3 100644 --- a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx +++ b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx @@ -429,7 +429,7 @@ const StaticDashboard = observer(
- {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && ( + {!is_eu_user && !financial_restricted_countries && (