Skip to content

Commit

Permalink
fix edit gas popover test
Browse files Browse the repository at this point in the history
  • Loading branch information
bergeron committed Oct 3, 2023
1 parent 0a50779 commit 25a9129
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { ETH } from '../../../helpers/constants/common';
import configureStore from '../../../store/store';
import { GasFeeContextProvider } from '../../../contexts/gasFee';

import {
TransactionStatus,
TransactionType,
} from '../../../../shared/constants/transaction';
import EditGasFeePopover from './edit-gas-fee-popover';

jest.mock('../../../store/actions', () => ({
Expand Down Expand Up @@ -112,13 +116,25 @@ describe('EditGasFeePopover', () => {
});

it('should not show insufficient balance message if transaction value is less than balance', () => {
render({ txProps: { userFeeLevel: 'high', txParams: { value: '0x64' } } });
render({
txProps: {
status: TransactionStatus.unapproved,
type: TransactionType.simpleSend,
userFeeLevel: 'high',
txParams: { value: '0x64', from: '0xAddress' },
},
});
expect(screen.queryByText('Insufficient funds.')).not.toBeInTheDocument();
});

it('should show insufficient balance message if transaction value is more than balance', () => {
render({
txProps: { userFeeLevel: 'high', txParams: { value: '0x5208' } },
txProps: {
status: TransactionStatus.unapproved,
type: TransactionType.simpleSend,
userFeeLevel: 'high',
txParams: { value: '0x5208', from: '0xAddress' },
},
});
expect(screen.queryByText('Insufficient funds.')).toBeInTheDocument();
});
Expand Down

0 comments on commit 25a9129

Please sign in to comment.