mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix issue with dapp suggested option being visible in edit gas fee popover even if dapp has no gas suggestion (#13316)
This commit is contained in:
parent
d12097ac1c
commit
bd33512c2a
@ -79,7 +79,7 @@ const render = ({ txProps, contextProps } = {}) => {
|
||||
|
||||
describe('EditGasFeePopover', () => {
|
||||
it('should renders low / medium / high options', () => {
|
||||
render({ txProps: { dappSuggestedGasFees: {} } });
|
||||
render({ txProps: { dappSuggestedGasFees: { maxFeePerGas: '0x5208' } } });
|
||||
|
||||
expect(screen.queryByText('🐢')).toBeInTheDocument();
|
||||
expect(screen.queryByText('🦊')).toBeInTheDocument();
|
||||
|
@ -64,7 +64,8 @@ const EditGasItem = ({ priorityLevel }) => {
|
||||
|
||||
if (
|
||||
priorityLevel === PRIORITY_LEVELS.DAPP_SUGGESTED &&
|
||||
!dappSuggestedGasFees
|
||||
!dappSuggestedGasFees?.maxFeePerGas &&
|
||||
!dappSuggestedGasFees?.gasPrice
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
@ -150,6 +150,23 @@ describe('EditGasItem', () => {
|
||||
expect(screen.queryByTitle('0.0000315 ETH')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should not renders site gas estimate option for priorityLevel dappSuggested if site does not provided gas estimates', () => {
|
||||
renderComponent({
|
||||
componentProps: { priorityLevel: 'dappSuggested' },
|
||||
transactionProps: {},
|
||||
});
|
||||
expect(
|
||||
screen.queryByRole('button', { name: 'dappSuggested' }),
|
||||
).not.toBeInTheDocument();
|
||||
renderComponent({
|
||||
componentProps: { priorityLevel: 'dappSuggested' },
|
||||
transactionProps: { dappSuggestedGasFees: { gas: '0x59682f10' } },
|
||||
});
|
||||
expect(
|
||||
screen.queryByRole('button', { name: 'dappSuggested' }),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should renders advance gas estimate option for priorityLevel custom', () => {
|
||||
renderComponent({
|
||||
componentProps: { priorityLevel: 'custom' },
|
||||
|
Loading…
Reference in New Issue
Block a user