Skip to content

Commit

Permalink
Updating, adding and fixing integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandro committed Mar 15, 2022
1 parent bad2bdf commit 9a7e473
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
27 changes: 13 additions & 14 deletions cypress-custom/integration/swapMod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,46 @@ describe('Swap (mod)', () => {
cy.visit('/swap')
})

/* it.skip('starts with an ETH/USDC swap and quotes it', () => {
it('starts with an Native/USDC swap and quotes it', () => {
cy.get('#swap-currency-input .token-amount-input').should('have.value', '1')
cy.get('#swap-currency-input .token-symbol-container').should('contain.text', 'ETH')
cy.get('#swap-currency-input .token-symbol-container').should('contain.text', 'WETH')
cy.get('#swap-currency-output .token-amount-input').should('not.have.value', '')
cy.get('#swap-currency-output .token-symbol-container').should('contain.text', 'USDC')
}) */
})

it('can enter an amount into input', () => {
cy.get('#swap-currency-input .token-amount-input')
// .clear()
.clear()
.type('0.001', { delay: 400, force: true })
.should('have.value', '0.001')
})

it('zero swap amount', () => {
cy.get('#swap-currency-input .token-amount-input')
// .clear()
.clear()
.type('0.0', { delay: 400, force: true })
.should('have.value', '0.0')
})

it('invalid swap amount', () => {
cy.get('#swap-currency-input .token-amount-input')
// .clear()
.clear()
.type('\\', { delay: 400, force: true })
.should('have.value', '')
})

it.skip('can enter an amount into output', () => {
it('can enter an amount into output', () => {
cy.get('#swap-currency-output .token-amount-input')
.clear()
.type('0.001', { delay: 400, force: true })
.should('have.value', '0.001')
})

it('zero output amount', () => {
cy.get('#swap-currency-output .token-amount-input')
.type('0.0', { delay: 400, force: true })
.should('have.value', '0.0')
cy.get('#swap-currency-output .token-amount-input').clear().type('0.0', { delay: 400 }).should('have.value', '0.0')
})

it.skip('can swap ETH for DAI', () => {
it('can swap Native 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 })
Expand All @@ -68,16 +67,16 @@ describe('Swap (mod)', () => {
cy.get('#confirm-expert-mode').click()
})

it.skip('add a recipient is visible', () => {
it('add a recipient is visible', () => {
cy.get('#add-recipient-button').should('be.visible')
})

it.skip('add a recipient', () => {
it('add a recipient', () => {
cy.get('#add-recipient-button').click()
cy.get('#recipient').should('exist')
})

it.skip('remove recipient', () => {
it('remove recipient', () => {
cy.get('#add-recipient-button').click()
cy.get('#remove-recipient-button').click()
cy.get('#recipient').should('not.exist')
Expand Down
9 changes: 3 additions & 6 deletions cypress/integration/swap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,33 @@ describe('Swap', () => {
cy.visit('/swap')
})

// TODO: add something similar
it.skip('starts with an ETH/USDC swap and quotes it', () => {
cy.get('#swap-currency-input .token-amount-input').should('have.value', '1')
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', 'USDC')
})

it('can enter an amount into input', () => {
it.skip('can enter an amount into input', () => {
cy.get('#swap-currency-input .token-amount-input')
.clear()
.type('0.001', { delay: 200 })
.should('have.value', '0.001')
})

// TODO: enable it?
it.skip('zero swap amount', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('0.0', { delay: 200 }).should('have.value', '0.0')
})

it('invalid swap amount', () => {
it.skip('invalid swap amount', () => {
cy.get('#swap-currency-input .token-amount-input').clear().type('\\', { delay: 200 }).should('have.value', '')
})

// TODO: enable it?
it.skip('can enter an amount into output', () => {
cy.get('#swap-currency-output .token-amount-input').type('0.001', { delay: 200 }).should('have.value', '0.001')
})

it('zero output amount', () => {
it.skip('zero output amount', () => {
cy.get('#swap-currency-output .token-amount-input').type('0.0', { delay: 200 }).should('have.value', '0.0')
})

Expand Down

0 comments on commit 9a7e473

Please sign in to comment.