From f6c2a7aa568722057557065e8400c4d716c6ba11 Mon Sep 17 00:00:00 2001
From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com>
Date: Thu, 10 Nov 2022 00:45:30 +0000
Subject: [PATCH] chore(#1972): delete deposit page and update deposit cypress
tests (#1990)
* fix: #1972 update deposit cypress tests and delete deposit trading page
* fix: #1972 remove portfolio/deposit route
---
.../trading-e2e/src/integration/deposit.cy.ts | 16 ++++--
.../deposit/deposit-container.tsx | 38 --------------
apps/trading/client-pages/deposit/deposit.tsx | 52 -------------------
apps/trading/client-pages/deposit/index.ts | 3 --
.../portfolio/deposits-container.tsx | 6 ++-
apps/trading/pages/client-router.tsx | 9 ----
libs/web3/src/lib/web3-wallet-input.tsx | 5 +-
7 files changed, 21 insertions(+), 108 deletions(-)
delete mode 100644 apps/trading/client-pages/deposit/deposit-container.tsx
delete mode 100644 apps/trading/client-pages/deposit/deposit.tsx
delete mode 100644 apps/trading/client-pages/deposit/index.ts
diff --git a/apps/trading-e2e/src/integration/deposit.cy.ts b/apps/trading-e2e/src/integration/deposit.cy.ts
index 444c765b8..91f44df28 100644
--- a/apps/trading-e2e/src/integration/deposit.cy.ts
+++ b/apps/trading-e2e/src/integration/deposit.cy.ts
@@ -1,3 +1,5 @@
+import { connectVegaWallet } from '../support/vega-wallet';
+
const connectEthWalletBtn = 'connect-eth-wallet-btn';
const assetSelectField = 'select[name="asset"]';
const toAddressField = 'input[name="to"]';
@@ -9,8 +11,14 @@ describe('deposit form validation', { tags: '@smoke' }, () => {
cy.mockWeb3Provider();
cy.mockGQLSubscription();
cy.mockTradingPage();
- cy.visit('/#/portfolio/deposit');
+ cy.visit('/#/portfolio');
+ cy.get('main[data-testid="/portfolio"]').should('exist');
+ cy.getByTestId('Deposits').click();
+ cy.getByTestId('tab-deposits').contains('Connect your Vega wallet');
+ connectVegaWallet();
+ // validateFillsDisplayed();
+ cy.getByTestId('deposit-button').click();
// Deposit page requires connection Ethereum wallet first
cy.getByTestId(connectEthWalletBtn).click();
cy.getByTestId('web3-connector-MetaMask').click();
@@ -19,11 +27,11 @@ describe('deposit form validation', { tags: '@smoke' }, () => {
});
it('handles empty fields', () => {
- // Submit form to trigger any empty validaion messages
+ // Submit form to trigger any empty validation messages
cy.getByTestId('deposit-submit').click();
cy.getByTestId(formFieldError).should('contain.text', 'Required');
- cy.getByTestId(formFieldError).should('have.length', 3);
+ cy.getByTestId(formFieldError).should('have.length', 2);
// Invalid public key
cy.get(toAddressField)
@@ -64,7 +72,7 @@ describe('deposit form validation', { tags: '@smoke' }, () => {
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')
+ cy.getByTestId('disconnect-ethereum-wallet')
.should('have.text', 'Disconnect Ethereum Wallet')
.click();
});
diff --git a/apps/trading/client-pages/deposit/deposit-container.tsx b/apps/trading/client-pages/deposit/deposit-container.tsx
deleted file mode 100644
index 0a1821361..000000000
--- a/apps/trading/client-pages/deposit/deposit-container.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { DepositManager } from '@vegaprotocol/deposits';
-import { useDataProvider, t } from '@vegaprotocol/react-helpers';
-import { enabledAssetsProvider } from '@vegaprotocol/assets';
-import { useEnvironment } from '@vegaprotocol/environment';
-import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
-
-/**
- * Fetches data required for the Deposit page
- */
-export const DepositContainer = () => {
- const { VEGA_ENV } = useEnvironment();
- const { data, error, loading } = useDataProvider({
- dataProvider: enabledAssetsProvider,
- });
- return (
- {t('No assets on this network')} {t('No assets on this network')}{t('Deposit')}
-