Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Sep 27, 2023
1 parent b5538dd commit eeeed9b
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -25,6 +26,17 @@ describe('Confirm Page Container Content', () => {
},
},
},
identities: {},
tokenList: {},
},
confirmTransaction: {
txData: {
txParams: {
gas: '0x153e2',
value: '0x0',
to: '0x0BC30598F0F386371eB3d2195AcAA14C7566534b',
},
},
},
};

Expand Down Expand Up @@ -106,16 +118,19 @@ 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;
const { queryByText } = renderWithProvider(
<ConfirmPageContainerContent {...props} />,
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 () => {
Expand Down

0 comments on commit eeeed9b

Please sign in to comment.