2023-09-15 23:05:56 +03:00
|
|
|
import { ChainId, MaxUint256, UNI_ADDRESSES } from '@uniswap/sdk-core'
|
|
|
|
|
|
|
|
const UNI_MAINNET = UNI_ADDRESSES[ChainId.MAINNET]
|
|
|
|
|
2020-05-21 06:45:49 +03:00
|
|
|
describe('Remove Liquidity', () => {
|
2023-09-15 23:05:56 +03:00
|
|
|
it('loads the token pair in v2', () => {
|
|
|
|
cy.visit(`/remove/v2/ETH/${UNI_MAINNET}`)
|
2020-05-27 20:13:31 +03:00
|
|
|
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'ETH')
|
2023-03-03 22:20:41 +03:00
|
|
|
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'UNI')
|
2020-05-21 06:45:49 +03:00
|
|
|
})
|
2023-09-15 23:05:56 +03:00
|
|
|
|
|
|
|
it('loads the token pair in v3', () => {
|
|
|
|
cy.visit(`/remove/1`)
|
|
|
|
cy.get('#remove-liquidity-tokens').should('contain.text', 'UNI/ETH')
|
|
|
|
|
|
|
|
cy.get('#remove-pooled-tokena-symbol').should('contain.text', 'Pooled UNI')
|
|
|
|
cy.get('#remove-pooled-tokenb-symbol').should('contain.text', 'Pooled ETH')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should redirect to error pages if pool does not exist', () => {
|
|
|
|
// Duplicate-token v2 pools redirect to position unavailable
|
|
|
|
cy.visit(`/remove/v2/ETH/ETH`)
|
|
|
|
cy.contains('Position unavailable')
|
|
|
|
|
|
|
|
// Single-token pools don't exist
|
|
|
|
cy.visit('/remove/v2/ETH')
|
|
|
|
cy.url().should('match', /\/not-found/)
|
|
|
|
|
|
|
|
// Nonexistent v3 pool
|
|
|
|
cy.visit(`/remove/${MaxUint256}`)
|
|
|
|
cy.contains('Position unavailable')
|
|
|
|
})
|
2020-05-21 06:45:49 +03:00
|
|
|
})
|