funds test fix

This commit is contained in:
Mikhail Mikheev 2019-06-05 18:20:13 +04:00
parent 275640ac4a
commit a220b4cf0a
2 changed files with 3 additions and 4 deletions

View File

@ -72,7 +72,6 @@ export const aMinedSafe = async (
store: Store<GlobalState>,
owners: number = 1,
threshold: number = 1,
startAccountPosition: number = 0,
): Promise<string> => {
const provider = await getProviderInfo()
const walletRecord = makeProvider(provider)
@ -85,7 +84,7 @@ export const aMinedSafe = async (
[FIELD_OWNERS]: `${owners}`,
}
for (let i = startAccountPosition; i < owners; i += 1) {
for (let i = 0; i < owners; i += 1) {
form[getOwnerNameBy(i)] = `Adol ${i + 1} Eth Account`
form[getOwnerAddressBy(i)] = accounts[i]
}

View File

@ -24,7 +24,7 @@ describe('DOM > Feature > Funds', () => {
beforeEach(async () => {
store = aNewStore()
// using 4th account because other accounts were used in other tests and paid gas
safeAddress = await aMinedSafe(store, 1, 1, 4)
safeAddress = await aMinedSafe(store)
accounts = await getWeb3().eth.getAccounts()
})
@ -63,7 +63,7 @@ describe('DOM > Feature > Funds', () => {
expect(Number(safeFunds)).toBe(0)
const receiverFunds = await getBalanceInEtherOf(accounts[0])
const ESTIMATED_GASCOSTS = 0.1
const ESTIMATED_GASCOSTS = 0.3
expect(Number(parseInt(receiverFunds, 10) - parseInt(balanceAfterSendingEthToSafe, 10))).toBeGreaterThan(
parseInt(ethAmount, 10) - ESTIMATED_GASCOSTS,
)