Skip to content

Commit

Permalink
e2e: add test cases for disconnecting without dapps connected
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Mucha <[email protected]>
  • Loading branch information
drptbl committed Oct 7, 2022
1 parent 4fb2858 commit 3310758
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/e2e/specs/metamask-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ describe('Metamask', () => {
expect(setupFinished).to.be.true;
});
});
it(`disconnectMetamaskWalletFromDapp shouldn't fail if there are no dapps connected`, () => {
cy.disconnectMetamaskWalletFromDapp().then(disconnected => {
expect(disconnected).to.be.true;
});
});
it(`disconnectMetamaskWalletFromAllDapps shouldn't fail if there are no dapps connected`, () => {
cy.disconnectMetamaskWalletFromAllDapps().then(disconnected => {
expect(disconnected).to.be.true;
});
});
it(`acceptMetamaskAccess should accept connection request to metamask`, () => {
cy.visit('/');
cy.get('#connectButton').click();
Expand Down Expand Up @@ -129,14 +139,14 @@ describe('Metamask', () => {
expect(resetted).to.be.true;
});
});
it(`disconnectMetamaskWalletFromDapp should disconnect current account from current dapp`, () => {
it(`disconnectMetamaskWalletFromDapp should disconnect current account from current dapp (when already connected)`, () => {
cy.get('#requestPermissions').click();
cy.acceptMetamaskAccess();
cy.disconnectMetamaskWalletFromDapp().then(disconnected => {
expect(disconnected).to.be.true;
});
});
it(`disconnectMetamaskWalletFromAllDapps should disconnect current account from all dapps`, () => {
it(`disconnectMetamaskWalletFromAllDapps should disconnect current account from all dapps (when already connected)`, () => {
cy.get('#requestPermissions').click();
cy.acceptMetamaskAccess();
cy.disconnectMetamaskWalletFromAllDapps().then(disconnected => {
Expand Down

0 comments on commit 3310758

Please sign in to comment.