From eeeed9be65be43248d2118e6f13a071b1702c3e8 Mon Sep 17 00:00:00 2001 From: sahar-fehri Date: Wed, 27 Sep 2023 16:48:50 +0200 Subject: [PATCH] fix: fix test --- ...m-page-container-content.component.test.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js index f81301c195ec..5261d935c185 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js @@ -7,6 +7,7 @@ import { INSUFFICIENT_FUNDS_ERROR_KEY, TRANSACTION_ERROR_KEY, } from '../../../../helpers/constants/error-keys'; +import { shortenAddress } from '../../../../helpers/utils/util'; import ConfirmPageContainerContent from './confirm-page-container-content.component'; describe('Confirm Page Container Content', () => { @@ -25,6 +26,17 @@ describe('Confirm Page Container Content', () => { }, }, }, + identities: {}, + tokenList: {}, + }, + confirmTransaction: { + txData: { + txParams: { + gas: '0x153e2', + value: '0x0', + to: '0x0BC30598F0F386371eB3d2195AcAA14C7566534b', + }, + }, }, }; @@ -106,7 +118,7 @@ describe('Confirm Page Container Content', () => { expect(props.onCancel).toHaveBeenCalledTimes(1); }); - it('render contract address name from addressBook in title for contract', async () => { + it('render contract address in the content component', async () => { props.disabled = false; props.toAddress = '0x06195827297c7A80a443b6894d3BDB8824b43896'; props.transactionType = TransactionType.contractInteraction; @@ -114,8 +126,11 @@ describe('Confirm Page Container Content', () => { , store, ); + const expectedAddress = shortenAddress( + mockStore.confirmTransaction.txData.txParams.to, + ); - expect(queryByText('Address Book Account 1')).toBeInTheDocument(); + expect(queryByText(`${expectedAddress}`)).toBeInTheDocument(); }); it('render simple title without address name for simple send', async () => {