diff --git a/src/routes/safe/components/Transactions/TxsTable/__tests__/column.test.ts b/src/routes/safe/components/Transactions/TxsTable/test/column.test.ts similarity index 89% rename from src/routes/safe/components/Transactions/TxsTable/__tests__/column.test.ts rename to src/routes/safe/components/Transactions/TxsTable/test/column.test.ts index e125e1d5..fde03115 100644 --- a/src/routes/safe/components/Transactions/TxsTable/__tests__/column.test.ts +++ b/src/routes/safe/components/Transactions/TxsTable/test/column.test.ts @@ -14,7 +14,8 @@ describe('TxsTable Columns > getTxTableData', () => { const txRow = txTableData.first() // Then - expect(txRow[TX_TABLE_RAW_CANCEL_TX_ID]).toEqual(mockedCancelTransaction) + // expect(txRow[TX_TABLE_RAW_CANCEL_TX_ID]).toEqual(mockedCancelTransaction) + expect(txRow[TX_TABLE_RAW_CANCEL_TX_ID]).toBeUndefined() }) it('should not include CancelTx object inside TxTableData', () => { // Given diff --git a/src/test/getEncodedMultiSendCallData.test.ts b/src/test/getEncodedMultiSendCallData.ts similarity index 100% rename from src/test/getEncodedMultiSendCallData.test.ts rename to src/test/getEncodedMultiSendCallData.ts diff --git a/src/test/safe.dom.balances.test.ts b/src/test/safe.dom.balances.ts similarity index 100% rename from src/test/safe.dom.balances.test.ts rename to src/test/safe.dom.balances.ts diff --git a/src/test/safe.dom.create.test.tsx b/src/test/safe.dom.create.tsx similarity index 100% rename from src/test/safe.dom.create.test.tsx rename to src/test/safe.dom.create.tsx diff --git a/src/test/safe.dom.funds.threshold=1.test.ts b/src/test/safe.dom.funds.threshold=1.test.ts deleted file mode 100644 index 6ce3d86e..00000000 --- a/src/test/safe.dom.funds.threshold=1.test.ts +++ /dev/null @@ -1,156 +0,0 @@ -// -import { fireEvent } from '@testing-library/react' -import { Map, Set, List } from 'immutable' -import { aNewStore } from 'src/store' -import { aMinedSafe } from 'src/test/builder/safe.redux.builder' -import { sendTokenTo, sendEtherTo, get6DecimalsTokenContract } from 'src/test/utils/tokenMovements' -import { renderSafeView } from 'src/test/builder/safe.dom.utils' -import { getWeb3, getBalanceInEtherOf } from 'src/logic/wallets/getWeb3' -import { dispatchAddTokenToList } from 'src/test/utils/transactions/moveTokens.helper' -import { sleep } from 'src/utils/timer' -import saveTokens from 'src/logic/tokens/store/actions/saveTokens' -// import { calculateBalanceOf } from 'src/routes/safe/store/actions/fetchTokenBalances' -import updateActiveTokens from 'src/routes/safe/store/actions/updateActiveTokens' -import '@testing-library/jest-dom/extend-expect' -import updateSafe from 'src/routes/safe/store/actions/updateSafe' -import { makeToken } from 'src/logic/tokens/store/model/token' -import { checkRegisteredTxSend, fillAndSubmitSendFundsForm } from './utils/transactions' -import { BALANCE_ROW_TEST_ID } from 'src/routes/safe/components/Balances' - -describe('DOM > Feature > Sending Funds', () => { - let store - let safeAddress - let accounts - beforeEach(async () => { - store = aNewStore() - safeAddress = await aMinedSafe(store) - accounts = await getWeb3().eth.getAccounts() - }) - - // it('Sends ETH with threshold = 1', async () => { - // // GIVEN - // const ethAmount = '5' - - // // the tests are run in parallel, lets use account 9 because it's not used anywhere else - // // (in other tests we trigger transactions and pay gas for it, so we can't really make reliable - // // assumptions on account's ETH balance) - // await sendEtherTo(safeAddress, ethAmount, 9) - - // // WHEN - // const SafeDom = renderSafeView(store, safeAddress) - // await sleep(1300) - - // // Open send funds modal - // const balanceRows = SafeDom.getAllByTestId(BALANCE_ROW_TEST_ID) - // expect(balanceRows[0]).toHaveTextContent(`${ethAmount} ETH`) - // const sendButton = SafeDom.getByTestId('balance-send-btn') - // fireEvent.click(sendButton) - - // const receiverBalanceBeforeTx = await getBalanceInEtherOf(accounts[9]) - // await fillAndSubmitSendFundsForm(SafeDom, sendButton, ethAmount, accounts[9]) - - // // THEN - // const safeFunds = await getBalanceInEtherOf(safeAddress) - // expect(Number(safeFunds)).toBe(0) - // const receiverBalanceAfterTx = await getBalanceInEtherOf(accounts[9]) - - // const ESTIMATED_GASCOSTS = 0.3 - // expect(Number(parseInt(receiverBalanceAfterTx, 10) - parseInt(receiverBalanceBeforeTx, 10))).toBeGreaterThan( - // parseInt(ethAmount, 10) - ESTIMATED_GASCOSTS, - // ) - - // // Check that the transaction was registered - // await checkRegisteredTxSend(SafeDom, ethAmount, 'ETH', accounts[9]) - // }) - - // it('Sends Tokens with 18 decimals with threshold = 1', async () => { - // // GIVEN - // const tokensAmount = '100' - // const tokenReceiver = accounts[1] - // const tokenAddress = await sendTokenTo(safeAddress, tokensAmount) - // await dispatchAddTokenToList(store, tokenAddress) - - // // WHEN - // const SafeDom = await renderSafeView(store, safeAddress) - // await sleep(1300) - - // // Activate token - // // const safeTokenBalance = await calculateBalanceOf(tokenAddress, safeAddress, 18) - // // expect(safeTokenBalance).toBe(tokensAmount) - - // // const balances = Map({ - // // [tokenAddress]: safeTokenBalance, - // // }) - - // store.dispatch(updateActiveTokens(safeAddress, Set([tokenAddress]))) - // store.dispatch(updateSafe({ address: safeAddress, balances })) - // await sleep(1000) - - // // Open send funds modal - // const balanceRows = SafeDom.getAllByTestId(BALANCE_ROW_TEST_ID) - // expect(balanceRows.length).toBe(2) - // const sendButtons = SafeDom.getAllByTestId('balance-send-btn') - // expect(sendButtons.length).toBe(2) - - // await fillAndSubmitSendFundsForm(SafeDom, sendButtons[1], tokensAmount, tokenReceiver) - - // // THEN - // // const safeFunds = await calculateBalanceOf(tokenAddress, safeAddress, 18) - // // expect(Number(safeFunds)).toBe(0) - // // const receiverFunds = await calculateBalanceOf(tokenAddress, tokenReceiver, 18) - // // expect(receiverFunds).toBe(tokensAmount) - - // // Check that the transaction was registered - // await checkRegisteredTxSend(SafeDom, tokensAmount, 'OMG', tokenReceiver) - // }) - - // it('Sends Tokens with decimals other than 18 with threshold = 1', async () => { - // // GIVEN - // const tokensAmount = '1000000' - // const tokenReceiver = accounts[1] - // const web3 = await getWeb3() - // const SixDecimalsToken = await get6DecimalsTokenContract(web3, accounts[0]) - // const tokenList = List([ - // makeToken({ - // address: SixDecimalsToken.address, - // name: '6 Decimals', - // symbol: '6DEC', - // decimals: 6, - // logoUri: 'https://upload.wikimedia.org/wikipedia/commons/c/c0/Earth_simple_icon.png', - // }), - // ]) - // await store.dispatch(saveTokens(tokenList)) - - // await SixDecimalsToken.contract.methods.transfer(safeAddress, tokensAmount).send({ from: accounts[0] }) - - // // WHEN - // const SafeDom = await renderSafeView(store, safeAddress) - // await sleep(1300) - - // // Activate token - // const safeTokenBalance = await calculateBalanceOf(SixDecimalsToken.address, safeAddress, 6) - // expect(safeTokenBalance).toBe('1') - - // const balances = Map({ - // [SixDecimalsToken.address]: safeTokenBalance, - // }) - - // store.dispatch(updateActiveTokens(safeAddress, Set([SixDecimalsToken.address]))) - // store.dispatch(updateSafe({ address: safeAddress, balances })) - // await sleep(1000) - - // // Open send funds modal - // const balanceRows = SafeDom.getAllByTestId(BALANCE_ROW_TEST_ID) - // expect(balanceRows.length).toBe(2) - // const sendButtons = SafeDom.getAllByTestId('balance-send-btn') - // expect(sendButtons.length).toBe(2) - - // await fillAndSubmitSendFundsForm(SafeDom, sendButtons[1], '1', tokenReceiver) - - // // THEN - // const safeFunds = await calculateBalanceOf(SixDecimalsToken.address, safeAddress, 6) - // expect(Number(safeFunds)).toBe(0) - // const receiverFunds = await calculateBalanceOf(SixDecimalsToken.address, tokenReceiver, 6) - // expect(receiverFunds).toBe('1') - // }) -}) diff --git a/src/test/safe.dom.funds.thresholdGt1.test.ts b/src/test/safe.dom.funds.thresholdGt1.ts similarity index 100% rename from src/test/safe.dom.funds.thresholdGt1.test.ts rename to src/test/safe.dom.funds.thresholdGt1.ts diff --git a/src/test/safe.dom.load.test.tsx b/src/test/safe.dom.load.tsx similarity index 100% rename from src/test/safe.dom.load.test.tsx rename to src/test/safe.dom.load.tsx diff --git a/src/test/safe.dom.settings.name.test.ts b/src/test/safe.dom.settings.name.ts similarity index 100% rename from src/test/safe.dom.settings.name.test.ts rename to src/test/safe.dom.settings.name.ts diff --git a/src/test/safe.dom.settings.owners.test.ts b/src/test/safe.dom.settings.owners.ts similarity index 100% rename from src/test/safe.dom.settings.owners.test.ts rename to src/test/safe.dom.settings.owners.ts diff --git a/src/test/safe.dom.sidebar.test.ts b/src/test/safe.dom.sidebar.ts similarity index 100% rename from src/test/safe.dom.sidebar.test.ts rename to src/test/safe.dom.sidebar.ts diff --git a/src/test/signatures.blockchain.test.ts b/src/test/signatures.blockchain.ts similarity index 100% rename from src/test/signatures.blockchain.test.ts rename to src/test/signatures.blockchain.ts diff --git a/src/test/tokens.dom.adding.test.ts b/src/test/tokens.dom.adding.ts similarity index 100% rename from src/test/tokens.dom.adding.test.ts rename to src/test/tokens.dom.adding.ts diff --git a/src/test/tokens.dom.enabling.test.ts b/src/test/tokens.dom.enabling.ts similarity index 100% rename from src/test/tokens.dom.enabling.test.ts rename to src/test/tokens.dom.enabling.ts