Skip to content

Commit

Permalink
Merge pull request #1625 from AmbireTech/fix/transfer-native-change
Browse files Browse the repository at this point in the history
Fix transfer token via url
  • Loading branch information
stojnovsky authored Aug 7, 2024
2 parents b4eae1a + 9641552 commit bb178e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cypress/e2e/transfer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ describe('Transfering funds', () => {

it('Sends funds via Quick account', () => {
cy.visit('/wallet/dashboards')
cy.contains('Transfer').click()

cy.contains('Send').click()

// Wait for the initial wallet load.
// There are a lot of fetch requests under the hood.
Expand Down
5 changes: 5 additions & 0 deletions src/components/Wallet/Transfer/Transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const Transfer = (props) => {
const [assetAddrWithSymbol, setAsset] = useState(
selectedAsset && `${selectedAsset.address}:${selectedAsset.symbol}`
)

useEffect(()=>{
setAsset(selectedAsset && `${selectedAsset.address}:${selectedAsset.symbol}`)
}, [portfolio])

const [gasTankDetails] = useState(state || null)
const [address, setAddress] = useState(gasTankDetails ? accountPresets.feeCollector : '')

Expand Down
7 changes: 5 additions & 2 deletions src/components/Wallet/Transfer/Transfer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ test('can send token', async () => {
addressBook={addressBook}
selectedAcc={userAddress}
addRequest={addRequest}
/>
)
/>)
const selectAnAsset = screen.getByText('Select an asset')
await user.click(selectAnAsset)
const selectMatic = screen.getByText('MATIC')
await user.click(selectMatic)

const maxButton = screen.getByText('MAX')
await user.click(maxButton)
Expand Down

0 comments on commit bb178e9

Please sign in to comment.