From cd1b9641c5ec0913f74b1aa760f260b1132cec93 Mon Sep 17 00:00:00 2001 From: Nada Date: Fri, 2 Aug 2024 22:27:33 +0400 Subject: [PATCH] fix: failing tests --- src/components/AppFooter/__tests__/LanguageSettings.spec.tsx | 1 + .../AppHeader/MobileMenu/__tests__/MenuHeader.spec.tsx | 1 + .../AppHeader/MobileMenu/__tests__/MobileMenu.spec.tsx | 1 + src/constants/languages.tsx | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/AppFooter/__tests__/LanguageSettings.spec.tsx b/src/components/AppFooter/__tests__/LanguageSettings.spec.tsx index 34248a4d..189b82d6 100644 --- a/src/components/AppFooter/__tests__/LanguageSettings.spec.tsx +++ b/src/components/AppFooter/__tests__/LanguageSettings.spec.tsx @@ -4,6 +4,7 @@ import userEvent from '@testing-library/user-event'; import LanguageSettings from '../LanguageSettings'; jest.mock('@deriv-com/translations', () => ({ + getAllowedLanguages: jest.fn(() => ({ EN: 'English' })), useTranslations: jest.fn(), })); diff --git a/src/components/AppHeader/MobileMenu/__tests__/MenuHeader.spec.tsx b/src/components/AppHeader/MobileMenu/__tests__/MenuHeader.spec.tsx index 6bb74d85..05b8eda6 100644 --- a/src/components/AppHeader/MobileMenu/__tests__/MenuHeader.spec.tsx +++ b/src/components/AppHeader/MobileMenu/__tests__/MenuHeader.spec.tsx @@ -12,6 +12,7 @@ jest.mock('@deriv-com/ui', () => ({ })); jest.mock('@deriv-com/translations', () => ({ + getAllowedLanguages: jest.fn(() => ({ EN: 'English' })), useTranslations: jest.fn(), })); diff --git a/src/components/AppHeader/MobileMenu/__tests__/MobileMenu.spec.tsx b/src/components/AppHeader/MobileMenu/__tests__/MobileMenu.spec.tsx index 787a3795..e3499e3f 100644 --- a/src/components/AppHeader/MobileMenu/__tests__/MobileMenu.spec.tsx +++ b/src/components/AppHeader/MobileMenu/__tests__/MobileMenu.spec.tsx @@ -29,6 +29,7 @@ jest.mock('@deriv-com/api-hooks', () => ({ })); jest.mock('@deriv-com/translations', () => ({ + getAllowedLanguages: jest.fn(() => ({ EN: 'English' })), useTranslations: jest.fn().mockReturnValue({ currentLang: 'EN', localize: jest.fn(text => text), diff --git a/src/constants/languages.tsx b/src/constants/languages.tsx index 0f991093..fd8e8f50 100644 --- a/src/constants/languages.tsx +++ b/src/constants/languages.tsx @@ -1,4 +1,4 @@ -import { SVGProps } from 'react'; +import { ComponentType, SVGProps } from 'react'; import { FlagArabLeagueIcon, FlagBangladeshIcon, @@ -25,7 +25,7 @@ import { import { getAllowedLanguages } from '@deriv-com/translations'; type TFlagComponent = { - [key: string]: React.ComponentType>; + [key: string]: ComponentType>; }; const flagComponents: TFlagComponent = {