1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 11:46:13 +02:00
metamask-extension/ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.test.js

34 lines
1.0 KiB
JavaScript
Raw Normal View History

import React from 'react';
import { renderWithProvider } from '../../../../../test/jest';
import { GasFeeContext } from '../../../../contexts/gasFee';
import configureStore from '../../../../store/store';
import NetworkStatistics from './network-statistics';
const renderComponent = (gasFeeEstimates) => {
const store = configureStore({});
return renderWithProvider(
<GasFeeContext.Provider value={{ gasFeeEstimates }}>
<NetworkStatistics />
</GasFeeContext.Provider>,
store,
);
};
describe('NetworkStatistics', () => {
2022-01-06 23:40:31 +01:00
it('should render the latest base fee without decimals', () => {
const { getByText } = renderComponent({
estimatedBaseFee: '50.0112',
});
2022-01-06 23:40:31 +01:00
expect(getByText('50 GWEI')).toBeInTheDocument();
});
2022-01-06 23:40:31 +01:00
it('should render a version of latest priority fee range pulled from context, lower range rounded to 1 decimal place', () => {
const { getByText } = renderComponent({
latestPriorityFeeRange: ['1.000001668', '2.5634234'],
});
2022-01-06 23:40:31 +01:00
expect(getByText('1 - 3 GWEI')).toBeInTheDocument();
});
});