From 9efe8ef2466df183f969b3c32d33787a62652832 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Tue, 19 Sep 2023 12:35:10 +0200 Subject: [PATCH] Fix failing tests --- cypress/e2e/pages/create_tx.pages.js | 2 +- cypress/e2e/pages/dashboard.pages.js | 6 +++-- cypress/e2e/smoke/tx_history.cy.js | 22 ++++++++++--------- .../PendingTxs/PendingTxListItem.tsx | 11 +++++++--- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/cypress/e2e/pages/create_tx.pages.js b/cypress/e2e/pages/create_tx.pages.js index 52157d521f..b657939bac 100644 --- a/cypress/e2e/pages/create_tx.pages.js +++ b/cypress/e2e/pages/create_tx.pages.js @@ -12,7 +12,7 @@ const rotateLeftIcon = '[data-testid="RotateLeftIcon"]' const viewTransactionBtn = 'View transaction' const transactionDetailsTitle = 'Transaction details' const QueueLabel = 'needs to be executed first' -const TransactionSummary = 'Send-' +const TransactionSummary = 'Send' const maxAmountBtnStr = 'Max' const nextBtnStr = 'Next' diff --git a/cypress/e2e/pages/dashboard.pages.js b/cypress/e2e/pages/dashboard.pages.js index a2d90a3984..e8a10fffb3 100644 --- a/cypress/e2e/pages/dashboard.pages.js +++ b/cypress/e2e/pages/dashboard.pages.js @@ -45,8 +45,10 @@ export function verifyTxQueueWidget() { cy.contains(noTransactionStr).should('not.exist') // Queued txns - cy.contains(`a[href^="/transactions/tx?id=multisig_0x"]`, '13' + 'Send' + '-0.00002 GOR' + '1/1').should('exist') - + cy.contains( + `a[href^="/transactions/tx?id=multisig_0x"]`, + '13' + 'Send' + '0.00002 GOR' + 'to' + 'gor:0xE297...9665' + '1/1', + ).should('exist') cy.contains(`a[href="${constants.transactionQueueUrl}${encodeURIComponent(constants.TEST_SAFE)}"]`, viewAllStr) }) } diff --git a/cypress/e2e/smoke/tx_history.cy.js b/cypress/e2e/smoke/tx_history.cy.js index 023802aef0..8f61bcf5fc 100644 --- a/cypress/e2e/smoke/tx_history.cy.js +++ b/cypress/e2e/smoke/tx_history.cy.js @@ -1,7 +1,7 @@ import * as constants from '../../support/constants' -const INCOMING = 'Received' -const OUTGOING = 'Sent' +const INCOMING = 'Receive' +const OUTGOING = 'Send' const CONTRACT_INTERACTION = 'Contract interaction' describe('Transaction history', () => { @@ -31,8 +31,8 @@ describe('Transaction history', () => { .last() .within(() => { // Type - cy.get('img').should('have.attr', 'alt', INCOMING) - cy.contains('div', 'Received').should('exist') + cy.get('img').should('have.attr', 'alt', 'Received') + cy.contains('div', INCOMING).should('exist') // Info cy.get('img[alt="GOR"]').should('be.visible') @@ -73,10 +73,12 @@ describe('Transaction history', () => { // Type // TODO: update next line after fixing the logo // cy.find('img').should('have.attr', 'src').should('include', WRAPPED_ETH) - cy.contains('div', 'Wrapped Ether').should('exist') + cy.contains('div', 'WETH').should('exist') + + cy.contains('div', 'unlimited').should('exist') // Info - cy.contains('div', 'approve').should('exist') + cy.contains('div', 'Approve').should('exist') // Time cy.contains('span', '5:00 PM').should('exist') @@ -103,11 +105,11 @@ describe('Transaction history', () => { .prev() .within(() => { // Type - cy.get('img').should('have.attr', 'alt', OUTGOING) - cy.contains('div', 'Sent').should('exist') + cy.get('img').should('have.attr', 'alt', 'Sent') + cy.contains('div', 'Send').should('exist') // Info - cy.contains('span', '-0.11 WETH').should('exist') + cy.contains('span', '0.11 WETH').should('exist') // Time cy.contains('span', '5:01 PM').should('exist') @@ -119,7 +121,7 @@ describe('Transaction history', () => { .prev() .within(() => { // Type - cy.contains('div', 'Received').should('exist') + cy.contains('div', INCOMING).should('exist') // Info cy.contains('span', '120,497.61 DAI').should('exist') diff --git a/src/components/dashboard/PendingTxs/PendingTxListItem.tsx b/src/components/dashboard/PendingTxs/PendingTxListItem.tsx index a700f8e9b3..2ae589338d 100644 --- a/src/components/dashboard/PendingTxs/PendingTxListItem.tsx +++ b/src/components/dashboard/PendingTxs/PendingTxListItem.tsx @@ -11,6 +11,7 @@ import TxType from '@/components/transactions/TxType' import css from './styles.module.css' import OwnersIcon from '@/public/images/common/owners.svg' import { AppRoutes } from '@/config/routes' +import { TransactionInfoType } from '@safe-global/safe-gateway-typescript-sdk' type PendingTxType = { transaction: TransactionSummary @@ -31,6 +32,8 @@ const PendingTx = ({ transaction }: PendingTxType): ReactElement => { [router, id], ) + const displayInfo = !transaction.txInfo.richDecodedInfo && transaction.txInfo.type !== TransactionInfoType.TRANSFER + return ( @@ -40,9 +43,11 @@ const PendingTx = ({ transaction }: PendingTxType): ReactElement => { - - - + {displayInfo && ( + + + + )} {isMultisigExecutionInfo(transaction.executionInfo) ? (