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'); + }); }); diff --git a/packages/appstore/src/components/onboarding-new/static-dashboard.tsx b/packages/appstore/src/components/onboarding-new/static-dashboard.tsx index 4fe05bb469dd..91844ad2c5b3 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 && !financial_restricted_countries && ( )} - {!is_eu_user && !CFDs_restricted_countries && ( + {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && (