Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed Aug 2, 2024
1 parent 71fb065 commit cd1b964
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jest.mock('@deriv-com/ui', () => ({
}));

jest.mock('@deriv-com/translations', () => ({
getAllowedLanguages: jest.fn(() => ({ EN: 'English' })),
useTranslations: jest.fn(),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/constants/languages.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SVGProps } from 'react';
import { ComponentType, SVGProps } from 'react';
import {
FlagArabLeagueIcon,
FlagBangladeshIcon,
Expand All @@ -25,7 +25,7 @@ import {
import { getAllowedLanguages } from '@deriv-com/translations';

type TFlagComponent = {
[key: string]: React.ComponentType<SVGProps<SVGSVGElement>>;
[key: string]: ComponentType<SVGProps<SVGSVGElement>>;
};

const flagComponents: TFlagComponent = {
Expand Down

0 comments on commit cd1b964

Please sign in to comment.