Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Aug 4, 2023
1 parent ca799e9 commit 9844893
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/settings/DelegatesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getDelegates } from '@safe-global/safe-gateway-typescript-sdk'
import useAsync from '@/hooks/useAsync'
import useSafeInfo from '@/hooks/useSafeInfo'
import { Box, Grid, Paper, SvgIcon, Tooltip, Typography } from '@mui/material'
import PrefixedEthHashInfo from '@/components/common/EthHashInfo'
import EthHashInfo from '@/components/common/EthHashInfo'
import InfoIcon from '@/public/images/notifications/info.svg'
import ExternalLink from '@/components/common/ExternalLink'
import { HelpCenterArticle } from '@/config/constants'
Expand Down Expand Up @@ -61,7 +61,7 @@ const DelegatesList = () => {
style={{ listStyleType: 'none', marginBottom: '1em' }}
title={`Delegated by ${item.delegator}`}
>
<PrefixedEthHashInfo
<EthHashInfo
address={item.delegate}
showCopyButton
hasExplorer
Expand Down
8 changes: 4 additions & 4 deletions src/components/tx/ApprovalEditor/ApprovalEditorForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fireEvent, getAllByRole, render, waitFor } from '@/tests/test-utils'
import { fireEvent, render, waitFor } from '@/tests/test-utils'
import { hexZeroPad } from 'ethers/lib/utils'
import { TokenType } from '@safe-global/safe-gateway-typescript-sdk'
import { ApprovalEditorForm } from '@/components/tx/ApprovalEditor/ApprovalEditorForm'
import { getAllByTestId } from '@testing-library/dom'
import { getAllByTestId, getAllByTitle } from '@testing-library/dom'

describe('ApprovalEditorForm', () => {
beforeEach(() => {
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('ApprovalEditorForm', () => {
expect(approvalItems).toHaveLength(2)

// One button for each approval
const buttons = getAllByRole(result.container, 'button')
const buttons = getAllByTitle(result.container, 'Save')
expect(buttons).toHaveLength(2)

// First approval value is rendered
Expand Down Expand Up @@ -100,7 +100,7 @@ describe('ApprovalEditorForm', () => {

// Change value and save
const amountInput = result.container.querySelector('input[name="approvals.0"]') as HTMLInputElement
const saveButton = result.getByRole('button')
const saveButton = result.getByTitle('Save')

fireEvent.change(amountInput!, { target: { value: '100' } })
fireEvent.click(saveButton)
Expand Down
4 changes: 2 additions & 2 deletions src/components/tx/ApprovalEditor/ApprovalItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type ReactElement } from 'react'
import { Alert, Grid, Typography } from '@mui/material'
import css from '@/components/tx/ApprovalEditor/styles.module.css'
import PrefixedEthHashInfo from '@/components/common/EthHashInfo'
import EthHashInfo from '@/components/common/EthHashInfo'

const ApprovalItem = ({ spender, children }: { spender: string; children: ReactElement }) => {
return (
Expand All @@ -20,7 +20,7 @@ const ApprovalItem = ({ spender, children }: { spender: string; children: ReactE

<Grid item>
<Typography fontSize="14px">
<PrefixedEthHashInfo address={spender} hasExplorer showAvatar={false} shortAddress={false} />
<EthHashInfo address={spender} hasExplorer showAvatar={false} shortAddress={false} />
</Typography>
</Grid>
</Grid>
Expand Down

0 comments on commit 9844893

Please sign in to comment.