From 623385aa6bae742ff0e63dbface7538dbde69da6 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Thu, 2 Mar 2023 19:06:06 -0800 Subject: [PATCH] test: update e2e capsule tests for deposits --- apps/trading-e2e/src/integration/capsule.cy.ts | 11 ++++++----- libs/deposits/src/lib/approve-notification.tsx | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/trading-e2e/src/integration/capsule.cy.ts b/apps/trading-e2e/src/integration/capsule.cy.ts index e6bba018a..6ab51194b 100644 --- a/apps/trading-e2e/src/integration/capsule.cy.ts +++ b/apps/trading-e2e/src/integration/capsule.cy.ts @@ -41,6 +41,7 @@ const completeWithdrawalBtn = 'complete-withdrawal'; const submitTransferBtn = '[type="submit"]'; const transferForm = 'transfer-form'; const depositSubmit = 'deposit-submit'; +const approveSubmit = 'approve-submit'; // Because the tests are run on a live network to optimize time, the tests are interdependent and must be run in the given order. describe('capsule - without MultiSign', { tags: '@slow' }, () => { @@ -73,13 +74,13 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => { cy.getByTestId('deposit-button').click(); connectEthereumWallet('Unknown'); cy.get(assetSelectField, txTimeout).select(btcName, { force: true }); - cy.getByTestId('approve-warning').should( + cy.getByTestId('approve-default').should( 'contain.text', - `Deposits of ${btcSymbol} not approved` + `Before you can make a deposit of your chosen asset, ${btcSymbol}, you need to approve its use in your Ethereum wallet` ); - cy.getByTestId(depositSubmit).click(); - cy.getByTestId('dialog-title').should('contain.text', 'Approve complete'); - cy.get('[data-testid="Return to deposit"]').click(); + cy.getByTestId(approveSubmit).click(); + cy.getByTestId('approve-pending').should('exist'); + cy.getByTestId('approve-confirmed').should('exist'); cy.get(amountField).clear().type('10'); cy.getByTestId(depositSubmit).click(); cy.getByTestId(toastContent, txTimeout).should( diff --git a/libs/deposits/src/lib/approve-notification.tsx b/libs/deposits/src/lib/approve-notification.tsx index d6b042123..ee110a91d 100644 --- a/libs/deposits/src/lib/approve-notification.tsx +++ b/libs/deposits/src/lib/approve-notification.tsx @@ -55,6 +55,7 @@ export const ApproveNotification = ({ size: 'sm', text: `Approve ${selectedAsset?.symbol}`, action: onApprove, + dataTestId: 'approve-submit', }} /> @@ -73,6 +74,7 @@ export const ApproveNotification = ({ size: 'sm', text: `Approve ${selectedAsset?.symbol}`, action: onApprove, + dataTestId: 'reapprove-submit', }} />