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 9d04302 commit 821d791
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 @@ -3531,9 +3531,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 @@ -3543,9 +3547,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 821d791

Please sign in to comment.