uniswap-interface-uncensored/cypress/e2e/wallet-dropdown.test.ts
Zach Pomerantz efb76200ce
feat: adds permit2 and universal router integration (#5554)
* feat: disable approval if permit2 is enabled

* feat: add permit through permit2

* fix: include analytics

* chore: pass permit to useSwapCallback

* feat: use universal router

* fix: remove unused import + update param formmating

* fix: suppress eslint error on restricted imports

* fix: lint issues

* fix: do not disable unapproved permit2 swap

* Revert "fix: do not disable unapproved permit2 swap"

This reverts commit be3f758e36db90edf205cbe35d091da3c12c1737.

* fix: do not disable unapproved permit2 swap

* fix: allow error for permit2 swap

* fix: better sequencing to handle rejections

* build: upgrade universal router sdk to include goerli address

* fix: mv block time into const

* fix: rm unnecessary id

* fix: cast swap error to string

* chore: parity with widgets

* test: rm old feature flags

* fix: gate permit2 on chain deployment

* fix: import for gate

Co-authored-by: Yannie Yip <yannie.yip@uniswap.org>
2022-12-07 11:24:50 -08:00

50 lines
2.1 KiB
TypeScript

import { getTestSelector } from '../utils'
describe('Wallet Dropdown', () => {
before(() => {
cy.visit('/')
})
it('should change the theme', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Light theme').should('exist')
})
it('should select a language', () => {
cy.get(getTestSelector('wallet-select-language')).click()
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Taal')
cy.get(getTestSelector('wallet-language-item')).contains('English').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Language')
cy.get(getTestSelector('wallet-back')).click()
})
it('should be able to view transactions', () => {
cy.get(getTestSelector('wallet-transactions')).click()
cy.get(getTestSelector('wallet-empty-transaction-text')).should('exist')
cy.get(getTestSelector('wallet-back')).click()
})
it('should change the theme when not connected', () => {
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Dark theme').should('exist')
})
it('should select a language when not connected', () => {
cy.get(getTestSelector('wallet-select-language')).click()
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Taal')
cy.get(getTestSelector('wallet-language-item')).contains('English').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Language')
cy.get(getTestSelector('wallet-back')).click()
})
it('should open the wallet connect modal from the drop down when not connected', () => {
cy.get(getTestSelector('wallet-connect-wallet')).click()
cy.get(getTestSelector('wallet-modal')).should('exist')
cy.get(getTestSelector('wallet-modal-close')).click()
})
})