fix send funds tests

This commit is contained in:
Mikhail Mikheev 2019-09-19 19:12:41 +04:00
parent 232c7416a9
commit dcdc965984
3 changed files with 3 additions and 4 deletions

View File

@ -49,4 +49,4 @@ export const isAddressAToken = async (tokenAddress: string) => {
return call !== '0x'
}
export const isTokenTransfer = async (data: string, value: number) => data.substring(0, 10) === '0xa9059cbb' && value === 0
export const isTokenTransfer = async (data: string, value: number) => data && data.substring(0, 10) === '0xa9059cbb' && value === 0

View File

@ -137,7 +137,6 @@ class Layout extends React.Component<Props, State> {
className={classes.send}
onClick={() => showSendFunds('Ether')}
disabled={!granted}
testId="balance-send-btn"
>
<CallMade alt="Send Transaction" className={classNames(classes.leftIcon, classes.iconSmall)} />
Send

View File

@ -1,6 +1,6 @@
// @flow
import * as React from 'react'
import { fireEvent } from '@testing-library/react'
import { fireEvent, waitForElement } from '@testing-library/react'
import { sleep } from '~/utils/timer'
export const fillAndSubmitSendFundsForm = async (
@ -24,7 +24,7 @@ export const fillAndSubmitSendFundsForm = async (
fireEvent.click(reviewBtn)
// Submit the tx (Review Tx screen)
const submitBtn = SafeDom.getByTestId('submit-tx-btn')
const submitBtn = await waitForElement(() => SafeDom.getByTestId('submit-tx-btn'))
fireEvent.click(submitBtn)
await sleep(1000)
}