Skip to content

Commit

Permalink
fix: eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
clovisdasilvaneto committed Sep 17, 2024
1 parent 458ba59 commit 9f2bab4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/tx/DecodedTx/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type SyntheticEvent, type ReactElement, memo } from 'react'
import { isCustomTxInfo } from '@/utils/transaction-guards'
import { Accordion, AccordionDetails, AccordionSummary, Box, Skeleton, Stack } from '@mui/material'
import { Accordion, AccordionDetails, AccordionSummary, Box, Stack } from '@mui/material'
import { OperationType, type SafeTransaction } from '@safe-global/safe-core-sdk-types'
import type { DecodedDataResponse, TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk'
import { Operation } from '@safe-global/safe-gateway-typescript-sdk'
Expand All @@ -11,7 +11,6 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import DecodedData from '@/components/transactions/TxDetails/TxData/DecodedData'
import accordionCss from '@/styles/accordion.module.css'
import HelpToolTip from './HelpTooltip'
import { asError } from '@/services/exceptions/utils'

type DecodedTxProps = {
tx?: SafeTransaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe('ExecuteThroughRoleForm', () => {

const { findByText, getByText } = render(
<ExecuteThroughRoleForm
txId="0x0123412"
safeTx={safeTx}
role={{ ...TEST_ROLE_OK, status: zodiacRoles.Status.TargetAddressNotAllowed }}
/>,
Expand Down Expand Up @@ -170,7 +171,9 @@ describe('ExecuteThroughRoleForm', () => {

const onSubmit = jest.fn()

const { findByText } = render(<ExecuteThroughRoleForm safeTx={safeTx} role={TEST_ROLE_OK} onSubmit={onSubmit} />)
const { findByText } = render(
<ExecuteThroughRoleForm txId="0x01323" safeTx={safeTx} role={TEST_ROLE_OK} onSubmit={onSubmit} />,
)

fireEvent.click(await findByText('Execute'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('ExecuteForm', () => {
const defaultProps = {
onSubmit: jest.fn(),
isOwner: true,
txId: '0x123123',
isExecutionLoop: false,
relays: [undefined, undefined, false] as AsyncResult<RelayCountResponse>,
txActions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('SignForm', () => {

const defaultProps = {
onSubmit: jest.fn(),
txId: '0x01231',
isOwner: true,
txActions: {
proposeTx: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('SignOrExecute', () => {
it('should display a safeTxError', () => {
const { getByText } = render(
<SignOrExecuteForm
txId="0x012312"
onSubmit={jest.fn()}
safeTxError={new Error('Safe transaction error')}
safeTx={safeTxBuilder().build()}
Expand All @@ -40,6 +41,7 @@ describe('SignOrExecute', () => {

const { getByText } = render(
<SignOrExecuteForm
txId="0x012312"
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
safeTxError={undefined}
Expand All @@ -59,6 +61,7 @@ describe('SignOrExecute', () => {

const { getByText } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
Expand All @@ -77,6 +80,7 @@ describe('SignOrExecute', () => {

const { queryByTestId } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
Expand All @@ -97,6 +101,7 @@ describe('SignOrExecute', () => {

const { queryByTestId } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
Expand All @@ -117,6 +122,7 @@ describe('SignOrExecute', () => {

const { queryByTestId } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
Expand All @@ -135,6 +141,7 @@ describe('SignOrExecute', () => {

const { queryByTestId } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
Expand All @@ -153,6 +160,7 @@ describe('SignOrExecute', () => {

const { queryByText } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
Expand All @@ -168,10 +176,10 @@ describe('SignOrExecute', () => {

const { getByTestId, getByText } = render(
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
txId="someid"
isExecutable={true}
chainId="1"
/>,
Expand All @@ -195,7 +203,13 @@ describe('SignOrExecute', () => {

it('should not display safeTxError message for valid transactions', () => {
const { queryByText } = render(
<SignOrExecuteForm safeTxError={undefined} safeTx={safeTxBuilder().build()} onSubmit={jest.fn()} chainId="1" />,
<SignOrExecuteForm
txId="0x012312"
safeTxError={undefined}
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
chainId="1"
/>,
)

expect(
Expand Down
2 changes: 1 addition & 1 deletion src/components/tx/SignOrExecuteForm/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const useProposeTx = (safeTx?: SafeTransaction, txId?: string, origin?: s

return proposeTx(safeTx, txId, origin)
},
[safeTx, txId, origin, proposeTx],
[safeTx, txId, origin, safe.chainId, proposeTx],
false,
)
}
Expand Down

0 comments on commit 9f2bab4

Please sign in to comment.