mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 22:24:27 +01:00
0bc1eeaf37
* Deprecating Rinkeby, setting default debug network to Goerli * Deprecating Ropsten and Kovan * Conflict fix * Remove unused localization, test fixes * Add migration for moving used deprecated testnets to custom networks * Fix migrator test * Add more unit tests * Migration updates provider type to rpc if deprecated network is selected * Migration fully and correctly updates the provider if selected network is a deprecated testnet * Continue to show deprecation warning on each of rinkeby, ropsten and kovan * Add rpcUrl deprecation message to loading screen * Removing mayBeFauceting prop Co-authored-by: Dan Miller <danjm.com@gmail.com>
52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
import React from 'react';
|
|
import configureMockStore from 'redux-mock-store';
|
|
import { renderWithProvider } from '../../../../test/jest/rendering';
|
|
import NetworksTab from '.';
|
|
|
|
const mockState = {
|
|
metamask: {
|
|
provider: {
|
|
chainId: '0x539',
|
|
nickname: '',
|
|
rpcPrefs: {},
|
|
rpcUrl: 'http://localhost:8545',
|
|
ticker: 'ETH',
|
|
type: 'localhost',
|
|
},
|
|
frequentRpcListDetail: [],
|
|
},
|
|
appState: {
|
|
networksTabSelectedRpcUrl: 'http://localhost:8545',
|
|
},
|
|
};
|
|
|
|
const renderComponent = (props) => {
|
|
const store = configureMockStore([])(mockState);
|
|
return renderWithProvider(<NetworksTab {...props} />, store);
|
|
};
|
|
|
|
describe('NetworksTab Component', () => {
|
|
it('should render networks tab content correctly', () => {
|
|
const { queryByText } = renderComponent({
|
|
addNewNetwork: false,
|
|
});
|
|
|
|
expect(queryByText('Ethereum Mainnet')).toBeInTheDocument();
|
|
expect(queryByText('Goerli test network')).toBeInTheDocument();
|
|
expect(queryByText('Sepolia test network')).toBeInTheDocument();
|
|
expect(queryByText('Add network')).toBeInTheDocument();
|
|
});
|
|
it('should render add network form correctly', () => {
|
|
const { queryByText } = renderComponent({
|
|
addNewNetwork: true,
|
|
});
|
|
expect(queryByText('Network name')).toBeInTheDocument();
|
|
expect(queryByText('New RPC URL')).toBeInTheDocument();
|
|
expect(queryByText('Chain ID')).toBeInTheDocument();
|
|
expect(queryByText('Currency symbol')).toBeInTheDocument();
|
|
expect(queryByText('Block explorer URL')).toBeInTheDocument();
|
|
expect(queryByText('Cancel')).toBeInTheDocument();
|
|
expect(queryByText('Save')).toBeInTheDocument();
|
|
});
|
|
});
|