mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-01 21:57:06 +01:00
d1cea85f33
* Rename `provider` to `providerConfig` The network controller `provider` state has been renamed to `providerConfig`. This better reflects what this state is, and makes this controller more closely aligned with the core network controller. All references to the provider configuration have been updated to prefer `providerConfig` over `provider`, to make the distinction clear between a provider and provider config. Closes #18902 * Add migration
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
import React from 'react';
|
|
import { screen, waitFor } from '@testing-library/react';
|
|
|
|
import { CHAIN_IDS } from '../../../../../shared/constants/network';
|
|
import { GasFeeContextProvider } from '../../../../contexts/gasFee';
|
|
import { renderWithProvider } from '../../../../../test/jest';
|
|
import configureStore from '../../../../store/store';
|
|
|
|
import GasDetailsItemTitle from './gas-details-item-title';
|
|
|
|
jest.mock('../../../../store/actions', () => ({
|
|
disconnectGasFeeEstimatePoller: jest.fn(),
|
|
getGasFeeEstimatesAndStartPolling: jest
|
|
.fn()
|
|
.mockImplementation(() => Promise.resolve()),
|
|
addPollingTokenToAppState: jest.fn(),
|
|
getGasFeeTimeEstimate: jest.fn().mockImplementation(() => Promise.resolve()),
|
|
}));
|
|
|
|
const render = () => {
|
|
const store = configureStore({
|
|
metamask: {
|
|
providerConfig: { chainId: CHAIN_IDS.MAINNET },
|
|
cachedBalances: {},
|
|
accounts: {
|
|
'0xAddress': {
|
|
address: '0xAddress',
|
|
balance: '0x176e5b6f173ebe66',
|
|
},
|
|
},
|
|
selectedAddress: '0xAddress',
|
|
},
|
|
});
|
|
|
|
return renderWithProvider(
|
|
<GasFeeContextProvider transaction={{ txParams: {} }}>
|
|
<GasDetailsItemTitle userAcknowledgedGasMissing={false} />
|
|
</GasFeeContextProvider>,
|
|
store,
|
|
);
|
|
};
|
|
|
|
describe('GasDetailsItem', () => {
|
|
it('should render label', async () => {
|
|
render();
|
|
await waitFor(() => {
|
|
expect(screen.queryByText('Gas')).toBeInTheDocument();
|
|
expect(screen.queryByText('(estimated)')).toBeInTheDocument();
|
|
});
|
|
});
|
|
});
|