diff --git a/packages/account/src/Components/self-exclusion/self-exclusion-article.tsx b/packages/account/src/Components/self-exclusion/self-exclusion-article.tsx index 3fa99c012369..2936f2d59593 100644 --- a/packages/account/src/Components/self-exclusion/self-exclusion-article.tsx +++ b/packages/account/src/Components/self-exclusion/self-exclusion-article.tsx @@ -12,6 +12,7 @@ const SelfExclusionArticle = observer(() => { const { is_deriv_crypto } = React.useContext(PlatformContext); const { ui } = useStore(); const { is_desktop, is_mobile } = ui; + return ( [ +export const API_TOKEN_CARD_DETAILS = [ { name: 'read', display_name: , diff --git a/packages/account/src/Sections/Security/ApiToken/api-token.tsx b/packages/account/src/Sections/Security/ApiToken/api-token.tsx index 1dfd8470140b..0697114e9363 100644 --- a/packages/account/src/Sections/Security/ApiToken/api-token.tsx +++ b/packages/account/src/Sections/Security/ApiToken/api-token.tsx @@ -10,7 +10,7 @@ import { TToken } from 'Types'; import { ApiTokenContext, ApiTokenArticle, ApiTokenCard, ApiTokenTable } from 'Components/api-token'; import InlineNoteWithIcon from 'Components/inline-note-with-icon'; import LoadErrorMessage from 'Components/load-error-message'; -import { getApiTokenCardDetails, TOKEN_LIMITS } from 'Constants/api-token-card-details'; +import { API_TOKEN_CARD_DETAILS, TOKEN_LIMITS } from 'Constants/api-token-card-details'; import './api-token.scss'; type AptTokenState = { @@ -181,8 +181,6 @@ const ApiToken = observer(() => { deleteToken, }; - const api_token_card_array = getApiTokenCardDetails(); - return (
@@ -209,7 +207,7 @@ const ApiToken = observer(() => { } >
- {api_token_card_array.map(card => ( + {API_TOKEN_CARD_DETAILS.map(card => ( { - const original_module = jest.requireActual('@deriv/components'); - return { - ...original_module, - Icon: jest.fn(() =>
mockedIcon
), - }; -}); +jest.mock('@deriv/components', () => ({ + ...jest.requireActual('@deriv/components'), + Icon: jest.fn(() =>
mockedIcon
), +})); describe('ClosingAccountPendingContent', () => { const mock_props: React.ComponentProps = { diff --git a/packages/account/src/Sections/Security/LoginHistory/list-cell.tsx b/packages/account/src/Sections/Security/LoginHistory/list-cell.tsx index 4bde87069bf2..0010e81a27e3 100644 --- a/packages/account/src/Sections/Security/LoginHistory/list-cell.tsx +++ b/packages/account/src/Sections/Security/LoginHistory/list-cell.tsx @@ -9,7 +9,7 @@ type TListCell = { align?: 'left' | 'right'; }; -const ListCell = ({ title, text, className, align }: TListCell) => ( +const ListCell = ({ title, text, className, align = 'left' }: TListCell) => ( {title} diff --git a/packages/account/src/Sections/Security/LoginHistory/login-history.tsx b/packages/account/src/Sections/Security/LoginHistory/login-history.tsx index ad7b43f04272..4b352e9c5cbc 100644 --- a/packages/account/src/Sections/Security/LoginHistory/login-history.tsx +++ b/packages/account/src/Sections/Security/LoginHistory/login-history.tsx @@ -23,7 +23,7 @@ const LoginHistory = observer(() => { return ( - {login_history.length && } + ); }); diff --git a/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx b/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx index 284f7491b799..6fa145c391d6 100644 --- a/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx +++ b/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx @@ -61,7 +61,7 @@ const mock = { }; let store = mockStore(mock); describe('', () => { - let mock_props = { + let mock_props: React.ComponentProps = { overlay_ref: document.createElement('div'), setIsOverlayShown: jest.fn(), }; diff --git a/packages/api/src/hooks/useLoginHistory.ts b/packages/api/src/hooks/useLoginHistory.ts index c2e394784575..5edcd03d3e9a 100644 --- a/packages/api/src/hooks/useLoginHistory.ts +++ b/packages/api/src/hooks/useLoginHistory.ts @@ -20,7 +20,7 @@ const useLoginHistory = (payload?: TUseLoginHistoryPayload) => { const modified_login_history = useMemo( () => ({ ...data?.login_history, - formatted_data: getLoginHistoryFormattedData(data?.login_history || []), + formatted_data: getLoginHistoryFormattedData(data?.login_history ?? []), }), [data?.login_history] );