From b8b0de78a3f0452a3e0db2c5cb41d89032dd392c Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 8 Jun 2023 17:30:15 -0600 Subject: [PATCH] Sync removeNetworkConfiguration tests w/ core (#19427) This makes it easier to visually compare differences in the NetworkController unit tests between core and this repo. --- .../network/network-controller.test.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/scripts/controllers/network/network-controller.test.ts b/app/scripts/controllers/network/network-controller.test.ts index d3b89c9c1..a74a38fc2 100644 --- a/app/scripts/controllers/network/network-controller.test.ts +++ b/app/scripts/controllers/network/network-controller.test.ts @@ -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, }, },