test: remove eth wallet test (#989)

This commit is contained in:
Joe Tsang 2022-08-11 11:27:45 +01:00 committed by GitHub
parent 22fc0e7ac1
commit 1c4231f6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,8 @@ import { aliasQuery } from '@vegaprotocol/cypress';
import { generateDepositPage } from '../support/mocks/generate-deposit-page'; import { generateDepositPage } from '../support/mocks/generate-deposit-page';
import { generateNetworkParameters } from '../support/mocks/generate-network-parameters'; import { generateNetworkParameters } from '../support/mocks/generate-network-parameters';
const connectEthWalletBtn = 'connect-eth-wallet-btn';
describe('deposit form validation', () => { describe('deposit form validation', () => {
beforeEach(() => { beforeEach(() => {
cy.mockWeb3Provider(); cy.mockWeb3Provider();
@ -12,7 +14,7 @@ describe('deposit form validation', () => {
cy.visit('/portfolio/deposit'); cy.visit('/portfolio/deposit');
// Deposit page requires connection Ethereum wallet first // Deposit page requires connection Ethereum wallet first
cy.getByTestId('connect-eth-wallet-btn').click(); cy.getByTestId(connectEthWalletBtn).click();
cy.getByTestId('web3-connector-MetaMask').click(); cy.getByTestId('web3-connector-MetaMask').click();
cy.wait('@DepositPage'); cy.wait('@DepositPage');
@ -55,4 +57,19 @@ describe('deposit form validation', () => {
.next(`[data-testid="${formFieldError}"]`) .next(`[data-testid="${formFieldError}"]`)
.should('have.text', 'Insufficient amount in Ethereum wallet'); .should('have.text', 'Insufficient amount in Ethereum wallet');
}); });
it('able to disconnect eth wallet', () => {
const ethWalletAddress = Cypress.env('ETHEREUM_WALLET_ADDRESS');
cy.get('#ethereum-address').should('have.value', ethWalletAddress).click();
cy.getByTestId('dialog-content').within(() => {
cy.get('p').should('have.text', `Connected with ${ethWalletAddress}`);
cy.get('button')
.should('have.text', 'Disconnect Ethereum Wallet')
.click();
});
cy.getByTestId('connect-eth-wallet-msg').should('exist');
cy.getByTestId(connectEthWalletBtn).should('exist');
});
}); });