1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Sync removeNetworkConfiguration tests w/ core (#19427)

This makes it easier to visually compare differences in the
NetworkController unit tests between core and this repo.
This commit is contained in:
Elliot Winkler 2023-06-08 17:30:15 -06:00 committed by GitHub
parent 987c08f75a
commit b8b0de78a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4544,26 +4544,25 @@ describe('NetworkController', () => {
});
describe('removeNetworkConfigurations', () => {
it('removes a network configuration', async () => {
const networkConfigurationId = 'testNetworkConfigurationId';
it('remove a network configuration', async () => {
const testNetworkConfigurationId = 'testNetworkConfigurationId';
await withController(
{
state: {
networkConfigurations: {
[networkConfigurationId]: {
id: networkConfigurationId,
rpcUrl: 'https://test-rpc-url',
[testNetworkConfigurationId]: {
rpcUrl: 'https://rpc-url.com',
ticker: 'old_rpc_ticker',
nickname: 'old_rpc_chainName',
nickname: 'old_rpc_nickname',
rpcPrefs: { blockExplorerUrl: 'testchainscan.io' },
chainId: '0x1',
chainId: toHex(1337),
id: testNetworkConfigurationId,
},
},
},
},
async ({ controller }) => {
controller.removeNetworkConfiguration(networkConfigurationId);
controller.removeNetworkConfiguration(testNetworkConfigurationId);
expect(
controller.store.getState().networkConfigurations,
).toStrictEqual({});
@ -4583,7 +4582,7 @@ describe('NetworkController', () => {
ticker: 'old_rpc_ticker',
nickname: 'old_rpc_nickname',
rpcPrefs: { blockExplorerUrl: 'testchainscan.io' },
chainId: '0x1',
chainId: toHex(1337),
id: testNetworkConfigurationId,
},
},