Skip to content

Commit

Permalink
Improve mocks for 'clear network status' test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt committed May 8, 2023
1 parent a634e4c commit afb95de
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/network-controller/tests/NetworkController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3529,9 +3529,13 @@ function refreshNetworkTests({
request: {
method: 'net_version',
},
response: {
result: '1',
response: SUCCESSFUL_NET_VERSION_RESPONSE,
},
{
request: {
method: 'eth_getBlockByNumber',
},
response: SUCCESSFUL_ETH_GET_BLOCK_BY_NUMBER_RESPONSE,
},
// Called during network lookup after resetting connection.
// Delayed to ensure that we can check the network status
Expand All @@ -3541,9 +3545,14 @@ function refreshNetworkTests({
request: {
method: 'net_version',
},
response: {
result: '1',
response: SUCCESSFUL_NET_VERSION_RESPONSE,
},
{
delay: 1,
request: {
method: 'eth_getBlockByNumber',
},
response: SUCCESSFUL_ETH_GET_BLOCK_BY_NUMBER_RESPONSE,
},
]);
const fakeNetworkClient = buildFakeClient(fakeProvider);
Expand Down

0 comments on commit afb95de

Please sign in to comment.