Skip to content

Commit 2aa96da

Browse files
committed
Improve comments
1 parent 850b47e commit 2aa96da

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

test/e2e/tests/eth-subscribe.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,25 @@ describe('eth_subscribe', function () {
5050
`;
5151

5252
await driver.executeScript(setupSubscriptionListener);
53+
// A `newHeads` subscription will emit a notification for each new block
54+
// See here for more information: https://docs.infura.io/infura/networks/ethereum/json-rpc-methods/subscription-methods/eth_subscribe
5355
await driver.executeScript(`
5456
window.ethereum.request({
5557
method: 'eth_subscribe',
5658
params: ['newHeads']
5759
});
5860
`);
5961

60-
// Verify that new block is seen on first dapp
62+
// Verify that the new block is seen on the first dapp
6163
await driver.findElement('[data-testid="eth-subscribe-response"]');
6264

63-
// switch to second dapp
65+
// Switch to the second dapp
6466
await driver.openNewPage('http://127.0.0.1:8081/');
6567

66-
// setup subscription listener
68+
// Setup the same subscrption listener as on the first dapp, but without registering a new subscription
6769
await driver.executeScript(setupSubscriptionListener);
6870

69-
// Verify that new block is not seen on second dapp
71+
// Verify that the new block is not seen on the second dapp
7072
await driver.assertElementNotPresent(
7173
'[data-testid="eth-subscribe-response"]',
7274
);

0 commit comments

Comments
 (0)