From 98448931b6ccc692adc75b91be6bd9c63c29d32b Mon Sep 17 00:00:00 2001 From: katspaugh Date: Fri, 4 Aug 2023 20:58:16 +0200 Subject: [PATCH] Fix tests --- src/components/settings/DelegatesList/index.tsx | 4 ++-- .../tx/ApprovalEditor/ApprovalEditorForm.test.tsx | 8 ++++---- src/components/tx/ApprovalEditor/ApprovalItem.tsx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/settings/DelegatesList/index.tsx b/src/components/settings/DelegatesList/index.tsx index b9ee500e7d..1610e2db82 100644 --- a/src/components/settings/DelegatesList/index.tsx +++ b/src/components/settings/DelegatesList/index.tsx @@ -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' @@ -61,7 +61,7 @@ const DelegatesList = () => { style={{ listStyleType: 'none', marginBottom: '1em' }} title={`Delegated by ${item.delegator}`} > - { beforeEach(() => { @@ -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 @@ -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) diff --git a/src/components/tx/ApprovalEditor/ApprovalItem.tsx b/src/components/tx/ApprovalEditor/ApprovalItem.tsx index 8a75c02623..74859657e1 100644 --- a/src/components/tx/ApprovalEditor/ApprovalItem.tsx +++ b/src/components/tx/ApprovalEditor/ApprovalItem.tsx @@ -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 ( @@ -20,7 +20,7 @@ const ApprovalItem = ({ spender, children }: { spender: string; children: ReactE - +