From 286dd74335dcd7deb782d59fff00b7079f8038d0 Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Thu, 5 Dec 2024 10:55:44 +0000 Subject: [PATCH] wip --- .../PendingTransactionAlertMessage.tsx | 21 +++++++++---------- .../usePendingTransactionAlerts.test.ts | 11 ++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx b/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx index afe891974912..472567ddb093 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx +++ b/ui/pages/confirmations/hooks/alerts/transactions/PendingTransactionAlertMessage.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Text } from '../../../../../components/component-library'; +import { ButtonLink, Text } from '../../../../../components/component-library'; import { TextColor, TextVariant, @@ -17,16 +17,15 @@ export const PendingTransactionAlertMessage = () => { data-testid="alert-modal__selected-alert" > {t('pendingTransactionAlertMessage', [ - - - {t('pendingTransactionAlertMessageHyperlink')} - - , + + {t('pendingTransactionAlertMessageHyperlink')} + , ])} ); diff --git a/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts b/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts index ebbb3d577c86..f7be0f93e2c1 100644 --- a/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts +++ b/ui/pages/confirmations/hooks/alerts/transactions/usePendingTransactionAlerts.test.ts @@ -89,6 +89,13 @@ describe('usePendingTransactionAlerts', () => { jest.resetAllMocks(); (useParams as jest.Mock).mockReturnValue({ id: 'mock-transaction-id' }); + + useSelectorMock.mockImplementation((selector) => { + if (selector.toString().includes('pendingApprovalsSortedSelector')) { + return []; + } + return undefined; + }); }); it('returns no alerts if no confirmation', () => { @@ -155,6 +162,10 @@ describe('usePendingTransactionAlerts', () => { return true; } else if (selector.toString().includes('getUnapprovedTransaction')) { return { type: TransactionType.contractInteraction }; + } else if ( + selector.toString().includes('pendingApprovalsSortedSelector') + ) { + return []; } return undefined; });