a0d4710a11
* Search modal performance improvements * Move more code out of the search modal * Add the question helper to the search * Fix a couple lint errors * Fix the tests, duplicate import text * Hide the token info on small screens, flex the list * Fix token sorting, have a link that focuses and shows a tooltip for the search input * Remove reach tooltip css * Fix pair balances in the search modal * Get the arrow working * Only clear the input when they re-open * Better way to exclude props * More small performance tweaks
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
describe('Swap', () => {
|
|
beforeEach(() => cy.visit('/swap'))
|
|
it('can enter an amount into input', () => {
|
|
cy.get('#swap-currency-input .token-amount-input')
|
|
.type('0.001')
|
|
.should('have.value', '0.001')
|
|
})
|
|
|
|
it('zero swap amount', () => {
|
|
cy.get('#swap-currency-input .token-amount-input')
|
|
.type('0.0')
|
|
.should('have.value', '0.0')
|
|
})
|
|
|
|
it('invalid swap amount', () => {
|
|
cy.get('#swap-currency-input .token-amount-input')
|
|
.type('\\')
|
|
.should('have.value', '')
|
|
})
|
|
|
|
it('can enter an amount into output', () => {
|
|
cy.get('#swap-currency-output .token-amount-input')
|
|
.type('0.001')
|
|
.should('have.value', '0.001')
|
|
})
|
|
|
|
it('zero output amount', () => {
|
|
cy.get('#swap-currency-output .token-amount-input')
|
|
.type('0.0')
|
|
.should('have.value', '0.0')
|
|
})
|
|
|
|
it('can swap ETH for DAI', () => {
|
|
cy.get('#swap-currency-output .open-currency-select-button').click()
|
|
cy.get('.token-item-0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735').should('be.visible')
|
|
cy.get('.token-item-0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735').click({ force: true })
|
|
cy.get('#swap-currency-input .token-amount-input').should('be.visible')
|
|
cy.get('#swap-currency-input .token-amount-input').type('0.001', { force: true })
|
|
cy.get('#swap-currency-output .token-amount-input').should('not.equal', '')
|
|
cy.get('#show-advanced').click()
|
|
cy.get('#swap-button').click()
|
|
cy.get('#confirm-swap-or-send').should('contain', 'Confirm Swap')
|
|
})
|
|
})
|