Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Sep 19, 2023
1 parent 8dd0c48 commit 9efe8ef
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/pages/create_tx.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/pages/dashboard.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down
22 changes: 12 additions & 10 deletions cypress/e2e/smoke/tx_history.cy.js
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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')
Expand Down
11 changes: 8 additions & 3 deletions src/components/dashboard/PendingTxs/PendingTxListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,6 +32,8 @@ const PendingTx = ({ transaction }: PendingTxType): ReactElement => {
[router, id],
)

const displayInfo = !transaction.txInfo.richDecodedInfo && transaction.txInfo.type !== TransactionInfoType.TRANSFER

return (
<NextLink href={url} passHref>
<Box className={css.container}>
Expand All @@ -40,9 +43,11 @@ const PendingTx = ({ transaction }: PendingTxType): ReactElement => {
<TxType tx={transaction} />
</Box>

<Box flex={1} className={css.txInfo}>
<TxInfo info={transaction.txInfo} />
</Box>
{displayInfo && (
<Box flex={1} className={css.txInfo}>
<TxInfo info={transaction.txInfo} />
</Box>
)}

{isMultisigExecutionInfo(transaction.executionInfo) ? (
<Box className={css.confirmationsCount}>
Expand Down

0 comments on commit 9efe8ef

Please sign in to comment.