Skip to content

Commit

Permalink
use sepolia in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
r3kt-eth committed May 4, 2023
1 parent 62336e2 commit 11ffe66
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tests/e2e/specs/metamask-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Metamask', () => {
it(`setupMetamask should finish metamask setup using secret words`, () => {
cy.setupMetamask(
'test test test test test test test test test test test junk',
'goerli',
'sepolia',
'Tester@1234',
).then(setupFinished => {
expect(setupFinished).to.be.true;
Expand All @@ -27,8 +27,8 @@ describe('Metamask', () => {
cy.acceptMetamaskAccess().then(connected => {
expect(connected).to.be.true;
});
cy.get('#network').contains('5');
cy.get('#chainId').contains('0x5');
cy.get('#network').contains('11155111');
cy.get('#chainId').contains('0xaa36a7');
cy.get('#accounts').should(
'have.text',
'0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
Expand All @@ -43,8 +43,8 @@ describe('Metamask', () => {
});
it(`getNetwork should return network by default`, () => {
cy.getNetwork().then(network => {
expect(network.networkName).to.be.equal('goerli');
expect(network.networkId).to.be.equal(5);
expect(network.networkName).to.be.equal('sepolia');
expect(network.networkId).to.be.equal(11155111);
expect(network.isTestnet).to.be.true;
});
});
Expand All @@ -63,17 +63,17 @@ describe('Metamask', () => {
cy.get('#chainId').contains('0x5');
} else {
cy.addMetamaskNetwork({
networkName: 'Polygon Network',
rpcUrl: 'https://polygon-rpc.com',
chainId: '137',
symbol: 'MATIC',
blockExplorer: 'https://polygonscan.com',
networkName: 'Optimism Network',
rpcUrl: 'https://mainnet.optimism.io',
chainId: '10',
symbol: 'OETH',
blockExplorer: 'https://optimistic.etherscan.io',
isTestnet: false,
}).then(networkAdded => {
expect(networkAdded).to.be.true;
});
cy.get('#network').contains('0x89');
cy.get('#chainId').contains('0x89');
cy.get('#network').contains('0xa');
cy.get('#chainId').contains('0xa');
}
});
it(`getNetwork should return valid network after adding a new network`, () => {
Expand All @@ -83,24 +83,24 @@ describe('Metamask', () => {
expect(network.networkId).to.be.equal(5);
expect(network.isTestnet).to.be.true;
} else {
expect(network.networkName).to.be.equal('polygon network');
expect(network.networkId).to.be.equal(137);
expect(network.networkName).to.be.equal('optimism network');
expect(network.networkId).to.be.equal(10);
expect(network.isTestnet).to.be.false;
}
});
});
it(`changeMetamaskNetwork should change network using pre-defined network`, () => {
cy.changeMetamaskNetwork('goerli').then(networkChanged => {
cy.changeMetamaskNetwork('mainnet').then(networkChanged => {
expect(networkChanged).to.be.true;
});
cy.get('#network').contains('5');
cy.get('#chainId').contains('0x5');
cy.get('#network').contains('0x1');
cy.get('#chainId').contains('0x1');
});
it(`getNetwork should return valid network after changing a network`, () => {
cy.getNetwork().then(network => {
expect(network.networkName).to.be.equal('goerli');
expect(network.networkId).to.be.equal(5);
expect(network.isTestnet).to.be.true;
expect(network.networkName).to.be.equal('mainnet');
expect(network.networkId).to.be.equal(1);
expect(network.isTestnet).to.be.false;
});
});
it(`changeMetamaskNetwork should change network using custom network name`, () => {
Expand All @@ -111,13 +111,13 @@ describe('Metamask', () => {
cy.get('#network').contains('5');
cy.get('#chainId').contains('0x5');
} else {
cy.changeMetamaskNetwork('polygon network').then(networkChanged => {
cy.changeMetamaskNetwork('optimism network').then(networkChanged => {
expect(networkChanged).to.be.true;
});
cy.get('#network').contains('0x89');
cy.get('#chainId').contains('0x89');
cy.get('#network').contains('0xa');
cy.get('#chainId').contains('0xa');
cy.changeMetamaskNetwork('sepolia');
}
cy.changeMetamaskNetwork('goerli');
});
it(`importMetamaskAccount should import new account using private key`, () => {
cy.importMetamaskAccount(
Expand Down

0 comments on commit 11ffe66

Please sign in to comment.