mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-10-22 19:26:13 +02: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', () => {
|
describe('EditGasFeePopover', () => {
|
||||||
it('should renders low / medium / high options', () => {
|
it('should renders low / medium / high options', () => {
|
||||||
render({ txProps: { dappSuggestedGasFees: {} } });
|
render({ txProps: { dappSuggestedGasFees: { maxFeePerGas: '0x5208' } } });
|
||||||
|
|
||||||
expect(screen.queryByText('🐢')).toBeInTheDocument();
|
expect(screen.queryByText('🐢')).toBeInTheDocument();
|
||||||
expect(screen.queryByText('🦊')).toBeInTheDocument();
|
expect(screen.queryByText('🦊')).toBeInTheDocument();
|
||||||
|
@ -64,7 +64,8 @@ const EditGasItem = ({ priorityLevel }) => {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
priorityLevel === PRIORITY_LEVELS.DAPP_SUGGESTED &&
|
priorityLevel === PRIORITY_LEVELS.DAPP_SUGGESTED &&
|
||||||
!dappSuggestedGasFees
|
!dappSuggestedGasFees?.maxFeePerGas &&
|
||||||
|
!dappSuggestedGasFees?.gasPrice
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,23 @@ describe('EditGasItem', () => {
|
|||||||
expect(screen.queryByTitle('0.0000315 ETH')).toBeInTheDocument();
|
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', () => {
|
it('should renders advance gas estimate option for priorityLevel custom', () => {
|
||||||
renderComponent({
|
renderComponent({
|
||||||
componentProps: { priorityLevel: 'custom' },
|
componentProps: { priorityLevel: 'custom' },
|
||||||
|
Loading…
Reference in New Issue
Block a user