uniswap-interface-uncensored/cypress/e2e/swap/swap.test.ts

99 lines
4.7 KiB
TypeScript
Raw Normal View History

import { SwapEventName } from '@uniswap/analytics-events'
feat: upgrade sdk-core to 3.2.6 and add AVAX (#6757) * init refactor * upgrade to 3.2.6 and refactor more uses of chainid * cleaned up lock file * remove console log and add placeholder * use supported chains type for switch fn * allow passing of all chainIds to switcher * additional typecast * better casting solution * yarn.lock cleanup * prettier * better casting for rpc * prettier * deprecate no longer needed addresses * better isSupported checking * deprecate redundant fn * cleanup toSupportedChainId * address initial ocmments * pretier * includes testnet * remove unused export * merge conflicts * spread for mutable copy * explorer text * check is supported before activating chain * remove extra uses of mumbai * remove cast to MockChainId * retain var name supportedChainId * updated prettier * use t for explorer translation * use mockchainid for test * feat: Add Avalanche support (#6776) * init avax * add most avax props * add logo * correct subgraph * update avax blocksPerFetch * add square logo * upgrade ur sdk * version syntax * correct tokens * remove unused token * remove unused token * update token list and add coming soon to searchbar * add coming soon to token explore page * names to ids * cleaned up routing * usdc token * upgrade default token list * update SOR * upgrade SOR * merge conflicts * snowtrace * upgrade SOR * handle be avax support * temp hide avax * show pool positions * whole * spotprice update * not yet supported * BACKEND_SUPPORTED_CHAINS * add avax to BE not supported * update multicall blocks to 5 * add todo * updated prettier --------- Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * be added avax token balances * validateUrlChainParam should return eth for backend unsupported chain * readonly * respond to comments --------- Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-07-07 07:44:06 +03:00
import { ChainId } from '@uniswap/sdk-core'
import { UNI, USDC_MAINNET } from '../../../src/constants/tokens'
import { getBalance, getTestSelector } from '../../utils'
feat: upgrade sdk-core to 3.2.6 and add AVAX (#6757) * init refactor * upgrade to 3.2.6 and refactor more uses of chainid * cleaned up lock file * remove console log and add placeholder * use supported chains type for switch fn * allow passing of all chainIds to switcher * additional typecast * better casting solution * yarn.lock cleanup * prettier * better casting for rpc * prettier * deprecate no longer needed addresses * better isSupported checking * deprecate redundant fn * cleanup toSupportedChainId * address initial ocmments * pretier * includes testnet * remove unused export * merge conflicts * spread for mutable copy * explorer text * check is supported before activating chain * remove extra uses of mumbai * remove cast to MockChainId * retain var name supportedChainId * updated prettier * use t for explorer translation * use mockchainid for test * feat: Add Avalanche support (#6776) * init avax * add most avax props * add logo * correct subgraph * update avax blocksPerFetch * add square logo * upgrade ur sdk * version syntax * correct tokens * remove unused token * remove unused token * update token list and add coming soon to searchbar * add coming soon to token explore page * names to ids * cleaned up routing * usdc token * upgrade default token list * update SOR * upgrade SOR * merge conflicts * snowtrace * upgrade SOR * handle be avax support * temp hide avax * show pool positions * whole * spotprice update * not yet supported * BACKEND_SUPPORTED_CHAINS * add avax to BE not supported * update multicall blocks to 5 * add todo * updated prettier --------- Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * be added avax token balances * validateUrlChainParam should return eth for backend unsupported chain * readonly * respond to comments --------- Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-07-07 07:44:06 +03:00
const UNI_MAINNET = UNI[ChainId.MAINNET]
describe('Swap', () => {
describe('Swap on main page', () => {
it('starts with ETH selected by default', () => {
cy.visit('/swap')
cy.get(`#swap-currency-input .token-amount-input`).should('have.value', '')
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'ETH')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'Select token')
})
it('should default inputs from URL params ', () => {
cy.visit(`/swap?inputCurrency=${UNI_MAINNET.address}`)
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'UNI')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'Select token')
cy.visit(`/swap?outputCurrency=${UNI_MAINNET.address}`)
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'Select token')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'UNI')
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${UNI_MAINNET.address}`)
cy.get(`#swap-currency-input .token-symbol-container`).should('contain.text', 'ETH')
cy.get(`#swap-currency-output .token-symbol-container`).should('contain.text', 'UNI')
})
it('inputs reset when navigating between pages', () => {
cy.visit('/swap')
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get('#swap-currency-input .token-amount-input').type('0.01').should('have.value', '0.01')
cy.visit('/pool').visit('/swap')
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
})
it('resets the dependent input when the independent input is cleared', () => {
cy.visit(`/swap?inputCurrency=ETH&outputCurrency=${UNI_MAINNET.address}`)
cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get(`#swap-currency-output .token-amount-input`).should('have.value', '')
cy.get('#swap-currency-input .token-amount-input').type('0.01').should('have.value', '0.01')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value', '')
cy.get('#swap-currency-input .token-amount-input').clear()
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
cy.window().trigger('blur')
cy.get(`#swap-currency-output .token-amount-input`).should('not.have.value')
})
it('swaps ETH for USDC', () => {
cy.visit('/swap')
cy.hardhat({ automine: false })
getBalance(USDC_MAINNET).then((initialBalance) => {
// Select USDC
cy.get('#swap-currency-output .open-currency-select-button').click()
cy.get(getTestSelector('token-search-input')).type(USDC_MAINNET.address)
cy.get(getTestSelector('common-base-USDC')).click()
// Enter amount to swap
cy.get('#swap-currency-output .token-amount-input').type('1').should('have.value', '1')
cy.get('#swap-currency-input .token-amount-input').should('not.have.value', '')
// Verify logging
cy.waitForAmplitudeEvent(SwapEventName.SWAP_QUOTE_RECEIVED).then((event: any) => {
cy.wrap(event.event_properties).should('have.property', 'quote_latency_milliseconds')
cy.wrap(event.event_properties.quote_latency_milliseconds).should('be.a', 'number')
cy.wrap(event.event_properties.quote_latency_milliseconds).should('be.gte', 0)
})
// Submit transaction
cy.get('#swap-button').click()
cy.contains('Review swap')
cy.contains('Confirm swap').click()
cy.wait('@eth_estimateGas').wait('@eth_sendRawTransaction').wait('@eth_getTransactionReceipt')
feat: additional routing option prototype (#6934) * add npm secret and modify github actions * inject npm secret for tests as well * revert changes to staging and prod actions because we arent going to use themmm * remove unused github actions * minor copy change for convenience lol * feat: add DutchOrderTrade type to Swap components (#8) * feat: add flag for gouda (#5) * feat: add new signature details type (#4) * feat: local gouda activity (#9) * feat: Unified Routing API classic and dutch limit quote requests (#10) * chore: Rebase 5/26 (#13) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * feat: add UniswapX to Settings (#7) * feat: merge upstream 5/31 (#16) * feat: Upgrade unified-routing-api URL (#15) * chore: merge upstream 6/2 (#19) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * feat: uniswapx gas tooltip (#12) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * feat: swap callback (#17) * feat: gouda gating (#14) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * fix: settings e2e test (#22) * feat: update swap callback to add orders to redux state (#18) * chore: Fix types for useBestTrade return result (#21) * feat: gql gouda orders (#20) * feat: show $0 for gas fee for now (#25) * chore: Rebase 06/08 (#26) Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org> * feat: poll on order submit (#23) * feat: update gouda-sdk to 1.0.0-alpha.3 (#31) * feat: rename gasUseEstimateUSD for dutch orders (#30) Co-authored-by: Tina Zheng <tina.s.zheng+github@gmail.com> * chore: Fix response types (#36) * feat: Gouda ETH input flow (#29) Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org> * fix: use trade to determine what router label to show (#41) * feat: open uniswapx modal on click (#32) * feat: gouda logging new params in swap quote received (#33) * fix: wrap step ui fixes (#40) * feat: use BE deadline padding (#46) * chore: merge 6/23 (#50) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> * feat: Gouda opt-in flow request logic (#37) Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> * feat: hide slippage and deadline settings when the current trade is gouda (#44) * feat: use settled order amounts (#45) * feat: fetch receipt before dispatch (#49) * fix: updated order popups to launch modal (#48) * feat: Use slippage value from URA response for UniswapX trades (#51) * fix: Bump gouda-sdk to match backend response for quotes (#58) * feat: Change gouda order status URL param from offerer -> swapper (#59) * feat: disable opt in flow (#57) * feat: Dont show USD value change for uniswapx trades (#55) * fix: Don't use WETH as input currency for Classic ETH-in trades (#54) * feat: Reset to WETH after wrap is complete (#52) * fix: correct descriptor in UniswapX activity row items (#61) * fix: align review modal and gouda activity modal (#60) Co-authored-by: Charles Bachmeier <charles@bachmeier.io> * feat: Get wrap and approve gas info (#53) Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> * fix: restore summary view when wrap is rejected (#66) * fix: serialize tx receipts before storing (#64) * fix: Insufficient balance check should read from the right currency (#65) * feat: update designs for gas tooltips (#67) * fix: UniswapX gas descriptor boolean (#69) * chore: Bump conedison for better gas price formatting (#70) * chore: Switch from gouda-sdk to uniswapx-sdk (#71) * chore: Rename all variables `gouda` to UniswapX (#72) * chore: Merge 7/8/23 (#73) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com> * chore(conedison): update package (#77) * feat: add opt-in UI (#68) * chore: address some todos (#79) * chore: Rename feature flag from gouda_enabled to uniswapx_enabled (#81) * feat: Copy changes (#82) * fix: improve timings on animations for gouda opt-in (#80) * chore: Use updated URLs (#84) * chore: Merge 7/14 (#85) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com> * remove changes to github actions files * fix import * actually revert changes to yml * remove method export * feat: Add feature flag for synthetic quotes (#6938) * fix: use Lingui Trans macro (#6943) * fix: use trans macro * add comments * fix: update updater.tsx (#6942) * fix: reformat variable to use ms * move interval definition above getOrderStatus * lint :) * revert * chore: bunch of nits (#6944) bunch of nits * fix: translations etc (#6945) * chore: Remove placeholder signature types (#6937) remove placeholder * chore: merge main into branch (#6948) * fix: Handle Scientific Notation for NFT Collection Activity Prices (#6936) wrap nft activity price in * fix: e2e tests (#6941) * fix: e2e test * fix: set flag for buy-crypto-modal test * fix: fund DAI --------- Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> --------- Co-authored-by: Charles Bachmeier <charles@bachmeier.io> * feat: make inputCurrency optional for swapheader (#6947) * make inputCurrency optional for swapheader * optional pass in * fix: function defined twice (#6950) fix lint * test: add signatureToActivity undefined tests (#6949) * fix: update token lists schema (#6951) fix: update token list schema * chore: some last nits (#6953) * refactor: base type * test: useUserDisabledUniswapX * chore: simplify useAllSignatures usage * chore: standard check order * lint --------- Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org> Co-authored-by: marktoda <toda.mark@gmail.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com>
2023-07-15 00:46:59 +03:00
cy.contains('Swap submitted')
feat: permit2 flow updates (#6538) * test: swap flow cypress tests * fix: use default parameter * feat: use Swap Component on TDP * feat: auto nav for TDP tokens * chore: merge * chore: merge * chore: merge * chore: merge * fix: remove extra inputCurrency URL parsing logic * fix: undo last change * fix: pass expected chain id to swap component * fix: search for default tokens on unconnected networks if needed * test: e2e test for l2 token * fix: delete irrelevant tests * fix: address comments * fix: lint error * test: update TDP e2e tests * fix: use pageChainId for filter * fix: rename chainId * fix: typecheck * fix: chainId bug * fix: chainId required fixes * fix: bad merge in e2e test * fix: remove unused test util * fix: remove unnecessary variable * fix: token defaults * fix: address comments * fix: address comments and fix tests * fix: e2e test formatting, remove Maybe<> * fix: remove unused variable * fix: use feature flag for swap component on TDP * fix: back button * feat: copy review screen UI from widgetg * fix: modal padding * feat: add final detail row * fix: remove widget comment * fix: update unit tests * fix: code style consistency * fix: remove padding from AutoColumn * fix: update snapshots * fix: use semantic gaps * fix: more px and gaps * fix: design feedbacks * fix: button radius in summary modal * fix: design nits * feat: update design of summary modal * fix: font weight and vertical spacing * fix: update snapshots * fix: css nits * fix: modal flicker when refetching trade * wip: move approval to summary modal * wip: not working * feat: working * fix: fix flow * feat: simplify states and build new modal UI * feat: todos and differs fix * feat: update tx status modal * feat: split up approve and permit * feat: error state * feat: update success and error states * feat: undo changes to TxConfirmationModal * feat: remove step indicators when only one step * feat: move content into PendingModalContent component * fix: lint * fix: correct modal state when moving between steps * fix: comments * fix: code style improvements * feat: require trade to be defined * fix: remove extra props from ThemedTexts * fix: one more trans * fix: remove unused export * feat: remove undefined checks and other fixes * fix: update test * fix: add missing dollar sign * fix: remove null check and update test * fix: remove max width from detail row value * fix: remove isOpen prop * fix: isopen * feat: refactor approval flow into a hook * fix: tradeMeaningfullyDiffers improvement and prepareFlow fix * fix: address comments * feat: add comments explaining async state * fix: nits * fix: address comments * feat: permit2 e2e tests (#6541) * wip: move approval to summary modal * wip: not working * feat: working * fix: fix flow * feat: simplify states and build new modal UI * feat: todos and differs fix * feat: update tx status modal * feat: split up approve and permit * feat: error state * feat: update success and error states * feat: undo changes to TxConfirmationModal * feat: re-order functions * wip: move approval to summary modal * wip: not working * feat: update permit2 e2e tests * feat: tests passing * fix: swap test * fix: bad merge * chore: merge * fix: update tests for new modal * fix: testid fix * fix: test updates * fix: reduce nesting * test: remove line from test for debugging * fix: update tests * fix: more nesting in test * fix: update test * fix: reorganize test code
2023-05-25 23:49:27 +03:00
cy.get(getTestSelector('confirmation-close-icon')).click()
feat: additional routing option prototype (#6934) * add npm secret and modify github actions * inject npm secret for tests as well * revert changes to staging and prod actions because we arent going to use themmm * remove unused github actions * minor copy change for convenience lol * feat: add DutchOrderTrade type to Swap components (#8) * feat: add flag for gouda (#5) * feat: add new signature details type (#4) * feat: local gouda activity (#9) * feat: Unified Routing API classic and dutch limit quote requests (#10) * chore: Rebase 5/26 (#13) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * feat: add UniswapX to Settings (#7) * feat: merge upstream 5/31 (#16) * feat: Upgrade unified-routing-api URL (#15) * chore: merge upstream 6/2 (#19) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * feat: uniswapx gas tooltip (#12) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * feat: swap callback (#17) * feat: gouda gating (#14) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> * fix: settings e2e test (#22) * feat: update swap callback to add orders to redux state (#18) * chore: Fix types for useBestTrade return result (#21) * feat: gql gouda orders (#20) * feat: show $0 for gas fee for now (#25) * chore: Rebase 06/08 (#26) Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org> * feat: poll on order submit (#23) * feat: update gouda-sdk to 1.0.0-alpha.3 (#31) * feat: rename gasUseEstimateUSD for dutch orders (#30) Co-authored-by: Tina Zheng <tina.s.zheng+github@gmail.com> * chore: Fix response types (#36) * feat: Gouda ETH input flow (#29) Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org> * fix: use trade to determine what router label to show (#41) * feat: open uniswapx modal on click (#32) * feat: gouda logging new params in swap quote received (#33) * fix: wrap step ui fixes (#40) * feat: use BE deadline padding (#46) * chore: merge 6/23 (#50) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> * feat: Gouda opt-in flow request logic (#37) Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> * feat: hide slippage and deadline settings when the current trade is gouda (#44) * feat: use settled order amounts (#45) * feat: fetch receipt before dispatch (#49) * fix: updated order popups to launch modal (#48) * feat: Use slippage value from URA response for UniswapX trades (#51) * fix: Bump gouda-sdk to match backend response for quotes (#58) * feat: Change gouda order status URL param from offerer -> swapper (#59) * feat: disable opt in flow (#57) * feat: Dont show USD value change for uniswapx trades (#55) * fix: Don't use WETH as input currency for Classic ETH-in trades (#54) * feat: Reset to WETH after wrap is complete (#52) * fix: correct descriptor in UniswapX activity row items (#61) * fix: align review modal and gouda activity modal (#60) Co-authored-by: Charles Bachmeier <charles@bachmeier.io> * feat: Get wrap and approve gas info (#53) Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> * fix: restore summary view when wrap is rejected (#66) * fix: serialize tx receipts before storing (#64) * fix: Insufficient balance check should read from the right currency (#65) * feat: update designs for gas tooltips (#67) * fix: UniswapX gas descriptor boolean (#69) * chore: Bump conedison for better gas price formatting (#70) * chore: Switch from gouda-sdk to uniswapx-sdk (#71) * chore: Rename all variables `gouda` to UniswapX (#72) * chore: Merge 7/8/23 (#73) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com> * chore(conedison): update package (#77) * feat: add opt-in UI (#68) * chore: address some todos (#79) * chore: Rename feature flag from gouda_enabled to uniswapx_enabled (#81) * feat: Copy changes (#82) * fix: improve timings on animations for gouda opt-in (#80) * chore: Use updated URLs (#84) * chore: Merge 7/14 (#85) Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com> * remove changes to github actions files * fix import * actually revert changes to yml * remove method export * feat: Add feature flag for synthetic quotes (#6938) * fix: use Lingui Trans macro (#6943) * fix: use trans macro * add comments * fix: update updater.tsx (#6942) * fix: reformat variable to use ms * move interval definition above getOrderStatus * lint :) * revert * chore: bunch of nits (#6944) bunch of nits * fix: translations etc (#6945) * chore: Remove placeholder signature types (#6937) remove placeholder * chore: merge main into branch (#6948) * fix: Handle Scientific Notation for NFT Collection Activity Prices (#6936) wrap nft activity price in * fix: e2e tests (#6941) * fix: e2e test * fix: set flag for buy-crypto-modal test * fix: fund DAI --------- Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> --------- Co-authored-by: Charles Bachmeier <charles@bachmeier.io> * feat: make inputCurrency optional for swapheader (#6947) * make inputCurrency optional for swapheader * optional pass in * fix: function defined twice (#6950) fix lint * test: add signatureToActivity undefined tests (#6949) * fix: update token lists schema (#6951) fix: update token list schema * chore: some last nits (#6953) * refactor: base type * test: useUserDisabledUniswapX * chore: simplify useAllSignatures usage * chore: standard check order * lint --------- Co-authored-by: eddie <66155195+just-toby@users.noreply.github.com> Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com> Co-authored-by: Vignesh Mohankumar <me@vig.xyz> Co-authored-by: Jack Short <john.short.tj@gmail.com> Co-authored-by: Jordan Frankfurt <jordan@CORN-Jordan-949.frankfurt> Co-authored-by: Jordan Frankfurt <jordan@corn-jordan-949.lan> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nate Wienert <natewienert@gmail.com> Co-authored-by: Charles Bachmeier <charles@bachmeier.io> Co-authored-by: Charles Bachmeier <charlie@genie.xyz> Co-authored-by: Brendan Wong <35351983+LunrEclipse@users.noreply.github.com> Co-authored-by: cartcrom <cartergcromer@gmail.com> Co-authored-by: clrdo <129212060+clrdo@users.noreply.github.com> Co-authored-by: clrdo <clrdo@github.com> Co-authored-by: Eddie Dugan <eddie.dugan@uniswap.org> Co-authored-by: marktoda <toda.mark@gmail.com> Co-authored-by: Shubham Rasal <95695273+Shubham-Rasal@users.noreply.github.com> Co-authored-by: Saro Vindigni <sarovindigni@bolket.com> Co-authored-by: Jordan Frankfurt <<jordan@CORN-Jordan-949.frankfurt> Co-authored-by: John Short <john.short@CORN-Jack-899.local> Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: UL Service Account <hello-happy-puppy@users.noreply.github.com>
2023-07-15 00:46:59 +03:00
cy.contains('Swap submitted').should('not.exist')
cy.get(getTestSelector('web3-status-connected')).should('contain', '1 Pending')
// Mine transaction
cy.hardhat().then((hardhat) => hardhat.mine())
cy.wait('@eth_getTransactionReceipt')
// Verify transaction
cy.get(getTestSelector('web3-status-connected')).should('not.contain', 'Pending')
cy.get(getTestSelector('popups')).contains('Swapped')
const finalBalance = initialBalance + 1
cy.get('#swap-currency-output').contains(`Balance: ${finalBalance}`)
getBalance(USDC_MAINNET).should('eq', finalBalance)
})
})
})
})