Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt committed Mar 14, 2023
1 parent 850b47e commit 2aa96da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/e2e/tests/eth-subscribe.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,25 @@ describe('eth_subscribe', function () {
`;

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

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

// switch to second dapp
// Switch to the second dapp
await driver.openNewPage('http://127.0.0.1:8081/');

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

// Verify that new block is not seen on second dapp
// Verify that the new block is not seen on the second dapp
await driver.assertElementNotPresent(
'[data-testid="eth-subscribe-response"]',
);
Expand Down

0 comments on commit 2aa96da

Please sign in to comment.