chore: e2e insufficient liquidity test (#7075)
* chore: e2e insufficient liquidity test * Update cypress/e2e/swap/errors.test.ts Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * fixing lint * waiting for quote * stubbing insufficient liquidity response * req reply * trying full url * maybe cors * moving before visit * adding back timeout * Revert "adding back timeout" This reverts commit 89cff3afb815f5e5db005347f20812b83e047057. * in describe block * moving to new file * moving to errors test file * moving comment * removing extra describe --------- Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
This commit is contained in:
parent
b4f3555600
commit
c27e70b87c
@ -116,4 +116,17 @@ describe('Swap errors', () => {
|
||||
getBalance(DAI).should('be.closeTo', initialBalance + 200, 1)
|
||||
})
|
||||
})
|
||||
|
||||
it('no liquidity', () => {
|
||||
// The API response is too variable so stubbing a 404.
|
||||
cy.intercept('POST', 'https://api.uniswap.org/v2/quote', {
|
||||
statusCode: 404,
|
||||
fixture: 'insufficientLiquidity.json',
|
||||
})
|
||||
|
||||
cy.visit(`/swap?inputCurrency=${USDC_MAINNET.address}&outputCurrency=${DAI.address}`)
|
||||
cy.get('#swap-currency-output .token-amount-input').type('100000000000000').should('have.value', '100000000000000') // 100 trillion
|
||||
cy.contains('Insufficient liquidity for this trade.')
|
||||
cy.get('#swap-button').should('not.exist')
|
||||
})
|
||||
})
|
||||
|
5
cypress/fixtures/insufficientLiquidity.json
Normal file
5
cypress/fixtures/insufficientLiquidity.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errorCode": "QUOTE_ERROR",
|
||||
"detail": "No quotes available",
|
||||
"id": "63363cc1-d474-4584-b386-7c356814b79f"
|
||||
}
|
Loading…
Reference in New Issue
Block a user