fix: stop resetting modal when we interrupt quote polling (#6695)

* test(e2e): disable video compression

* refactor: improve popupList impl/test

* test(e2e): log JSON-RPC calls

* fix: retry backoff logic

* test(e2e): wait for hardhat/popup assertions

* fix: remove transactions after expired

* test(e2e): re-enable other swap tests

Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>

* chore: rm console.log

* fix: expire txs after 6h

* refactor: dry trade info

* test(e2e): use default deadline

* test(e2e): use aliases for permit2 test

* test(e2e): automine/off in beforeEach

* test(e2e): rm intermediate screen with no pause

* fix: stop resetting modal when we interrupt quote polling'

* feat: add e2e test for window losing focus

* fix: move test

* fix: combine tests

---------

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
Co-authored-by: Jordan Frankfurt <jordanwfrankfurt@gmail.com>
This commit is contained in:
eddie 2023-06-08 13:44:47 -07:00 committed by GitHub
parent 08b8bdd769
commit 98f4af55c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

@ -53,6 +53,9 @@ describe('Permit2', () => {
it('swaps after completing full permit2 approval process', () => {
initiateSwap()
// verify that the modal retains its state when the window loses focus
cy.window().trigger('blur')
// Verify token approval
cy.contains('Enable spending DAI on Uniswap')
cy.wait('@eth_sendRawTransaction')

@ -12,7 +12,6 @@ import { useGetQuoteQuery as useGetQuoteQueryV2 } from 'state/routing/v2Slice'
import { InterfaceTrade, QuoteState, TradeState } from './types'
const TRADE_INVALID = { state: TradeState.INVALID, trade: undefined } as const
const TRADE_NOT_FOUND = { state: TradeState.NO_ROUTE_FOUND, trade: undefined } as const
const TRADE_LOADING = { state: TradeState.LOADING, trade: undefined } as const
@ -79,7 +78,7 @@ export function useRoutingAPITrade<TTradeType extends TradeType>(
return useMemo(() => {
if (!amountSpecified || isError || !queryArgs) {
return TRADE_INVALID
return { state: TradeState.INVALID, trade: tradeResult?.trade }
} else if (tradeResult?.state === QuoteState.NOT_FOUND && isCurrent) {
return TRADE_NOT_FOUND
} else if (!tradeResult?.trade) {