1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js
Mark Stacey d1cea85f33
Rename provider to providerConfig (#18907)
* 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
2023-05-02 13:23:20 -02:30

28 lines
829 B
JavaScript

import React from 'react';
import configureMockStore from 'redux-mock-store';
import { renderWithProvider } from '../../../../test/jest/rendering';
import AdvancedGasControls from './advanced-gas-controls.component';
const renderComponent = (props) => {
const store = configureMockStore([])({
metamask: { identities: [], providerConfig: {} },
});
return renderWithProvider(<AdvancedGasControls {...props} />, store);
};
describe('AdvancedGasControls Component', () => {
it('should render correctly', () => {
expect(() => {
renderComponent();
}).not.toThrow();
});
it('should render gasLimit and gasPrice inputs', () => {
const { queryByText } = renderComponent();
expect(queryByText('Gas limit')).toBeInTheDocument();
expect(queryByText('Gas price')).toBeInTheDocument();
});
});